From 95d7a69fa90545dea16595554cb583c59b5c228f Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 6 Oct 2001 18:19:15 +0000 Subject: [PATCH] regex, threads, and python will all build from the top level. If you build the 'test' target from the top level, it will run all regressions. Jamfile: subincludes for thread, python libs, and status for regression tests Jamrules: Use the new path-global rule to establish BOOST_ROOT correctly for all subprojects libs/regex/build/Jamfile Take advantage of correct BOOST_ROOT setting libs/python/build/Jamfile Search for python executable; don't try to build anything if it can't be found. don't build tests by default improved comments, organization, and naming. status/Jamfile Fixed references to config test files Failed tests now leave their stdout results in .error instead of removing it No test targets are dependencies of 'all' anymore Added comments Reorganized tools/build/Jambase Meant to check this in long ago. tools/build/allyourbase.jam Fixed SHELL_EXPORT setting, added SHELL_SET removed 'test' from the dependencies of 'all'; tests no longer run by default. Fixed the direction of slashes for Windows when ALL_LOCATE_TARGET is used. Added path-global rule for declaring path variables which may be relative rule in-invocation-subdir returns true if the current subproject is the one from which Jam was invoked rule protect-subdir is now used to protect subproject variables rule tokens-to-simple-path converts path tokens to a simplified path. tools/build/boost-base.jam Fixed bugs tools/build/jam_src/makedebugjam.bat Fixed a bug which prevented a final debug build tools/build/jam_src/search.c Fixed a bug of mine which caused LOCATE to be ignored (!). [SVN r11348] --- libs/python | 2 +- libs/regex | 2 +- status/Jamfile | 121 ++++++++++++++++++++++++++++++++++++------------- tools/build | 2 +- 4 files changed, 93 insertions(+), 34 deletions(-) diff --git a/libs/python b/libs/python index e552607c95..e63451a9e7 160000 --- a/libs/python +++ b/libs/python @@ -1 +1 @@ -Subproject commit e552607c95cf513a8f3e1f3c1ce123c909356fd1 +Subproject commit e63451a9e7a545b7cac02e5756bd46e717251f0d diff --git a/libs/regex b/libs/regex index fe45d5bf4a..a543dce5e3 160000 --- a/libs/regex +++ b/libs/regex @@ -1 +1 @@ -Subproject commit fe45d5bf4a8a39e92a3fca383f62972b54ceeb81 +Subproject commit a543dce5e36514f533eb6134b3487dac650ecdaf diff --git a/status/Jamfile b/status/Jamfile index 1c506d3195..256b9afba3 100644 --- a/status/Jamfile +++ b/status/Jamfile @@ -1,18 +1,32 @@ +# Boost regression-testing Jamfile +# (C) Copyright David Abrahams 2001. Permission to copy, use, modify, sell and +# distribute this software is granted provided this copyright notice appears in +# all copies. This software is provided "as is" without express or implied +# warranty, and with no claim as to its suitability for any purpose. + subproject status ; -gGENERATOR_FUNCTION(OBJ) = Object ; +# ----------- Jam rules for testing; test invocations at bottom ----------------# -rule boost-test # sources : type : suppress-fake-targets : requirements +# boost-test sources : type : requirements [ : name ] +# +# Declares a test target. If name is not supplied, it is taken from the name of +# the first source file, sans extension and directory path. +# +# type should be a target type (e.g. OBJ, DLL, LIB, EXE) +rule boost-test { local result ; { - local requirements = $(4) ; - local suppress = $(3) ; - suppress ?= dummy ; - local $(suppress) = true ; + local requirements = $(3) ; + local name = $(4) ; + name ?= $(<[1]:D=:S=) ; + + # Make sure that targets don't become part of "all" + local gSUPPRESS_FAKE_TARGETS = true ; result = [ - declare-local-target $(<:D=:S=) + declare-local-target $(name) : $(<:R=$(BOOST_ROOT)) # sources : $(requirements) $(BOOST_ROOT) # requirements : # default build @@ -21,19 +35,16 @@ rule boost-test # sources : type : suppress-fake-targets : requirements } Clean clean : $(result) ; type-DEPENDS test : $(result) ; + return result ; } -rule compile # source-file : fail : requirements -{ - boost-test $(<) : OBJ : : $(3) ; -} +####### -rule compile-fail # source-file : requirements -{ - boost-test $(<) : COMPILE_FAIL : gSUPPRESS_FAKE_TARGETS : $(2) ; -} - -rule failed-test-file # test-file : fail-to-build-file +# failed-test-file test-file : fail-to-build-file +# +# a utility rule which causes test-file to be built successfully, only if +# fail-to-build-file fails to build. Used for expected-failure tests. +rule failed-test-file { DEPENDS $(<) : $(>) ; FAIL_EXPECTED $(>) ; @@ -46,30 +57,68 @@ actions failed-test-file echo building "$(>)" failed as expected > $(<) } -rule declare-build-fail-test # test-type : dependency-type +# declare-build-fail-test test-type : dependency-type +# +# A utility rule which declares test-type to be a target type which depends on +# the /failed/ construction of a target of type dependency-type. +rule declare-build-fail-test { gGENERATOR_FUNCTION($(<)) = fail-to-build ; gDEPENDENCY_TYPE($(<)) = $(>) ; SUF$(<) = .fail ; } -rule fail-to-build # sources.test : sources : requirements +# fail-to-build target.test : sources : requirements +# +# A target generator function for target types declared with +# declare-build-fail-test, above. +rule fail-to-build { + # Get the target type of the current target out of the build properties local target-type = [ get-values : $(gBUILD_PROPERTIES) ] ; + + # Get the type of target which will (hopefully) fail to build. local dependency-type = $(gDEPENDENCY_TYPE($(target-type))) ; + + # Get the actual name of the target which should fail to build local fail-target = $(<[1]:S=$(SUF$(dependency-type))) ; + + # Call dependency-type's generator function to (fail to) build the target local ignored = [ $(gGENERATOR_FUNCTION($(dependency-type))) $(fail-target) : $(>) : $(3) ] ; + # Generator functions don't handle this job for us; perhaps they should. set-target-variables $(fail-target) # The .test file goes with the other subvariant targets MakeLocate $(<) : $(LOCATE_TARGET) ; + + # Establish the dependency failed-test-file $(<) : $(fail-target) ; } +### Rules for testing whether a file compiles ### + +# Establish the rule which generates targets of type "OBJ". Should really go +# into basic build system, but wasn't needed 'till now. +gGENERATOR_FUNCTION(OBJ) = Object ; declare-build-fail-test COMPILE_FAIL : OBJ ; +# Test that the given source-file(s) compile +rule compile # source-file : fail : requirements +{ + boost-test $(<) : OBJ : $(3) ; +} + +# Test that the given source-file(s) fail to compile +rule compile-fail # source-file : requirements +{ + boost-test $(<) : COMPILE_FAIL : $(2) ; +} + + +### Rules for testing whether a program runs ### + gGENERATOR_FUNCTION(RUN_TEST) = run-test ; SUFRUN_TEST = .test ; rule run-test # target : sources : requirements @@ -79,14 +128,20 @@ rule run-test # target : sources : requirements set-target-variables $(executable) ; # The .test file goes with the other subvariant targets - MakeLocate $(<) : $(LOCATE_TARGET) ; + # normalization is a hack to get the slashes going the right way on Windoze + local normalized-locate = [ FDirName [ split-path $(LOCATE_TARGET) ] ] ; + MakeLocate $(<) : $(normalized-locate) ; + + DEPENDS $(<) : $(executable) $(gRUN_TEST_INPUT_FILES) ; INPUT_FILES on $(<) = $(gRUN_TEST_INPUT_FILES) ; ARGS on $(<) = $(gRUN_TEST_ARGS) ; capture-run-output $(<) : $(executable) ; } actions capture-run-output bind INPUT_FILES { - $(>) $(ARGS) $(INPUT_FILES) > $(<) + $(>) $(ARGS) $(INPUT_FILES) > $(<:S=.error) + $(CP) $(<:S=.error) $(<) + $(RM) $(<:S=.error) } rule run # sources : args : input-files : requirements @@ -94,13 +149,7 @@ rule run # sources : args : input-files : requirements local gRUN_TEST_ARGS = $(2) ; local gRUN_TEST_INPUT_FILES = $(3) ; SEARCH on $(3) = $(LOCATE_SOURCE) ; - boost-test $(<) : RUN_TEST : : $(4) ; -} - -declare-build-fail-test LINK_FAIL : EXE ; -rule link-fail # sources : requirements -{ - boost-test $(<) : LINK_FAIL : gSUPPRESS_FAKE_TARGETS : $(2) ; + boost-test $(<) : RUN_TEST : $(4) ; } declare-build-fail-test RUN_FAIL : RUN_TEST ; @@ -109,11 +158,21 @@ rule run-fail # sources : args : input-files : requirements local gRUN_TEST_ARGS = $(2) ; local gRUN_TEST_INPUT_FILES = $(3) ; SEARCH on $(3) = $(LOCATE_SOURCE) ; - boost-test $(<) : RUN_FAIL : gSUPPRESS_FAKE_TARGETS : $(4) ; + boost-test $(<) : RUN_FAIL : $(4) ; } -run libs/config/config_test.cpp ; -run libs/config/limits_test.cpp ; +### Rules for testing whether a program links + +declare-build-fail-test LINK_FAIL : EXE ; +rule link-fail # sources : requirements +{ + boost-test $(<) : LINK_FAIL : $(2) ; +} + +# ----------- Actual test invocations follow ----------------# + +run libs/config/test/config_test.cpp ; +run libs/config/test/limits_test.cpp ; run libs/any/any_test.cpp ; run libs/array/array1.cpp ; compile libs/concept_check/concept_check_test.cpp ; diff --git a/tools/build b/tools/build index 9e0cc2e6f0..bdc732fbd6 160000 --- a/tools/build +++ b/tools/build @@ -1 +1 @@ -Subproject commit 9e0cc2e6f055a51e21d45a76a12c8a9027c10a36 +Subproject commit bdc732fbd6bdff7636bcbc4dd8a4662e4f50dc44