From: Zbynek Winkler (zw-bjam_at_[hidden])
Date: 2004-09-07 05:29:46
Vladimir Prus wrote:
>>>> # -- sources
>>>> : main.cpp NumberTest.cpp
>>>> # -- libs against which we link
>>>>The last Jamfile builds the unit test, main.exe. I would like to be
>>>>able to use the unit-test target to invoke main.exe automatically. Any
>>>>help would, as always, be greatly appreciated.
>>>The 'unit-test' rule is synonym for the 'run' rule, which is defined like
>>>rule run ( sources + : args * : input-files * : requirements * :
>>> : default-build * )
>>>So you'd have to write:
>>> unit-test main.cpp NumberTest.cpp > ../lib//long/<link>static
>>Has it been changed recently? Because for me, the unit-test requires a
>>name first. So the above would have to be:
>>unit-test name-of-the-exe-to-generate-and-run : main.cpp NumberTest.cpp
>Oops, sorry. The unit-test rule calls 'run' but reorders the arguments, so
>name should be the first argument to 'unit-test' indeed. I think this
>confusion is deplorable, maybe we should deprecate 'unit-test'.
I don't think that deprecating 'unit-test' would be a good idea. The
thing is that it looks consistent with the other rules like exe or lib.
I've never used 'run' because thanks to its similarity with the main
targets, 'unit-test' looked like the right way to go.
Actually, I'd be interested to know if it would be possible to integrate
unit testing even more into the build process. For example when I have a
cpp file and a test for this cpp file - would it be possible to include
the corresponding obj file into anything only after the test has
-- http://zw.matfyz.cz/ http://robotika.cz/ Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic
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