Browse Source

fix for simple/test-executable-path.js on windows

v0.7.4-release
Igor Zinkovsky 13 years ago
committed by Ryan Dahl
parent
commit
af014c1a5e
  1. 26
      test/simple/test-executable-path.js

26
test/simple/test-executable-path.js

@ -22,21 +22,31 @@
var common = require('../common'); var common = require('../common');
var assert = require('assert'); var assert = require('assert');
var path = require('path'); var path = require('path');
var match = false;
var isDebug = process.features.debug; var isDebug = process.features.debug;
var debugPath = path.normalize(path.join(__dirname, '..', '..', var debugPaths = [ path.normalize(path.join(__dirname, '..', '..',
'out', 'Debug', 'node')); 'out', 'Debug', 'node')),
var defaultPath = path.normalize(path.join(__dirname, '..', '..', path.normalize(path.join(__dirname, '..', '..',
'out', 'Release', 'node')); 'Debug', 'node'))];
var defaultPaths = [ path.normalize(path.join(__dirname, '..', '..',
'out', 'Release', 'node')),
path.normalize(path.join(__dirname, '..', '..',
'Release', 'node'))];
console.error('debugPath: ' + debugPath); console.error('debugPaths: ' + debugPaths);
console.error('defaultPath: ' + defaultPath); console.error('defaultPaths: ' + defaultPaths);
console.error('process.execPath: ' + process.execPath); console.error('process.execPath: ' + process.execPath);
if (isDebug) { if (isDebug) {
assert.ok(process.execPath.indexOf(debugPath) == 0); debugPaths.forEach(function(path) {
match = match || process.execPath.indexOf(path) == 0;
});
} else { } else {
assert.ok(process.execPath.indexOf(defaultPath) == 0); defaultPaths.forEach(function(path) {
match = match || process.execPath.indexOf(path) == 0;
});
} }
assert.ok(match);

Loading…
Cancel
Save