Skip to content

Commit

Permalink
tools: use local or specified $NODE for test-npm
Browse files Browse the repository at this point in the history
PR-URL: #1984
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
Fishrock123 committed Jul 25, 2015
1 parent afd7e37 commit 68b06e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -139,7 +139,7 @@ test-debugger: all
$(PYTHON) tools/test.py debugger

test-npm: $(NODE_EXE)
NODE_EXE=$(NODE_EXE) tools/test-npm.sh
NODE=$(NODE) tools/test-npm.sh

test-npm-publish: $(NODE_EXE)
npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js
Expand Down
13 changes: 7 additions & 6 deletions tools/test-npm.sh
Expand Up @@ -5,9 +5,9 @@ set -e
# always change the working directory to the project's root directory
cd $(dirname $0)/..

# pass NODE_EXE from something like Makefile
# it should point to either {./}node or {./}node.exe, depending on the platform
if [ -z $NODE_EXE ]; then
# pass a $NODE environment variable from something like Makefile
# it should point to either ./iojs or ./iojs.exe, depending on the platform
if [ -z $NODE ]; then
echo "No node executable provided. Bailing." >&2
exit 0
fi
Expand All @@ -29,9 +29,10 @@ export npm_config_prefix="npm-prefix"
export npm_config_tmp="npm-tmp"

# install npm devDependencies and run npm's tests
../$NODE_EXE cli.js install --ignore-scripts
../$NODE_EXE cli.js run-script test-legacy
../$NODE_EXE cli.js run-script test

../$NODE cli.js install --ignore-scripts
../$NODE cli.js run-script test-legacy
../$NODE cli.js run-script test

# clean up everything one single shot
cd .. && rm -rf test-npm

0 comments on commit 68b06e9

Please sign in to comment.