From c8f6d39cae23d548a8aec2fa6ffd0f9f024fc6d1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 15 Nov 2006 19:05:45 +0000 Subject: [PATCH] Implement automatic removal of test executables [SVN r36048] --- src/tools/testing.jam | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/tools/testing.jam b/src/tools/testing.jam index e195c93d2..1416bcf55 100644 --- a/src/tools/testing.jam +++ b/src/tools/testing.jam @@ -333,6 +333,11 @@ rule run-path-setup ( target : source : properties * ) } } +local argv = [ modules.peek : ARGV ] ; +if --preserve-test-targets in $(argv) +{ + preserve-test-targets = true ; +} toolset.flags testing.capture-output ARGS ; toolset.flags testing.capture-output INPUT_FILES ; @@ -353,8 +358,14 @@ rule capture-output ( target : source : properties * ) # before target is created. Therefore, they are bound using SEARCH setting # on them and not LOCATE setting of $(target), as in other case (due to jam bug). DEPENDS $(target) : [ on $(target) return $(INPUT_FILES) ] ; - + run-path-setup $(target) : $(source) : $(properties) ; + + if ! $(preserve-test-targets) + { + TEMPORARY $(sources) ; + RmTemps $(target) : $(source) ; + } } @@ -396,6 +407,9 @@ else VERBOSE_TEST = 0 ; } + +RM = [ common.rm-command ] ; + actions capture-output bind INPUT_FILES output-file { $(PATH_SETUP) @@ -414,10 +428,15 @@ actions capture-output bind INPUT_FILES output-file echo ====== BEGIN OUTPUT ====== $(CATENATE) $(output-file) echo ====== END OUTPUT ====== - $(ENDIF) + $(ENDIF) exit $(STATUS) } +actions quietly updated piecemeal together RmTemps +{ + $(RM) "$(>)" +} + MAKE_FILE = [ common.file-creation-command ] ; toolset.flags testing.unit-test LAUNCHER ;