Skip to content

Commit e51f924

Browse files
danbevtargos
authored andcommitted
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: #29094 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent e2a2a3f commit e51f924

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,16 @@ clean: ## Remove build artifacts.
170170
$(RM) -r node_modules
171171
@if [ -d deps/icu ]; then echo deleting deps/icu; $(RM) -r deps/icu; fi
172172
$(RM) test.tap
173-
# Next one is legacy remove this at some point
174-
$(RM) -r test/tmp*
175-
$(RM) -r test/.tmp*
173+
$(MAKE) testclean
176174
$(MAKE) test-addons-clean
177175
$(MAKE) bench-addons-clean
178176

177+
.PHONY: testclean
178+
testclean:
179+
# Next one is legacy remove this at some point
180+
$(RM) -r test/tmp*
181+
$(RM) -r test/.tmp*
182+
179183
.PHONY: distclean
180184
distclean:
181185
$(RM) -r out

vcbuild.bat

+8
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ if "%1"=="" goto args-done
6969
if /i "%1"=="debug" set config=Debug&goto arg-ok
7070
if /i "%1"=="release" set config=Release&set ltcg=1&set cctest=1&goto arg-ok
7171
if /i "%1"=="clean" set target=Clean&goto arg-ok
72+
if /i "%1"=="testclean" set target=TestClean&goto arg-ok
7273
if /i "%1"=="ia32" set target_arch=x86&goto arg-ok
7374
if /i "%1"=="x86" set target_arch=x86&goto arg-ok
7475
if /i "%1"=="x64" set target_arch=x64&goto arg-ok
@@ -200,6 +201,13 @@ if "%target%"=="Clean" echo deleting %~dp0deps\icu
200201
if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu
201202
:no-depsicu
202203

204+
if "%target%"=="TestClean" (
205+
echo deleting test/.tmp*
206+
if exist "test\.tmp*" for /f %%i in ('dir /a:d /s /b test\.tmp*') do rmdir /S /Q "%%i"
207+
goto exit
208+
)
209+
210+
203211
call tools\msvs\find_python.cmd
204212
if errorlevel 1 goto :exit
205213

0 commit comments

Comments
 (0)