Permalink
Browse files

Fix test on Windows

There were/are 2 issues

1. Backslashes in paths (sigh)
2. child process exec has probelm with executing unix style
executables on Windows. Skip tests on Windows :'(
  • Loading branch information...
1 parent c5aa73f commit d04cd80b058c42ea49e778ce2f3afab0a6b60b7a @arv arv committed with arv Apr 1, 2015
Showing with 20 additions and 4 deletions.
  1. +1 −1 test/modular/Mocha6.js
  2. +18 −2 test/unit/node/generated-code-dependencies.js
  3. +1 −1 tval
@@ -43,7 +43,7 @@ export class Mocha6 extends Mocha {
importFiles() {
var promiseImports = this.files.map((file) => {
- file = path.resolve(file);
+ file = path.resolve(file).replace(/\\/g, '/');
this.suite.emit('pre-require', global, file, this);
return System.import(file, {metadata: this.options.importMetadata}).
then(() => {
@@ -272,6 +272,9 @@ suite('context test', function() {
});
test('sourceMappingURL from --source-maps=true and deep directories', function(done){
+ // FIXME: exec fails to execute traceur on windows.
+ if (process.platform === 'win32') return done();
+
var deepDirectory = 'test/wiki/CompilingOffline/deepDirectory/';
var pwd = process.cwd();
process.chdir(deepDirectory);
@@ -319,8 +322,9 @@ suite('context test', function() {
var executable = 'node ' + resolve('src/node/command.js');
var cmd = executable + ' --source-maps=memory ' + inputFilename;
exec(cmd, function(error, stdout, stderr) {
- var fileLinePos = error.message.
- indexOf('test/unit/runtime/resources/throwsErrorES6.js:3');
+ var message = error.message.replace(/\\/g, '/');
+ var fileLinePos = message.indexOf(
+ 'test/unit/runtime/resources/throwsErrorES6.js:3');
assert.notEqual(fileLinePos, -1);
done();
});
@@ -428,6 +432,9 @@ suite('context test', function() {
});
test('./traceur can mix require() and import', function(done) {
+ // FIXME: exec fails to execute traceur on windows.
+ if (process.platform === 'win32') return done();
+
var cmd = './traceur --require -- ./test/unit/node/resources/testForRequireAndImport.js';
exec(cmd, function(error, stdout, stderr) {
assert.isNull(error);
@@ -437,6 +444,9 @@ suite('context test', function() {
});
test('./traceur warns if the runtime is missing', function(done) {
+ // FIXME: exec fails to execute traceur on windows.
+ if (process.platform === 'win32') return done();
+
tempFileName = resolve(uuid.v4() + '.js');
var cmd = './traceur --modules=commonjs --out ' + tempFileName +
' ./src/runtime/generators.js';
@@ -455,6 +465,9 @@ suite('context test', function() {
});
test('./traceur --source-maps can report errors on the correct lines', function(done) {
+ // FIXME: exec fails to execute traceur on windows.
+ if (process.platform === 'win32') return done();
+
var cmd = './traceur --source-maps=memory ./test/unit/node/resources/testErrorForSourceMaps.js';
exec(cmd, function(error, stdout, stderr) {
var m = /Test error on line ([0-9]*)/.exec(error);
@@ -578,6 +591,9 @@ suite('context test', function() {
});
test('tval uses argv', function(done) {
+ // FIXME: exec fails to execute tval on windows.
+ if (process.platform === 'win32') return done();
+
var cmd = './tval test/unit/node/resources/test_tval.js --arg1 --arg2 arg3';
exec(cmd, function(error, stdout, stderr) {
assert.isNull(error);
View
@@ -37,7 +37,7 @@ if (!filename || helps.indexOf(filename) !== -1) {
process.exit(0);
}
-var moduleName = path.resolve(filename.replace(/\\/g, '/'));
+var moduleName = path.resolve(filename).replace(/\\/g, '/');
// Simulate a future where it looks like node is executing our program
process.argv = [process.mainModule.filename].concat(process.argv.slice(2));

0 comments on commit d04cd80

Please sign in to comment.