aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGibson Fahnestock <gib@uk.ibm.com>2017-01-10 13:43:08 +0000
committerJames M Snell <jasnell@gmail.com>2017-01-12 13:32:02 -0800
commitdd2d3d3f9daccf61c5629a469e4dc8700bbe6890 (patch)
tree692a3fb00bf6af18b420a43feff9f76eb0095ccf /test
parent822bbe0bb24e5d12780d13985dd4b810d15cff5b (diff)
downloadandroid-node-v8-dd2d3d3f9daccf61c5629a469e4dc8700bbe6890.tar.gz
android-node-v8-dd2d3d3f9daccf61c5629a469e4dc8700bbe6890.tar.bz2
android-node-v8-dd2d3d3f9daccf61c5629a469e4dc8700bbe6890.zip
test: use realpath for NODE_TEST_DIR in common.js
If you don't specify NODE_TEST_DIR, common.tmpDir will resolve to the realpath of `node/test`. If you do specify NODE_TEST_DIR (with the environment variable or by running or by running tools/test.py --test-dir=x), common.tmpDir (which is resolved from testRoot) uses the symbolic path (doesn't resolve symlinks). This uses fs.realpathSync() to fix that. PR-URL: https://github.com/nodejs/node/pull/10723 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/README.md2
-rw-r--r--test/common.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/README.md b/test/README.md
index 4312e6fcf3..94f77eda51 100644
--- a/test/README.md
+++ b/test/README.md
@@ -373,7 +373,7 @@ Synchronous version of `spawnPwd`.
### tmpDir
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
-Path to the 'tmp' directory.
+The realpath of the 'tmp' directory.
### tmpDirName
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
diff --git a/test/common.js b/test/common.js
index 699fa5991d..f111a2939b 100644
--- a/test/common.js
+++ b/test/common.js
@@ -12,7 +12,7 @@ const Timer = process.binding('timer_wrap').Timer;
const execSync = require('child_process').execSync;
const testRoot = process.env.NODE_TEST_DIR ?
- path.resolve(process.env.NODE_TEST_DIR) : __dirname;
+ fs.realpathSync(process.env.NODE_TEST_DIR) : __dirname;
exports.fixturesDir = path.join(__dirname, 'fixtures');
exports.tmpDirName = 'tmp';