From a66b77c50a1012fdd368d0f89a8522760a0f639b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 9 Oct 2015 16:19:11 +0200 Subject: [PATCH 1/3] test: pass --mode=$(BUILDTYPE) to test runner --- Makefile | 19 +++++++++++-------- tools/test.py | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 02619fac98ddd7..3395da3dedd8e2 100644 --- a/Makefile +++ b/Makefile @@ -88,15 +88,17 @@ cctest: all @out/$(BUILDTYPE)/$@ test: | cctest # Depends on 'all'. - $(PYTHON) tools/test.py --mode=release message parallel sequential -J + $(PYTHON) tools/test.py --mode=$(BUILDTYPE) -J \ + message parallel sequential $(MAKE) jslint $(MAKE) cpplint test-parallel: all - $(PYTHON) tools/test.py --mode=release parallel -J + $(PYTHON) tools/test.py --mode=$(BUILDTYPE) -J parallel test-valgrind: all - $(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message + $(PYTHON) tools/test.py --mode=$(BUILDTYPE) --valgrind \ + sequential parallel message test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE) $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ @@ -133,7 +135,7 @@ test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) | test/addons/.docbuildstamp build-addons: $(NODE_EXE) test/addons/.buildstamp test-gc: all test/gc/node_modules/weak/build/Release/weakref.node - $(PYTHON) tools/test.py --mode=release gc + $(PYTHON) tools/test.py --mode=$(BUILDTYPE) gc test-build: | all build-addons @@ -144,8 +146,9 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind test-ci: | build-addons - $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \ - $(TEST_CI_ARGS) addons message parallel sequential + $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=$(BUILDTYPE) \ + --flaky-tests=$(FLAKY_TESTS) $(TEST_CI_ARGS) \ + addons message parallel sequential test-release: test-build $(PYTHON) tools/test.py --mode=release @@ -175,11 +178,11 @@ test-npm-publish: $(NODE_EXE) npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js test-addons: test-build - $(PYTHON) tools/test.py --mode=release addons + $(PYTHON) tools/test.py --mode=$(BUILDTYPE) addons test-timers: $(MAKE) --directory=tools faketime - $(PYTHON) tools/test.py --mode=release timers + $(PYTHON) tools/test.py --mode=$(BUILDTYPE) timers test-timers-clean: $(MAKE) --directory=tools clean diff --git a/tools/test.py b/tools/test.py index 26b70233d53f85..b7723aac9e461e 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1304,7 +1304,7 @@ def ProcessOptions(options): global VERBOSE VERBOSE = options.verbose options.arch = options.arch.split(',') - options.mode = options.mode.split(',') + options.mode = options.mode.lower().split(',') # 'Release' => 'release'. options.run = options.run.split(',') if options.run == [""]: options.run = None From 14e9d61e71e5f558075b123ff290aaac0e55044b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 9 Oct 2015 16:19:18 +0200 Subject: [PATCH 2/3] build: skip release build when BUILDTYPE=Debug --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3395da3dedd8e2..b7773cc6bb0bde 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ V ?= 1 ifeq ($(BUILDTYPE),Release) all: out/Makefile $(NODE_EXE) else -all: out/Makefile $(NODE_EXE) $(NODE_G_EXE) +all: out/Makefile $(NODE_G_EXE) endif # The .PHONY is needed to ensure that we recursively use the out/Makefile From 890b79e4ea8ea765a4deb4477afd56f1ef39c5a5 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 9 Oct 2015 16:36:02 +0200 Subject: [PATCH 3/3] fixup! set NODE=node_g when BUILDTYPE=Debug --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b7773cc6bb0bde..7656b7e797b33c 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,15 @@ OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]') EXEEXT := $(shell $(PYTHON) -c \ "import sys; print('.exe' if sys.platform == 'win32' else '')") -NODE ?= ./node$(EXEEXT) NODE_EXE = node$(EXEEXT) NODE_G_EXE = node_g$(EXEEXT) +ifeq ($(BUILDTYPE),Release) +NODE ?= ./$(NODE_EXE) +else +NODE ?= ./$(NODE_G_EXE) +endif + # Flags for packaging. BUILD_DOWNLOAD_FLAGS ?= --download=all BUILD_INTL_FLAGS ?= --with-intl=small-icu