Boost logo

Boost-Build :

From: rameysb (Ramey_at_[hidden])
Date: 2004-02-18 01:34:36


I think this situation is very similar to my own problem.

I'm building a library. An optional part of the library requires
support for wide char streams. So I build two libraries.

libboost_serialization.lib // common code
libboost_wserialization.lib // code specifict to wide char i/o

I want to run the tests that use the wide char i/o if and only if
the libboost_wserialization.lib successfully builds.

Currently the tests attempt to build even if the wide char library
fails resulting in lots of wasted time and a status table marked fail
rather than missing.

Below is the first part of the jamfile ( sorry for the long post)

Robert Ramey

# Boost serialization Library test Jamfile

# (C) Copyright Robert Ramey 2003.
# much help from Rene Rivera

subproject libs/serialization/test ;

# bring in rules for testing
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
import testing.jam ;

# Make tests run by default.
DEPENDS all : test ;

rule run-invoke ( test-name : sources * : defn * )
{
Echo $(test-name) ;
return [
run
$(sources)
<lib>../../../libs/test/build/boost_test_exec_monitor
<lib>../../../libs/serialization/build/boost_serialization
: # args
: # input files
: # requirements
<threading>single
<runtime-link>static
<stlport-iostream>on
: # name
$(test-name)_debug
: # default-build
debug

] ;
return [
run
$(sources)
<lib>../../../libs/test/build/boost_test_exec_monitor
<lib>../../../libs/serialization/build/boost_serialization
: # args
: # input files
: # requirements
<threading>single
<runtime-link>static
<stlport-iostream>on
: # name
$(test-name)_release
: # default-build
release
] ;
}

rule test-bsl-run ( test-name : sources * )
{
return [
run-invoke $(test-name) : $(test-name).cpp $(sources).cpp
] ;
}

rule test-bsl-run_files ( test-name )
{

for defn in TEXT_ARCHIVE BINARY_ARCHIVE XML_ARCHIVE {
return [
run-invoke $(test-name)_$(defn:L) : $(test-name).cpp :
$(defn)
] ;
}
for defn in TEXT_WARCHIVE XML_WARCHIVE {
return [
run-invoke $(test-name)_$(defn:L)
:
$(test-name).cpp

<lib>../../../libs/serialization/build/boost_wserialization
:
$(defn)
] ;
}
}

# look in BOOST_ROOT for sources first, just in this Jamfile
local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;

local test-dir = "$(BOOST_ROOT)$(SLASH)libs$(SLASH)
serialization$(SLASH)test$(SLASH)tmp$(SLASH)" ;

# each of the following tests is run with each type of archive

test-suite "serialization" :
[ test-bsl-run_files test_array ]
[ test-bsl-run_files test_binary ]
[ test-bsl-run_files test_contained_class ]
[ test-bsl-run_files test_cyclic_ptrs ]

<snip>

--- In jamboost_at_[hidden], Rene Rivera <grafik.list_at_r...> wrote:
> Jeremy Siek wrote:
>
> > Hi Guys,
> >
> > In the Jamfile for libs/graph/example, I'd like to only compile
> > and run some of the examples when certain other non-boost
libraries
> > are also installed. How do I do that?
>
> Boost.Python does a variety of checks in order to achieve that. But
it all
> boils down to checking if a file exists on the users machine with
the GLOB
> builtin.
>
> > Also, as part of running the examples, I'd like to compare the
> > output of an example with the expected output. How do I do that?
>
> You mean within the test system?
>
>
> --
> -- Grafik - Don't Assume Anything
> -- Redshift Software, Inc. - http://redshift-software.com
> -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

 


Boost-Build 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