summaryrefslogtreecommitdiff
path: root/test/parallel/test-require-symlink.js
diff options
context:
space:
mode:
authorMarc Udoff <udoff@deshaw.com>2016-09-20 18:21:44 -0400
committerIlkka Myller <ilkka.myller@nodefield.com>2016-10-24 22:13:08 +0300
commitd3b1a2b4ddab18eade677213d8692f2e4d14e946 (patch)
tree9d8eba118f968b59df38c6e3f43feae1ec347895 /test/parallel/test-require-symlink.js
parent929979d9d798ad2ee66645a478bdda6092cc2c2b (diff)
downloadandroid-node-v8-d3b1a2b4ddab18eade677213d8692f2e4d14e946.tar.gz
android-node-v8-d3b1a2b4ddab18eade677213d8692f2e4d14e946.tar.bz2
android-node-v8-d3b1a2b4ddab18eade677213d8692f2e4d14e946.zip
src: add NODE_PRESERVE_SYMLINKS environment variable
Add a way through environment variables to set the --preserve-symlinks flag. Any non-null value of NODE_PRESERVE_SYMLINKS will enable symlinks. PR-URL: https://github.com/nodejs/node/pull/8749 Fixes: https://github.com/nodejs/node/issues/8509 Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-require-symlink.js')
-rw-r--r--test/parallel/test-require-symlink.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js
index 38139ef1cf..0792bc13bb 100644
--- a/test/parallel/test-require-symlink.js
+++ b/test/parallel/test-require-symlink.js
@@ -6,6 +6,7 @@ const path = require('path');
const fs = require('fs');
const exec = require('child_process').exec;
const spawn = require('child_process').spawn;
+const util = require('util');
common.refreshTmpDir();
@@ -53,7 +54,16 @@ function test() {
const node = process.execPath;
const child = spawn(node, ['--preserve-symlinks', linkScript]);
child.on('close', function(code, signal) {
- assert(!code);
+ assert.strictEqual(code, 0);
+ assert(!signal);
+ });
+
+ // Also verify that symlinks works for setting preserve via env variables
+ const childEnv = spawn(node, [linkScript], {
+ env: util._extend(process.env, {NODE_PRESERVE_SYMLINKS: '1'})
+ });
+ childEnv.on('close', function(code, signal) {
+ assert.strictEqual(code, 0);
assert(!signal);
});
}