Skip to content

Commit 283ff98

Browse files
committed
build: run embedtest with node_g when BUILDTYPE=Debug
1 parent bfc729c commit 283ff98

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

Makefile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ EXEEXT := $(shell $(PYTHON) -c \
7878
"import sys; print('.exe' if sys.platform == 'win32' else '')")
7979

8080
NODE_EXE = node$(EXEEXT)
81-
# Use $(PWD) so we can cd to anywhere before calling this
82-
NODE ?= "$(PWD)/$(NODE_EXE)"
8381
NODE_G_EXE = node_g$(EXEEXT)
8482
NPM ?= ./deps/npm/bin/npm-cli.js
8583

84+
# Release build of node.
85+
# Use $(PWD) so we can cd to anywhere before calling this.
86+
NODE ?= "$(PWD)/$(NODE_EXE)"
87+
# Prefer $(OUT_NODE) when running tests. Use $(NODE)
88+
# when generating coverage reports or running toolings as
89+
# debug build is be slower.
90+
OUT_NODE ?= "$(PWD)/out/$(BUILDTYPE)/node$(EXEEXT)"
91+
8692
# Flags for packaging.
8793
BUILD_DOWNLOAD_FLAGS ?= --download=all
8894
BUILD_INTL_FLAGS ?= --with-intl=full-icu
@@ -108,8 +114,10 @@ available-node = \
108114
# just the debug build, run `make -C out BUILDTYPE=Debug` instead.
109115
ifeq ($(BUILDTYPE),Release)
110116
all: $(NODE_EXE) ## Build node in out/Release/node (Default).
117+
$(OUT_NODE): $(NODE_EXE)
111118
else
112119
all: $(NODE_EXE) $(NODE_G_EXE)
120+
$(OUT_NODE): $(NODE_G_EXE)
113121
endif
114122

115123
.PHONY: help
@@ -293,7 +301,7 @@ coverage-report-js: ## Report JavaScript coverage results.
293301

294302
cctest: all ## Run the C++ tests using the built `cctest` executable.
295303
@out/$(BUILDTYPE)/$@ --gtest_filter=$(GTEST_FILTER)
296-
$(NODE) ./test/embedding/test-embedding.js
304+
$(OUT_NODE) ./test/embedding/test-embedding.js
297305

298306
.PHONY: list-gtests
299307
list-gtests: ## List all available C++ gtests.
@@ -605,7 +613,7 @@ test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tes
605613
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
606614
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
607615
$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) $(CI_DOC)
608-
$(NODE) ./test/embedding/test-embedding.js
616+
$(OUT_NODE) ./test/embedding/test-embedding.js
609617
$(info Clean up any leftover processes, error if found.)
610618
ps awwx | grep Release/node | grep -v grep | cat
611619
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -651,7 +659,7 @@ test-wpt: all ## Run the Web Platform Tests.
651659
test-wpt-report: ## Run the Web Platform Tests and generate a report.
652660
$(RM) -r out/wpt
653661
mkdir -p out/wpt
654-
-WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(NODE) $(PARALLEL_ARGS) wpt
662+
-WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(OUT_NODE) $(PARALLEL_ARGS) wpt
655663
$(NODE) "$$PWD/tools/merge-wpt-reports.mjs"
656664

657665
.PHONY: test-internet
@@ -680,12 +688,12 @@ test-known-issues: all ## Run tests for known issues.
680688

681689
# Related CI job: node-test-npm
682690
.PHONY: test-npm
683-
test-npm: $(NODE_EXE) ## Run the npm test suite on deps/npm.
684-
$(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test
691+
test-npm: $(OUT_NODE) ## Run the npm test suite on deps/npm.
692+
$(OUT_NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test
685693

686694
.PHONY: test-npm-publish
687-
test-npm-publish: $(NODE_EXE) ## Test the `npm publish` command.
688-
npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js
695+
test-npm-publish: $(OUT_NODE) ## Test the `npm publish` command.
696+
npm_package_config_publishtest=true $(OUT_NODE) deps/npm/test/run.js
689697

690698
.PHONY: test-js-native-api
691699
test-js-native-api: test-build-js-native-api ## Run JS Native-API tests.

0 commit comments

Comments
 (0)