File tree Expand file tree Collapse file tree 2 files changed +38
-13
lines changed Expand file tree Collapse file tree 2 files changed +38
-13
lines changed Original file line number Diff line number Diff line change @@ -138,19 +138,7 @@ test-debugger: all
138138 $(PYTHON ) tools/test.py debugger
139139
140140test-npm : $(NODE_EXE )
141- rm -rf npm-cache npm-tmp npm-prefix
142- mkdir npm-cache npm-tmp npm-prefix
143- cd deps/npm ; npm_config_cache=" $( shell pwd) /npm-cache" \
144- npm_config_prefix=" $( shell pwd) /npm-prefix" \
145- npm_config_tmp=" $( shell pwd) /npm-tmp" \
146- ../../$(NODE_EXE ) cli.js install --ignore-scripts
147- cd deps/npm ; npm_config_cache=" $( shell pwd) /npm-cache" \
148- npm_config_prefix=" $( shell pwd) /npm-prefix" \
149- npm_config_tmp=" $( shell pwd) /npm-tmp" \
150- ../../$(NODE_EXE ) cli.js run-script test-all && \
151- ../../$(NODE_EXE ) cli.js prune --prod && \
152- cd ../.. && \
153- rm -rf npm-cache npm-tmp npm-prefix
141+ NODE_EXE=$(NODE_EXE ) tools/test-npm.sh
154142
155143test-npm-publish : $(NODE_EXE )
156144 npm_package_config_publishtest=true ./$(NODE_EXE ) deps/npm/test/run.js
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ # always change the working directory to the project's root directory
6+ cd $( dirname $0 ) /..
7+
8+ # pass NODE_EXE from something like Makefile
9+ # it should point to either ./node or ./node.exe, depending on the platform
10+ if [ -z $NODE_EXE ]; then
11+ echo " No node executable provided. Bailing." >&2
12+ exit 0
13+ fi
14+
15+ rm -rf test-npm
16+ mkdir test-npm
17+
18+ # make a copy of deps/npm to run the tests on
19+ cp -r deps/npm/ test-npm/
20+
21+ cd test-npm
22+
23+ # do a rm first just in case deps/npm contained these
24+ rm -rf npm-cache npm-tmp npm-prefix
25+ mkdir npm-cache npm-tmp npm-prefix
26+
27+ # set some npm env varibles to point to our new temporary folders
28+ export npm_config_cache=" npm-cache"
29+ export npm_config_prefix=" npm-prefix"
30+ export npm_config_tmp=" npm-tmp"
31+
32+ # install npm devDependencies and run npm's tests
33+ ../$NODE_EXE cli.js install --ignore-scripts
34+ ../$NODE_EXE cli.js run-script test-all
35+
36+ # clean up everything one single shot
37+ cd .. && rm -rf test-npm
You can’t perform that action at this time.
0 commit comments