2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 00:12:11 +00:00

Don't remove python scripts for Python tests.

[SVN r36073]
This commit is contained in:
Vladimir Prus
2006-11-18 08:56:43 +00:00
parent f2e4ab9ae9
commit be5b9377d6
2 changed files with 24 additions and 5 deletions

View File

@@ -613,7 +613,10 @@ rule capture-output ( target : sources * : properties * )
# over explicitly.
RUN_PATH on $(sources[1]) = [ on $(sources[2]) return $(RUN_PATH) ] ;
PYTHONPATH = [ on $(sources[2]) return $(LOCATE) ] ;
testing.capture-output $(target) : $(sources[1]) : $(properties) ;
# After test is run, we remove the Python module, but not the Python
# script.
testing.capture-output $(target) : $(sources[1]) : $(properties)
: $(sources[2]) ;
local c = [ common.prepend-path-variable-command PYTHONPATH : $(PYTHONPATH) ] ;
LAUNCHER on $(target) = $(c) [ on $(target) return $(PYTHON) ] ;
}

View File

@@ -342,7 +342,14 @@ if --preserve-test-targets in $(argv)
toolset.flags testing.capture-output ARGS <testing.arg> ;
toolset.flags testing.capture-output INPUT_FILES <testing.input-file> ;
toolset.flags testing.capture-output LAUNCHER <testing.launcher> ;
rule capture-output ( target : source : properties * )
# Runs executable 'sources' and stores stdout in file 'target'.
# If --preserve-test-targets command line option, removes the executable.
# The 'target-to-remove' parameter controls what should be removed:
# - if 'none', does not remove anything, ever
# - if empty, removes 'source'
# - if non-empty and not 'none', contains a list of sources to remove.
rule capture-output ( target : source : properties * : targets-to-remove ? )
{
output-file on $(target) = $(target:S=.output) ;
LOCATE on $(target:S=.output) = [ on $(target) return $(LOCATE) ] ;
@@ -358,13 +365,22 @@ 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) ] ;
if $(targets-to-remove) = none
{
targets-to-remove = ;
}
else if ! $(targets-to-remove)
{
targets-to-remove = $(source) ;
}
run-path-setup $(target) : $(source) : $(properties) ;
if ! $(preserve-test-targets)
{
TEMPORARY $(source) ;
RmTemps $(target) : $(source) ;
TEMPORARY $(targets-to-remove) ;
RmTemps $(target) : $(targets-to-remove) ;
}
}