Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2008-05-04 15:46:59


Author: grafik
Date: 2008-05-04 15:46:59 EDT (Sun, 04 May 2008)
New Revision: 45117
URL: http://svn.boost.org/trac/boost/changeset/45117

Log:
Work around for specifying test names with periods in them which creates "duplicate" target names.
Text files modified:
   trunk/tools/build/v2/tools/testing.jam | 20 ++++++++++++++++++--
   1 files changed, 18 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/tools/testing.jam
==============================================================================
--- trunk/tools/build/v2/tools/testing.jam (original)
+++ trunk/tools/build/v2/tools/testing.jam 2008-05-04 15:46:59 EDT (Sun, 04 May 2008)
@@ -47,6 +47,7 @@
 import common ;
 import sequence ;
 import errors ;
+import regex ;
 
 
 rule init ( )
@@ -83,6 +84,15 @@
 rule make-test ( target-type : sources + : requirements * : target-name ? )
 {
     target-name ?= $(sources[1]:D=:S=) ;
+
+ # Having periods (".") in the target name is problematic because the
+ # typed generator will strip the suffix and use the bare name for the
+ # file targets. Even though the location-prefix averts problems most
+ # times it doesn't prevent ambiguity issues when referring to the
+ # test targets. For example when using the XML log output. So we
+ # rename the target to remove the periods, and provide an alias
+ # for users.
+ local real-name = [ regex.replace $(target-name) "[.]" "~" ] ;
 
     local project = [ project.current ] ;
     # The <location-prefix> forces the build system for generate paths in the
@@ -91,8 +101,14 @@
     local t =
       [ targets.create-typed-target
           [ type.type-from-rule-name $(target-type) ] : $(project)
- : $(target-name) : $(sources)
- : $(requirements) <location-prefix>$(target-name).test ] ;
+ : $(real-name) : $(sources)
+ : $(requirements) <location-prefix>$(real-name).test ] ;
+
+ # The alias to the real target, per period replacement above.
+ if $(real-name) != $(target-name)
+ {
+ alias $(target-name) : $(t) ;
+ }
 
     # Remember the test (for --dump-tests). A good way would be to collect all
     # given a project. This has some technical problems: e.g. we can't call this


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