Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

  • Loading branch information...
Igor Zinkovsky authored and ry committed Oct 8, 2011
1 parent 12486a6 commit af014c1a5efce54a8154d8758657852954685e0c
Showing with 18 additions and 8 deletions.
  1. +18 −8 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);

0 comments on commit af014c1

Please sign in to comment.
You can’t perform that action at this time.