Boost logo

Boost-Build :

Subject: Re: [Boost-build] Leave target on failure?
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2010-02-16 02:19:09


Ping?

Johan Nilsson wrote:
> Vladimir Prus wrote:
>> On Monday 07 December 2009 13:25:31 Johan Nilsson wrote:
>>
>>> Hi,
>>>
>>> I've discovered a "minor" design flaw in my NUnit generator under
>>> development (same as previously discussed here).
>>>
>>> The generator generates two main outputs (if XML output is
>>> activated):
>>>
>>> - The "target name".nunit file, used to detect if the tests are
>>> up-to-date and were run successfully.
>>> - The XML report, used to store details on tests run and their
>>> success.
>>>
>>> Now, when one or more of the tests fail at runtime, the XML report
>>> is deleted as well - which is obviously not what I'd like. What
>>> would be the best design for allowing to leave the XML report
>>> behind, if:
>>>
>>> 1. The tests are actually run (no problems with e.g. the test runner
>>> not being able to find or load the shared libraries containing the
>>> tests, or their runtime dependencies).
>>> 2. One or more of the tests fail at runtime (the test runner then
>>> exits with a non-zero status code).
>>>
>>> If (1) above fails, i.e. there is a problem with the actual runner
>>> execution, I think the XML report should get deleted as no tests
>>> were actually created.
>>>
>>> Any comments / design suggestions?
>>
>> I have looked at the build engine code and now at least capable of
>> asking semi-intelligent questions.
>>
>> I think I can implement, inside bjam, a mechanism to leave a given
>> target even
>> if the action to update it fails -- so this should help with leaving
>> XML report
>> if the runner returns non-zero exit status. That's not exactly the
>> behaviour you
>> want.
>>
>> To implement the behaviour you want, how can we distinguish between
>> cases (1)
>> and (2) above? Does runner return different error codes? Or there's
>> some other
>> approach?
>
> Coming back to this problem after some time. I've checked the source
> code
> for the test runner and it seems like:
>
> - A negative status code is set if (1) occurs.
> - A positive status code, corresponding to the no of failing tests,
> is set
> if (2) occurs.
>
> Does this help?
>
> / Johan
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build


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