List Info

Thread: Re: Trying to create CxxTest support




Re: Trying to create CxxTest support
user name
2007-01-25 19:00:53
Hi Scott, Here is my naive implementation to building and running cxxtests: # Jamroot import testing ; path-constant ROOT_DIR : . ; CXX_TEST_GEN_PL = $(ROOT_DIR)/cxxtest/cxxtestgen.pl ; actions make-test-runner { perl -w $(CXX_TEST_GEN_PL) --error-printer --template cxxtest/testmain.tpl -o $(<) $(2) } rule make-runner ( name * : tested-sources * : tests * : requirements * ) { if ! $(tests) { tests = [ sequence.insertion-sort [ glob *Test.h ] ] ; } make runner.cpp : $(tests) : $(__name__).make-test-runner ; unit-test runner : runner.cpp $(tested-sources) : $(requirements) ; } # Jamfile in my test directory TESTED_SOURCES = # put for source files or projects here, I recommend projects to avoid compiling file multiple times ; make-runner : $(TESTED_SOURCES) ; This creates a test runner for each directory. HTH, Zhon _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Re: Trying to create CxxTest support
user name
2007-01-26 09: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 /site-config//cxxtest # defines requirements for compiling linking : .... ; #----------------------------------------------------------------------- -- 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 -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 _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )