Boost logo

Boost-Build :

From: McMillan, Scott (scott.mcmillan_at_[hidden])
Date: 2007-01-26 10:13:54


Thanks to ideas in a few different emails recently I have something
working. This is what I have so far (I am using m11).

In my Jamfile for the tests I have the following:

#-----------------------------------------------------------------------
--run-cxxtest my_test
  : FooTS.h BarTS.h
  : FooTS.cpp BarTS.cpp <other sources as necessary>
    /site-config//cxxtest # defines requirements for compiling
linking
  : <library>....
  ;
#-----------------------------------------------------------------------

--
When I put the following in this Jamfile everything works as expected:
#-----------------------------------------------------------------------
--
rule gen-cxxtest-runner ( target : sources + : properties )
{
}
actions gen-cxxtest-runner
{
  cxxtestgen.pl <some flags> -o $(<) $(>)
}
rule run-cxxtest ( target-name :
                   cxxtest-headers + :
                   sources * :
                   requirements * )
{
  make $(target-name)_runner.cpp : $(cxxtest-headers) :
gen-cxxtest-runner ;
  unit-test $(target-name)
    : $(target-name)_runner.cpp $(sources)
    : $requirements
    ;
}
#-----------------------------------------------------------------------
--
But when I try to put this into a cxxtest.jam file in the Boost.build
tools directory and import it into the Jamfile things stop working.  It
complains that it does not know what the run-cxxtest rule is.
1) Could someone please clarify the steps needed to turn this into a
tool I can import into any Jamfile (note that I did include an empty
init rule but that did not help)?  The documentation in this area would
be greatly improved with some concrete examples.
2) Also (echoing a question from Ashley yesterday about "help with make
rule"), why do I need an empty gen-cxxtest-runner rule in order to get
the make rule to work with the corresponding action?
When this is all done would love to have it included in the Boost.Build
distro if you all deem it helpful (we also have a mipspro.jam for those
interested).
Thanks for the help,
scott

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