Boost logo

Boost-Build :

Subject: [Boost-build] How to create a run-fail for own binary
From: Sven Van Echelpoel (sven.van.echelpoel_at_[hidden])
Date: 2009-02-18 04:43:02


Hi,

we already managed successfully to run tests with a binary created by
another target, as per
http://www.nabble.com/Running-tests-with-executable-built-by-another-target-to21727535.html.

What we want to do now is to run tests and they can succeed or fail. For
that I have created two rules:

rule my-run (
 target : source : options *
)
{
   make $(target) : $(source) : @DoMyRun : $(options) ;
}

rule my-run-fail (
 target : source : options *
)
{
  # This target is expected to fail to build. Then it's actually OK
   FAIL_EXPECTED $(target) ;

   make $(target) : $(source) : @DoMyRun : $(options) ;
}

I would have assumed that simply adding the line "FAIL_EXPECTED
$(target) ;" would turn a failed run into a successful one and vice
versa. Alas this turns out not to be the case. If the run fails
(expected), the target fails.

How can go about emulating the behavior of the compile and compiler-fail
BB rules?

Thanks,

Sven


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