Boost logo

Boost Testing :

From: John Maddock (john_at_[hidden])
Date: 2008-05-02 08:31:37


John Maddock wrote:
> siliconman wrote:
>> In article <fv23l0$o52$1_at_[hidden]>,
>> "Robert Ramey" <ramey_at_[hidden]> wrote:
>>
>>> In V2 - I tried to update my Jamfile to handle this but have
>>> been unsuccessful. I did ask for help on this a couple of
>>> times on the build list - but the response I got suggested
>>> what I did should work - so here we are.
>>>
>>> I would love to get this fixed so I could test this
>>> compiler on my own system.
>>
>> So what needs done here? As it stands I am unable to do regression
>> testing at all. I'm very much willing to put time into this, but I
>> need at least a starting point.
>
> I think I *may* have a fix: it seems that if a target has both a
> <build>no and a <dependency>some-target, then you get a Boost.Build
> error from "some-target". Commenting out the <build>no option in
> libs/serialization/build/Jamfile.v2 fixes things temporarily, but
> isn't much of a fix: I think I have a better one, but it needs
> tidying up and testing!

The best I have is below - it requires a few rules to be duplicated in
several places which is not good at all - but it retains the <build>no
optimisation for older compilers.

I tried to use the import rule to define the new rules in one place only and
then import it where required, but I couldn't get it to work for some
reason. If anyone can see a way of tidying this up that would be great:
otherwise it may be better to simply remove the <build>no optimisation, but
then I guess Borland users will get an alarming number of error messages at
install time?

Anyway I'm out of time on this now: can one of David or Robert take a look
at this and see if it can be improved? Or maybe a BBv2 expert can help out?

Regards, John.

Index: build/Jamfile.v2
===================================================================
--- build/Jamfile.v2 (revision 44767)
+++ build/Jamfile.v2 (working copy)
@@ -8,11 +8,49 @@

 project boost/serialization
     : source-location ../src
- : requirements <dependency>../../config/test/all//BOOST_NO_STD_LOCALE
+ : requirements
       <conditional>@include-spirit
 ;

 SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
+rule depend-wstreambuf ( properties * )
+{
+ local old-compiler ;
+ if <toolset>borland in $(properties)
+ {
+ old-compiler = true ;
+ }
+ else if <toolset>msvc in $(properties)
+ {
+ if <toolset-msvc:version>6.5 in $(properties)
+ || <toolset-msvc:version>7.0 in $(properties)
+ {
+ old-compiler = true ;
+ }
+ }
+
+ local result ;
+ if $(old-compiler)
+ {
+ if $(SPIRIT_ROOT)
+ {
+ # note - we can't use <include>$(SPIRIT_ROOT) because
+ # it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command
line
.
+ # so use these instead
+ result =
<dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
 ;
+ }
+ else
+ {
+ }
+ }
+ else
+ {
+ result = <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
;
+ }
+ return $(result) ;
+}
+
+SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
 rule include-spirit ( properties * )
 {
     local old-compiler ;
@@ -37,7 +75,7 @@
             # note - we can't use <include>$(SPIRIT_ROOT) because
             # it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command
line
.
             # so use these instead
- result = <cxxflags>-I$(SPIRIT_ROOT) ;
+ result = <cxxflags>-I$(SPIRIT_ROOT)
<dependency>../../config/test/a
ll//BOOST_NO_STD_LOCALE ;
         }
         else
         {
@@ -45,6 +83,10 @@
             result = <build>no ;
         }
     }
+ else
+ {
+ result = <dependency>../../config/test/all//BOOST_NO_STD_LOCALE ;
+ }
     return $(result) ;
 }

@@ -100,7 +142,7 @@
     : $(WSOURCES).cpp boost_serialization
     :
     <toolset>msvc:<cxxflags>/Gy
- <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
+ <conditional>@depend-wstreambuf
     <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
     ;

Index: test/Jamfile.v2
===================================================================
--- test/Jamfile.v2 (revision 44767)
+++ test/Jamfile.v2 (working copy)
@@ -23,6 +23,45 @@
     test-bsl-run_polymorphic_archive
 ;

+SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
+rule depend-wstreambuf ( properties * )
+{
+ local old-compiler ;
+ if <toolset>borland in $(properties)
+ {
+ old-compiler = true ;
+ }
+ else if <toolset>msvc in $(properties)
+ {
+ if <toolset-msvc:version>6.5 in $(properties)
+ || <toolset-msvc:version>7.0 in $(properties)
+ {
+ old-compiler = true ;
+ }
+ }
+
+ local result ;
+ if $(old-compiler)
+ {
+ if $(SPIRIT_ROOT)
+ {
+ # note - we can't use <include>$(SPIRIT_ROOT) because
+ # it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command
line
.
+ # so use these instead
+ result =
<dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
 ;
+ }
+ else
+ {
+ }
+ }
+ else
+ {
+ result = <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
;
+ }
+ return $(result) ;
+}
+
+
 BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;

 test-suite "serialization" :
@@ -84,11 +123,11 @@

         [ test-bsl-run-no-lib test_utf8_codecvt
             : ../src/utf8_codecvt_facet
- : <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
+ : <conditional>@depend-wstreambuf
         ]
         [ test-bsl-run-no-lib test_codecvt_null
             : ../src/codecvt_null
- : <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
+ : <conditional>@depend-wstreambuf
         ]

         # should fail compilation
Index: util/test.jam
===================================================================
--- util/test.jam (revision 44767)
+++ util/test.jam (working copy)
@@ -12,6 +12,45 @@

 BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ;

+SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
+rule depend-wstreambuf ( properties * )
+{
+ local old-compiler ;
+ if <toolset>borland in $(properties)
+ {
+ old-compiler = true ;
+ }
+ else if <toolset>msvc in $(properties)
+ {
+ if <toolset-msvc:version>6.5 in $(properties)
+ || <toolset-msvc:version>7.0 in $(properties)
+ {
+ old-compiler = true ;
+ }
+ }
+
+ local result ;
+ if $(old-compiler)
+ {
+ if $(SPIRIT_ROOT)
+ {
+ # note - we can't use <include>$(SPIRIT_ROOT) because
+ # it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command
line
.
+ # so use these instead
+ result =
<dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
 ;
+ }
+ else
+ {
+ }
+ }
+ else
+ {
+ result = <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
;
+ }
+ return $(result) ;
+}
+
+
 # these are used to shorten testing while in development. It permits
 # testing to be applied to just a particular type of archive
 if ! $(BOOST_ARCHIVE_LIST) {
@@ -94,7 +133,7 @@
             # both stlport and msvc6 define iswspace
             <toolset>msvc,<stdlib>stlport:<linkflags>"-force:multiple"
             <dependency>$(save-test)
- <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
+ <conditional>@depend-wstreambuf
     ] ;
     return $(tests) ;
 }


Boost-testing list run by mbergal at meta-comm.com