From e51f924964b3bdae7575d28ad5d1829a88f881b6 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 12 Aug 2019 12:14:43 +0200 Subject: [PATCH] build: add a testclean target This commit adds a target named testclean to allow for cleaning the temporary files generated during a test run without having to use the clean target. PR-URL: https://github.com/nodejs/node/pull/29094 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Rich Trott --- Makefile | 10 +++++++--- vcbuild.bat | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b18facf08eba85..d6c731c36dcc2d 100644 --- a/Makefile +++ b/Makefile @@ -170,12 +170,16 @@ clean: ## Remove build artifacts. $(RM) -r node_modules @if [ -d deps/icu ]; then echo deleting deps/icu; $(RM) -r deps/icu; fi $(RM) test.tap - # Next one is legacy remove this at some point - $(RM) -r test/tmp* - $(RM) -r test/.tmp* + $(MAKE) testclean $(MAKE) test-addons-clean $(MAKE) bench-addons-clean +.PHONY: testclean +testclean: +# Next one is legacy remove this at some point + $(RM) -r test/tmp* + $(RM) -r test/.tmp* + .PHONY: distclean distclean: $(RM) -r out diff --git a/vcbuild.bat b/vcbuild.bat index 9c3151be886df0..6897e0a6f8df13 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -69,6 +69,7 @@ if "%1"=="" goto args-done if /i "%1"=="debug" set config=Debug&goto arg-ok if /i "%1"=="release" set config=Release&set ltcg=1&set cctest=1&goto arg-ok if /i "%1"=="clean" set target=Clean&goto arg-ok +if /i "%1"=="testclean" set target=TestClean&goto arg-ok if /i "%1"=="ia32" set target_arch=x86&goto arg-ok if /i "%1"=="x86" set target_arch=x86&goto arg-ok if /i "%1"=="x64" set target_arch=x64&goto arg-ok @@ -200,6 +201,13 @@ if "%target%"=="Clean" echo deleting %~dp0deps\icu if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu :no-depsicu +if "%target%"=="TestClean" ( + echo deleting test/.tmp* + if exist "test\.tmp*" for /f %%i in ('dir /a:d /s /b test\.tmp*') do rmdir /S /Q "%%i" + goto exit +) + + call tools\msvs\find_python.cmd if errorlevel 1 goto :exit