Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
fix for simple/test-executable-path.js on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zinkovsky authored and ry committed Oct 8, 2011
1 parent 12486a6 commit af014c1
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions test/simple/test-executable-path.js
Expand Up @@ -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);

0 comments on commit af014c1

Please sign in to comment.