Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-10-10 11:06:36


John Maddock wrote:
> I had a grep through the headers and couldn't find any instances of
> obfuscated header includes that might trigger a problem in the library,
> however in the test sources there are a lot that contain:
>
> #include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST)
>
> BOOST_ARCHIVE_TEST gets defined as a macro in the Jamfile so that different
> archive forms (text, binary xml etc) all get tested.
>
> So.... if there is a change in the library the *test* may not get rebuilt.
> Robert is that a fair characterisation of the problem?
>
> I don't see any easy solution to this, unless a DEPENDS clause can be added
> at the same time as the "run" clause gets added to the tests (inside another
> rule that is). Rene would that be possible? Any chance you could look at
> the Jamfile and figure out how at least one of the DEPENDS clauses should
> look so the rest of us mortals could take it from there?

I'm not sure that's possible. And there is a much easier solution. The
tests can be changed to have the needed #include references to all those
headers. All it takes is adding this, to each point there is the above
PP include:

/*
#include "text_archive.hpp"
#include "text_warchive.hpp"
#include "binary_archive.hpp"
#include "xml_archive.hpp"
#include "xml_warchive.hpp"
*/

Since it's commented out the tests themselves don't change behavior. And
since bjam doesn't care about comments it will find them. If the extra
typing is a bummer those, along with the PP include, could be placed in
a separate archive_test.hpp which has:

#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST)
/*
#include "text_archive.hpp"
#include "text_warchive.hpp"
#include "binary_archive.hpp"
#include "xml_archive.hpp"
#include "xml_warchive.hpp"
*/

And then change the PP includes to '#include "archive_test.hpp"'.
Drawback is that a library change will cause every type of archive to be
tested, but it would do that anyway even if bjam parsed the PP include :-)

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk