Skip to content

Commit 1442c1c

Browse files
committed
addons: build and test examples
fix nodejs#6910
1 parent 2a0b619 commit 1442c1c

10 files changed

Lines changed: 277 additions & 117 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ ipch/
4242
/dist-osx
4343
/npm.wxs
4444
/tools/msvs/npm.wixobj
45+
/test/addons/doc-*/
4546
email.md
4647
deps/v8-*
4748
./node_modules

Makefile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,38 @@ test/gc/node_modules/weak/build/Release/weakref.node:
100100
--directory="$(shell pwd)/test/gc/node_modules/weak" \
101101
--nodedir="$(shell pwd)"
102102

103+
build-addons:
104+
@if [ ! -f node ]; then make all; fi
105+
rm -rf test/addons/doc-*/
106+
./node tools/doc/addon-verify.js
107+
$(foreach dir, \
108+
$(sort $(dir $(wildcard test/addons/*/*.gyp))), \
109+
./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
110+
--directory="$(shell pwd)/$(dir)" \
111+
--nodedir="$(shell pwd)" && ) echo "build done"
112+
103113
test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
104114
$(PYTHON) tools/test.py --mode=release gc
105115

106-
test-all: all test/gc/node_modules/weak/build/Release/weakref.node
116+
test-build: all build-addons
117+
118+
test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node
107119
$(PYTHON) tools/test.py --mode=debug,release
108120
make test-npm
109121

110-
test-all-http1: all
122+
test-all-http1: test-build
111123
$(PYTHON) tools/test.py --mode=debug,release --use-http1
112124

113-
test-all-valgrind: all
125+
test-all-valgrind: test-build
114126
$(PYTHON) tools/test.py --mode=debug,release --valgrind
115127

116-
test-release: all
128+
test-release: test-build
117129
$(PYTHON) tools/test.py --mode=release
118130

119-
test-debug: all
131+
test-debug: test-build
120132
$(PYTHON) tools/test.py --mode=debug
121133

122-
test-message: all
134+
test-message: test-build
123135
$(PYTHON) tools/test.py message
124136

125137
test-simple: all
@@ -140,6 +152,9 @@ test-npm: node
140152
test-npm-publish: node
141153
npm_package_config_publishtest=true ./node deps/npm/test/run.js
142154

155+
test-addons: test-build
156+
$(PYTHON) tools/test.py --mode=release addons
157+
143158
apidoc_sources = $(wildcard doc/api/*.markdown)
144159
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
145160
$(addprefix out/,$(apidoc_sources:.markdown=.json))
@@ -418,4 +433,4 @@ cpplint:
418433

419434
lint: jslint cpplint
420435

421-
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary release-only bench-http-simple bench-idle bench-all bench bench-misc bench-array bench-buffer bench-net bench-http bench-fs bench-tls
436+
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all test-addons build-addons website-upload pkg blog blogclean tar binary release-only bench-http-simple bench-idle bench-all bench bench-misc bench-array bench-buffer bench-net bench-http bench-fs bench-tls

0 commit comments

Comments
 (0)