From 6ec2bd2e5c71e594fab6fb1bb64a99d1b7968754 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 24 Nov 2003 15:21:23 +0000 Subject: [PATCH] Fixes for --dump-tests with Python testing. [SVN r20938] --- v1/python.jam | 16 +++++++++++++++- v1/testing.jam | 10 +++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/v1/python.jam b/v1/python.jam index bcf9c5fd9..13424fce9 100644 --- a/v1/python.jam +++ b/v1/python.jam @@ -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 * ) diff --git a/v1/testing.jam b/v1/testing.jam index c0b24ba82..03f6fcd10 100755 --- a/v1/testing.jam +++ b/v1/testing.jam @@ -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