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

Fixes for --dump-tests with Python testing.

[SVN r20938]
This commit is contained in:
Dave Abrahams
2003-11-24 15:21:23 +00:00
parent ade30d30d0
commit 6ec2bd2e5c
2 changed files with 22 additions and 4 deletions

View File

@@ -404,7 +404,21 @@ rule boost-python-runtest (
# The user can add additional arguments in PYTHON_TEST_ARGS.
local gPYTHON_TEST_ARGS = $(args) $(PYTHON_TEST_ARGS) ;
return [ boost-test $(sources) : RUN_PYD : $(requirements) : $(target) : $(local-build) ] ;
#
# Stick the names of the python script and source files used in
# testing into $(source-files) on the main target. This is kind
# of a hack, because boost-test will be returning the name of the
# main target, but unfortunatedly dump-tests runs during the
# evaluation of boost-test and not during the build phase :(
#
local main-target = [ FGristFiles [ expand-target-names $(target) : RUN_PYD ] ] ;
source-files on $(main-target) = $(gRUN_TEST_INPUT_FILES) ;
local dependencies = [ FGristFiles [ expand-source-names $(sources) ] ] ;
source-files on $(main-target) += $(gTARGET_SOURCES($(dependencies))) ;
local result = [ boost-test $(sources) : RUN_PYD : $(requirements) : $(target) : $(local-build) ] ;
}
rule boost-python-test ( name : sources + : requirements * : default-BUILD * )

View File

@@ -50,7 +50,7 @@ rule boost-test ( sources + : target-type : requirements * : test-name ? : defau
if ( --dump-tests in $(ARGV) )
{
dump-test ;
dump-test $(result) : $(requirements) ;
}
}
@@ -75,9 +75,13 @@ rule boost-test ( sources + : target-type : requirements * : test-name ? : defau
# Helper for boost-test above. Uses dynamic scoping to access
# boost-test's locals.
local rule dump-test ( )
local rule dump-test ( target : requirements * )
{
local srcs = [ on $(result) get-var-value source-files ] ;
local srcs = [ on $(target) get-var-value source-files ] ;
# Pick any source file names off the associated main target as well.
srcs += [ on $(gTARGET_SUBVARIANT($(target))) get-var-value source-files ] ;
local pwd = [ PWD ] ;
# locate each source file