@@ -66,13 +66,17 @@ endif
66
66
# to check for changes.
67
67
.PHONY : $(NODE_EXE ) $(NODE_G_EXE )
68
68
69
+ # The -r/-L check stops it recreating the link if it is already in place,
70
+ # otherwise $(NODE_EXE) being a .PHONY target means it is always re-run.
71
+ # Without the check there is a race condition between the link being deleted
72
+ # and recreated which can break the addons build when running test-ci
69
73
$(NODE_EXE ) : config.gypi out/Makefile
70
74
$(MAKE ) -C out BUILDTYPE=Release V=$(V )
71
- ln -fs out/Release/$(NODE_EXE ) $@
75
+ if [ ! -r $@ -o ! -L $@ ] ; then ln -fs out/Release/$( NODE_EXE) $@ ; fi
72
76
73
77
$(NODE_G_EXE ) : config.gypi out/Makefile
74
78
$(MAKE ) -C out BUILDTYPE=Debug V=$(V )
75
- ln -fs out/Debug/$(NODE_EXE ) $@
79
+ if [ ! -r $@ -o ! -L $@ ] ; then ln -fs out/Debug/$( NODE_EXE) $@ ; fi
76
80
77
81
out/Makefile : common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
78
82
deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \
186
190
tools/make-v8.sh
187
191
$(MAKE ) -C deps/v8 $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
188
192
189
- test : build-addons
193
+ test : all
194
+ $(MAKE ) build-addons
190
195
$(MAKE ) cctest
191
196
$(PYTHON ) tools/test.py --mode=release -J \
192
197
doctool inspector known_issues message pseudo-tty parallel sequential $(CI_NATIVE_SUITES )
@@ -198,6 +203,10 @@ test-parallel: all
198
203
test-valgrind : all
199
204
$(PYTHON ) tools/test.py --mode=release --valgrind sequential parallel message
200
205
206
+ # Builds test/addons, test/addons-napi and test/gc.
207
+ build-addons : $(NODE_EXE )
208
+ ./$< tools/build-addons.js
209
+
201
210
clear-stalled :
202
211
# Clean up any leftover processes but don't error if found.
203
212
ps awwx | grep Release/node | grep -v grep | cat
@@ -206,25 +215,26 @@ clear-stalled:
206
215
echo $$ {PS_OUT} | xargs kill ; \
207
216
fi
208
217
209
- test-gc : build-addons
218
+ test-gc : test-build
210
219
$(PYTHON ) tools/test.py --mode=release gc
211
220
212
- # Builds test/addons, test/addons-napi and test/gc.
213
- build-addons : $(NODE_EXE )
214
- ./$< tools/build-addons.js
221
+ test-gc-clean :
222
+ $(RM ) -r test/gc/build
223
+
224
+ test-build : | all build-addons
215
225
216
- test-all : build-addons
226
+ test-all : test-build
217
227
$(PYTHON ) tools/test.py --mode=debug,release
218
228
219
- test-all-valgrind : build-addons
229
+ test-all-valgrind : test-build
220
230
$(PYTHON ) tools/test.py --mode=debug,release --valgrind
221
231
222
232
CI_NATIVE_SUITES := addons addons-napi
223
233
CI_JS_SUITES := doctool inspector known_issues message parallel pseudo-tty sequential
224
234
225
235
# Build and test addons without building anything else
226
236
test-ci-native : LOGLEVEL := info
227
- test-ci-native : build-addons
237
+ test-ci-native : | build-addons
228
238
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
229
239
--mode=release --flaky-tests=$(FLAKY_TESTS ) \
230
240
$(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -254,13 +264,13 @@ test-ci: | clear-stalled build-addons
254
264
echo $$ {PS_OUT} | xargs kill ; exit 1; \
255
265
fi
256
266
257
- test-release : build-addons
267
+ test-release : test-build
258
268
$(PYTHON ) tools/test.py --mode=release
259
269
260
- test-debug : build-addons
270
+ test-debug : test-build
261
271
$(PYTHON ) tools/test.py --mode=debug
262
272
263
- test-message : build-addons
273
+ test-message : test-build
264
274
$(PYTHON ) tools/test.py message
265
275
266
276
test-simple : | cctest # Depends on 'all'.
@@ -294,10 +304,10 @@ test-npm: $(NODE_EXE)
294
304
test-npm-publish : $(NODE_EXE )
295
305
npm_package_config_publishtest=true $(NODE ) deps/npm/test/run.js
296
306
297
- test-addons : build-addons
307
+ test-addons : test-build
298
308
$(PYTHON ) tools/test.py --mode=release addons
299
309
300
- test-addons-napi : build-addons
310
+ test-addons-napi : test-build
301
311
$(PYTHON ) tools/test.py --mode=release addons-napi
302
312
303
313
test-addons-clean :
@@ -871,6 +881,7 @@ endif
871
881
test-ci-js \
872
882
test-ci-native \
873
883
test-gc \
884
+ test-gc-clean \
874
885
test-v8 \
875
886
test-v8-all \
876
887
test-v8-benchmarks \
0 commit comments