From 82ad27c4688b26d732dafdf8518313207726a13c Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 11 Jan 2003 11:52:19 +0000 Subject: [PATCH] Modified Jamfile to use testing.jam [SVN r16868] --- example/Jamfile | 221 ++++++++---------------------------------------- test/Jamfile | 137 ++++++++++++++---------------- 2 files changed, 97 insertions(+), 261 deletions(-) diff --git a/example/Jamfile b/example/Jamfile index 69ad5e71..a7df8112 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -4,195 +4,42 @@ subproject libs/regex/example ; SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; include testing.jam ; -run timer/regex_timer.cpp - ../build/boost_regex$(SUFLIB) - : - timer/input_script.txt - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_timer - ; - -run jgrep/jgrep.cpp jgrep/main.cpp - ../build/boost_regex$(SUFLIB) - : - -n boost/ ../../../boost/regex.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - jgrep - ; - -run snippets/credit_card_example.cpp - ../build/boost_regex$(SUFLIB) - : - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - credit_card_example - ; - - -run snippets/partial_regex_grep.cpp - ../build/boost_regex$(SUFLIB) - : - ../index.htm - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - partial_regex_grep - ; - -run snippets/partial_regex_match.cpp - ../build/boost_regex$(SUFLIB) - : - 1234-5678-8765-4 - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - partial_regex_match - ; - -run snippets/regex_grep_example_1.cpp - ../build/boost_regex$(SUFLIB) - : - ../../../boost/rational.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_grep_example_1 - ; - -run snippets/regex_grep_example_2.cpp - ../build/boost_regex$(SUFLIB) - : - ../../../boost/rational.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_grep_example_2 - ; - -run snippets/regex_grep_example_3.cpp - ../build/boost_regex$(SUFLIB) - : - ../../../boost/rational.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_grep_example_3 - ; - -run snippets/regex_grep_example_4.cpp - ../build/boost_regex$(SUFLIB) - : - ../../../boost/rational.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_grep_example_4 - ; - -run snippets/regex_match_example.cpp - ../build/boost_regex$(SUFLIB) - : - -auto - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_match_example - ; - -run snippets/regex_merge_example.cpp - ../build/boost_regex$(SUFLIB) - : - ../../../boost/rational.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_merge_example - ; - -run snippets/regex_search_example.cpp - ../build/boost_regex$(SUFLIB) - : - ../../../boost/rational.hpp - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_search_example - ; - -run snippets/regex_split_example_1.cpp - ../build/boost_regex$(SUFLIB) - : - -auto - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_split_example_1 - ; - -run snippets/regex_split_example_2.cpp - ../build/boost_regex$(SUFLIB) - : - ../index.htm - : - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - regex_split_example_2 - ; - - - - - - +rule regex-test-run ( sources + : input * ) +{ + return [ + run + # sources + $(sources) + # dependencies + ../build/boost_regex + : # additional args + $(input) + : # test-files + : # requirements + ../../../ + BOOST_REGEX_NO_LIB=1 + BOOST_REGEX_STATIC_LINK=1 + : # test name + ] ; +} +test-suite regex-examples : +[ regex-test-run timer/regex_timer.cpp : timer/input_script.txt ] +[ regex-test-run jgrep/jgrep.cpp jgrep/main.cpp : -n boost/ ../../../boost/regex.hpp ] +[ regex-test-run snippets/credit_card_example.cpp ] +[ regex-test-run snippets/partial_regex_grep.cpp : ../index.htm ] +[ regex-test-run snippets/partial_regex_match.cpp : 1234-5678-8765-4 ] +[ regex-test-run snippets/regex_grep_example_1.cpp : ../../../boost/rational.hpp ] +[ regex-test-run snippets/regex_grep_example_2.cpp : ../../../boost/rational.hpp ] +[ regex-test-run snippets/regex_grep_example_3.cpp : ../../../boost/rational.hpp ] +[ regex-test-run snippets/regex_grep_example_4.cpp : ../../../boost/rational.hpp ] +[ regex-test-run snippets/regex_match_example.cpp : -auto ] +[ regex-test-run snippets/regex_merge_example.cpp : ../../../boost/rational.hpp ] +[ regex-test-run snippets/regex_search_example.cpp : ../../../boost/rational.hpp ] +[ regex-test-run snippets/regex_split_example_1.cpp : -auto ] +[ regex-test-run snippets/regex_split_example_2.cpp : ../index.htm ] +; diff --git a/test/Jamfile b/test/Jamfile index 6241b994..cd1bda40 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -1,5 +1,9 @@ subproject libs/regex/test ; +# bring in the rules for testing +SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; +include testing.jam ; + local test-dir = $(BOOST_ROOT)$(SLASH)libs$(SLASH)regex$(SLASH)test$(SLASH)regress$(SLASH) ; local test-files = $(test-dir)tests.txt @@ -7,83 +11,68 @@ local test-files = $(test-dir)tests.txt # $(test-dir)test1252.txt ; -unit-test regress : regress/parse.cpp regress/regress.cpp regress/tests.cpp - ../build/boost_regex$(SUFLIB) ../../test/build/boost_prg_exec_monitor - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - debug - : - $(test-files) - ; - -unit-test wregress : regress/parse.cpp regress/regress.cpp regress/tests.cpp - ../build/boost_regex$(SUFLIB) ../../test/build/boost_prg_exec_monitor - : - ../../../ - BOOST_REGEX_NO_LIB=1 - TEST_UNICODE=1 - BOOST_REGEX_STATIC_LINK=1 - : - debug - : - $(test-files) - ; - -unit-test posix_api_check_c : c_compiler_checks/posix_api_check.c - ../build/boost_regex$(SUFLIB) ../../test/build/boost_prg_exec_monitor - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - debug - : - ; - -unit-test wide_posix_api_check_c : c_compiler_checks/wide_posix_api_check.c - ../build/boost_regex$(SUFLIB) ../../test/build/boost_prg_exec_monitor - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - debug - : - ; - -unit-test posix_api_check : c_compiler_checks/posix_api_check.cpp - ../build/boost_regex$(SUFLIB) ../../test/build/boost_prg_exec_monitor - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - debug - : - ; - -unit-test wide_posix_api_check : c_compiler_checks/wide_posix_api_check.cpp - ../build/boost_regex$(SUFLIB) ../../test/build/boost_prg_exec_monitor - : - ../../../ - BOOST_REGEX_NO_LIB=1 - BOOST_REGEX_STATIC_LINK=1 - : - debug - : - ; - - - - - - + test-suite regex + : [ run regress/parse.cpp regress/regress.cpp regress/tests.cpp + ../build/boost_regex + ../../test/build/boost_prg_exec_monitor + : + $(test-files) + : + : + BOOST_REGEX_NO_LIB=1 + BOOST_REGEX_STATIC_LINK=1 + : + regress ] + [ run regress/parse.cpp lregress/regress.cpp regress/tests.cpp + ../build/boost_regex + ../../test/build/boost_prg_exec_monitor + : + $(test-files) + : + : + BOOST_REGEX_NO_LIB=1 + TEST_UNICODE=1 + BOOST_REGEX_STATIC_LINK=1 + : + wregress ] + [ run c_compiler_checks/posix_api_check.c + ../build/boost_regex + : + : + : + BOOST_REGEX_NO_LIB=1 + BOOST_REGEX_STATIC_LINK=1 + : + posix_api_check_c ] + [ run c_compiler_checks/wide_posix_api_check.c + ../build/boost_regex + : + : + : + BOOST_REGEX_NO_LIB=1 + BOOST_REGEX_STATIC_LINK=1 + : + wide_posix_api_check_c ] + [ run c_compiler_checks/posix_api_check.cpp + ../build/boost_regex + : + : + : + BOOST_REGEX_NO_LIB=1 + BOOST_REGEX_STATIC_LINK=1 + ] + [ run c_compiler_checks/wide_posix_api_check.cpp + ../build/boost_regex + : + : + : + BOOST_REGEX_NO_LIB=1 + BOOST_REGEX_STATIC_LINK=1 + ] +;