Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
Jan Krems committed Dec 11, 2016
commit 46ab980488c4813b31f5ec1c75667d5d48998ee1
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ test-debugger: all
test-inspector: all
$(PYTHON) tools/test.py inspector

test-node-inspect: $(NODE_EXE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, there's be a similar job for Windows in vcbuild.bat.

Copy link
Contributor Author

@hybrist hybrist Dec 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, didn't have a Windows machine set up to look into vcbuild.bat, that's why I only copied tools/test-npm.sh in the first push. Should be able to work on the Windows part next week.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows part is done.

NODE=$(NODE) tools/test-node-inspect.sh

test-tick-processor: all
$(PYTHON) tools/test.py tick-processor

Expand Down
37 changes: 37 additions & 0 deletions tools/test-node-inspect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -e

# always change the working directory to the project's root directory
cd $(dirname $0)/..

# pass a $NODE environment variable from something like Makefile
# it should point to either ./node or ./node.exe, depending on the platform
if [ -z $NODE ]; then
echo "No node executable provided. Bailing." >&2
exit 0
fi

rm -rf test-node-inspect

# make a copy of deps/node-inspect to run the tests on
cp -r deps/node-inspect test-node-inspect

cd test-node-inspect

# make sure our test does not leak into the general file system
mkdir npm-cache npm-tmp npm-prefix
export npm_config_cache="$(pwd)/npm-cache"
export npm_config_prefix="$(pwd)/npm-prefix"
export npm_config_tmp="$(pwd)/npm-tmp"

# ensure npm always uses the local node
export PATH="$(../$NODE -p 'require("path").resolve("..")'):$PATH"
unset NODE

node ../deps/npm/cli.js install

node ./node_modules/.bin/tap 'test/**/*.test.js'

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