python: more informative error

PR-URL: https://github.com/nodejs/node-gyp/pull/1269
Refs: https://github.com/nodejs/node-gyp/pull/1582
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: João Reis <reis@janeasystems.com>
This commit is contained in:
Refael Ackermann 2017-08-19 23:18:01 -04:00 committed by Rod Vagg
parent d3b21220a0
commit 49ab79d221
No known key found for this signature in database
GPG key ID: C273792F7D83545D
5 changed files with 44 additions and 23 deletions

View file

@ -74,7 +74,7 @@ test('find python - python', function (t) {
})
test('find python - python too old', function (t) {
t.plan(4)
t.plan(5)
var f = new TestPythonFinder('python', done)
f.which = function(program, cb) {
@ -89,12 +89,13 @@ test('find python - python too old', function (t) {
f.checkPython()
function done(err) {
t.ok(/is not supported by gyp/.test(err))
t.ok(/this version is not supported by GYP/.test(err))
t.ok(/For more information consult the documentation/.test(err))
}
})
test('find python - python too new', function (t) {
t.plan(4)
t.plan(5)
var f = new TestPythonFinder('python', done)
f.which = function(program, cb) {
@ -109,7 +110,8 @@ test('find python - python too new', function (t) {
f.checkPython()
function done(err) {
t.ok(/is not supported by gyp/.test(err))
t.ok(/this version is not supported by GYP/.test(err))
t.ok(/For more information consult the documentation/.test(err))
}
})
@ -124,7 +126,7 @@ test('find python - no python', function (t) {
f.checkPython()
function done(err) {
t.ok(/Can't find Python executable/.test(err))
t.ok(/For more information consult the documentation/.test(err))
}
})
@ -171,7 +173,7 @@ test('find python - no python2, no python, unix', function (t) {
f.checkPython()
function done(err) {
t.ok(/Can't find Python executable/.test(err))
t.ok(/For more information consult the documentation/.test(err))
}
})
@ -242,7 +244,7 @@ test('find python - python 3, use python launcher', function (t) {
test('find python - python 3, use python launcher, python 2 too old',
function (t) {
t.plan(9)
t.plan(10)
var f = new TestPythonFinder('python', done)
f.checkedPythonLauncher = false
@ -272,7 +274,8 @@ test('find python - python 3, use python launcher, python 2 too old',
f.checkPython()
function done(err) {
t.ok(/is not supported by gyp/.test(err))
t.ok(/this version is not supported by GYP/.test(err))
t.ok(/For more information consult the documentation/.test(err))
}
})
@ -334,6 +337,6 @@ test('find python - no python, no python launcher, bad guess', function (t) {
f.checkPython()
function done(err) {
t.ok(/Can't find Python executable/.test(err))
t.ok(/For more information consult the documentation/.test(err))
}
})