Skip to content

Commit 46ab980

Browse files
author
Jan Krems
committed
build: Add node-inspect integration test for unix
This just adds an additional make target (`make test-node-inspect`) but will not include the new debugger in releases.
1 parent e85aaf8 commit 46ab980

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ test-debugger: all
241241
test-inspector: all
242242
$(PYTHON) tools/test.py inspector
243243

244+
test-node-inspect: $(NODE_EXE)
245+
NODE=$(NODE) tools/test-node-inspect.sh
246+
244247
test-tick-processor: all
245248
$(PYTHON) tools/test.py tick-processor
246249

tools/test-node-inspect.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 a $NODE environment variable from something like Makefile
9+
# it should point to either ./node or ./node.exe, depending on the platform
10+
if [ -z $NODE ]; then
11+
echo "No node executable provided. Bailing." >&2
12+
exit 0
13+
fi
14+
15+
rm -rf test-node-inspect
16+
17+
# make a copy of deps/node-inspect to run the tests on
18+
cp -r deps/node-inspect test-node-inspect
19+
20+
cd test-node-inspect
21+
22+
# make sure our test does not leak into the general file system
23+
mkdir npm-cache npm-tmp npm-prefix
24+
export npm_config_cache="$(pwd)/npm-cache"
25+
export npm_config_prefix="$(pwd)/npm-prefix"
26+
export npm_config_tmp="$(pwd)/npm-tmp"
27+
28+
# ensure npm always uses the local node
29+
export PATH="$(../$NODE -p 'require("path").resolve("..")'):$PATH"
30+
unset NODE
31+
32+
node ../deps/npm/cli.js install
33+
34+
node ./node_modules/.bin/tap 'test/**/*.test.js'
35+
36+
# clean up everything one single shot
37+
cd .. && rm -rf test-node-inspect

0 commit comments

Comments
 (0)