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 assert = require('assert');
var path = require('path');
var match = false;
var isDebug = process.features.debug;
var debugPath = path.normalize(path.join(__dirname, '..', '..',
'out', 'Debug', 'node'));
var defaultPath = path.normalize(path.join(__dirname, '..', '..',
'out', 'Release', 'node'));
var debugPaths = [ path.normalize(path.join(__dirname, '..', '..',
'out', 'Debug', 'node')),
path.normalize(path.join(__dirname, '..', '..',
'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('defaultPath: ' + defaultPath);
console.error('debugPaths: ' + debugPaths);
console.error('defaultPaths: ' + defaultPaths);
console.error('process.execPath: ' + process.execPath);
if (isDebug) {
assert.ok(process.execPath.indexOf(debugPath) == 0);
debugPaths.forEach(function(path) {
match = match || process.execPath.indexOf(path) == 0;
});
} 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