Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70694 - trunk/libs/spirit/test
From: ghost_at_[hidden]
Date: 2011-03-29 09:12:39


Author: vladimir_prus
Date: 2011-03-29 09:12:39 EDT (Tue, 29 Mar 2011)
New Revision: 70694
URL: http://svn.boost.org/trac/boost/changeset/70694

Log:
Complete Phonix 2 & 3 test setup.

Current regression test system assumes that each test has a distinct
name. It does not support having one test built with two property sets,
and reporting them properly. So, we need to locally redefine the
'run' and 'compile' functions to declare two variants of each test.

Text files modified:
   trunk/libs/spirit/test/Jamfile | 68 ++++++++++++++++++++++-----------------
   1 files changed, 39 insertions(+), 29 deletions(-)

Modified: trunk/libs/spirit/test/Jamfile
==============================================================================
--- trunk/libs/spirit/test/Jamfile (original)
+++ trunk/libs/spirit/test/Jamfile 2011-03-29 09:12:39 EDT (Tue, 29 Mar 2011)
@@ -17,7 +17,7 @@
 # new feature definition allowing to switch between Phoenix V2 and V3 tests
 feature.feature phoenix_v3
     : on
- : optional composite propagated
+ : composite propagated
     ;
 
 feature.compose <phoenix_v3>on
@@ -36,34 +36,32 @@
     :
     :
     ;
+
+v2_tests = ;
+v3_tests = ;
+
+rule run ( sources + : args * : input-files * : requirements * : target-name ? : default-build * )
+{
+ target-name ?= $(sources[1]:D=:S=) ;
+ local r = [ testing.run $(sources) : $(args) : $(input-files) : $(requirements) : $(target-name)-p2 : $(default-build) ] ;
+ v2_tests += $(r) ;
+ v3_tests += [ testing.run $(sources) : $(args) : $(input-files) : $(requirements) <phoenix_v3>on : $(target-name)-p3 : $(default-build) ] ;
+}
 
-# use this alias to build Spirit against Phoenix V2
-alias test_using_phoenix_v2
- : spirit_v2/qi
- spirit_v2/qi_regressions
- spirit_v2/karma
- spirit_v2/karma_regressions
- spirit_v2/lex
- spirit_v2/lex_regressions
- spirit_v2/support
- spirit_v2/support_regressions
- ;
-
-# use this alias to build Spirit against Phoenix V3
-alias test_using_phoenix_v3
- : spirit_v2/qi
- spirit_v2/qi_regressions
- spirit_v2/karma
- spirit_v2/karma_regressions
- spirit_v2/lex
- spirit_v2/lex_regressions
- spirit_v2/support
- spirit_v2/support_regressions
- : <phoenix_v3>on
- ;
-
-explicit test_using_phoenix_v2 test_using_phoenix_v3 ;
+rule compile ( sources + : requirements * : target-name ? )
+{
+ target-name ?= $(sources[1]:D=:S=) ;
+ v2_tests += [ testing.compile $(sources) : $(requirements) : $(target-name)-p2 ] ;
+ v3_tests += [ testing.compile $(sources) : $(requirements) <phoenix_v3>on : $(target-name)-p3 ] ;
+}
 
+rule compile-fail ( sources + : requirements * : target-name ? )
+{
+ target-name ?= $(sources[1]:D=:S=) ;
+ v2_tests += [ testing.compile-fail $(sources) : $(requirements) : $(target-name)-p2 ] ;
+ v3_tests += [ testing.compile-fail $(sources) : $(requirements) <phoenix_v3>on : $(target-name)-p3 ] ;
+}
+
 ###############################################################################
 path-constant LEX_DIR : $(BOOST_ROOT)/libs/spirit/test/lex ;
 
@@ -276,9 +274,15 @@
      [ run lex/regression_basic_lexer.cpp : : : : lex_regression_basic_lexer ]
      [ run lex/regression_matlib_dynamic.cpp : : : : lex_regression_matlib_dynamic ]
      [ run lex/regression_matlib_generate.cpp : $(LEX_DIR)/matlib_static.h : : : lex_regression_matlib_generate ]
- [ run lex/regression_matlib_static.cpp : : : <dependency>.//lex_regression_matlib_generate : lex_regression_matlib_static ]
+ [ run lex/regression_matlib_static.cpp : : :
+ <phoenix_v3>on:<dependency>.//lex_regression_matlib_generate-p3
+ <phoenix_v3>off:<dependency>.//lex_regression_matlib_generate-p2
+ : lex_regression_matlib_static ]
      [ run lex/regression_matlib_generate_switch.cpp : $(LEX_DIR)/matlib_static_switch.h : : : lex_regression_matlib_generate_switch ]
- [ run lex/regression_matlib_switch.cpp : : : <dependency>.//lex_regression_matlib_generate_switch : lex_regression_matlib_switch ]
+ [ run lex/regression_matlib_switch.cpp : : :
+ <phoenix_v3>on:<dependency>.//lex_regression_matlib_generate_switch-p3
+ <phoenix_v3>off:<dependency>.//lex_regression_matlib_generate_switch-p2
+ : lex_regression_matlib_switch ]
      [ run lex/regression_word_count.cpp : : : : lex_regression_word_count ]
      [ run lex/regression_syntax_error.cpp : : : : lex_regression_syntax_error ]
      [ run lex/regression_wide.cpp : : : : lex_regression_wide ]
@@ -307,3 +311,9 @@
     ;
 }
 
+# use this alias to buil Spirit against Phoenix V2
+alias test_using_phoenix_v2 : $(v2_tests) ;
+
+# use this alias to buil Spirit against Phoenix V3
+alias test_using_phoenix_v3 : $(v3_tests) ;
+explicit test_using_phoenix_v2 test_using_phoenix_v3 ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk