diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-05-11 15:10:00 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-05-14 16:05:48 +0300 |
commit | 945f20808143d954fea73e4ac3a0d71cf73c9b2c (patch) | |
tree | 23bdae68aa818091fbcb22c29f4b878f60cd99ee /test/parallel/test-preload.js | |
parent | 9516aa19c16cbfda6917c4fb8d6aecf2da8a16aa (diff) | |
download | android-node-v8-945f20808143d954fea73e4ac3a0d71cf73c9b2c.tar.gz android-node-v8-945f20808143d954fea73e4ac3a0d71cf73c9b2c.tar.bz2 android-node-v8-945f20808143d954fea73e4ac3a0d71cf73c9b2c.zip |
test: make the rest of tests path-independent
Permit spaces in paths to a Node.js executable and test scripts.
PR-URL: https://github.com/nodejs/node/pull/12972
Fixes: https://github.com/nodejs/node/issues/12773
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-preload.js')
-rw-r--r-- | test/parallel/test-preload.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index b0326c47b1..9d24fbb365 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -16,7 +16,7 @@ const nodeBinary = process.argv[0]; const preloadOption = (preloads) => { let option = ''; preloads.forEach(function(preload, index) { - option += `-r ${preload} `; + option += `-r "${preload}" `; }); return option; }; @@ -30,7 +30,7 @@ const fixtureD = fixture('define-global.js'); const fixtureThrows = fixture('throws_error4.js'); // test preloading a single module works -childProcess.exec(`${nodeBinary} ${preloadOption([fixtureA])} ${fixtureB}`, +childProcess.exec(`"${nodeBinary}" ${preloadOption([fixtureA])} "${fixtureB}"`, function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual(stdout, 'A\nB\n'); @@ -38,7 +38,7 @@ childProcess.exec(`${nodeBinary} ${preloadOption([fixtureA])} ${fixtureB}`, // test preloading multiple modules works childProcess.exec( - `${nodeBinary} ${preloadOption([fixtureA, fixtureB])} ${fixtureC}`, + `"${nodeBinary}" ${preloadOption([fixtureA, fixtureB])} "${fixtureC}"`, function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual(stdout, 'A\nB\nC\n'); @@ -47,7 +47,7 @@ childProcess.exec( // test that preloading a throwing module aborts childProcess.exec( - `${nodeBinary} ${preloadOption([fixtureA, fixtureThrows])} ${fixtureB}`, + `"${nodeBinary}" ${preloadOption([fixtureA, fixtureThrows])} "${fixtureB}"`, function(err, stdout, stderr) { if (err) { assert.strictEqual(stdout, 'A\n'); @@ -59,7 +59,7 @@ childProcess.exec( // test that preload can be used with --eval childProcess.exec( - `${nodeBinary} ${preloadOption([fixtureA])}-e "console.log('hello');"`, + `"${nodeBinary}" ${preloadOption([fixtureA])}-e "console.log('hello');"`, function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual(stdout, 'A\nhello\n'); @@ -105,7 +105,7 @@ replProc.on('close', function(code) { // test that preload placement at other points in the cmdline // also test that duplicated preload only gets loaded once childProcess.exec( - `${nodeBinary} ${preloadOption([fixtureA])}-e "console.log('hello');" ${ + `"${nodeBinary}" ${preloadOption([fixtureA])}-e "console.log('hello');" ${ preloadOption([fixtureA, fixtureB])}`, function(err, stdout, stderr) { assert.ifError(err); @@ -115,7 +115,7 @@ childProcess.exec( // test that preload works with -i const interactive = childProcess.exec( - `${nodeBinary} ${preloadOption([fixtureD])}-i`, + `"${nodeBinary}" ${preloadOption([fixtureD])}-i`, common.mustCall(function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual(stdout, "> 'test'\n> "); @@ -126,8 +126,8 @@ interactive.stdin.write('a\n'); interactive.stdin.write('process.exit()\n'); childProcess.exec( - `${nodeBinary} --require ${fixture('cluster-preload.js')} ${ - fixture('cluster-preload-test.js')}`, + `"${nodeBinary}" --require "${fixture('cluster-preload.js')}" "${ + fixture('cluster-preload-test.js')}"`, function(err, stdout, stderr) { assert.ifError(err); assert.ok(/worker terminated with code 43/.test(stdout)); @@ -137,8 +137,8 @@ childProcess.exec( // https://github.com/nodejs/node/issues/1691 process.chdir(common.fixturesDir); childProcess.exec( - `${nodeBinary} --expose_natives_as=v8natives --require ` + - `${fixture('cluster-preload.js')} cluster-preload-test.js`, + `"${nodeBinary}" --expose_natives_as=v8natives --require ` + + `"${fixture('cluster-preload.js')}" cluster-preload-test.js`, function(err, stdout, stderr) { assert.ifError(err); assert.ok(/worker terminated with code 43/.test(stdout)); |