Boost logo

Boost-Build :

Subject: Re: [Boost-build] Leave target on failure?
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2010-03-05 02:44:15

Vladimir Prus wrote:
> On Tuesday 16 February 2010 10:19:09 Johan Nilsson wrote:
>> Ping?
>> Johan Nilsson wrote:
>>> Vladimir Prus wrote:
>>>> On Monday 07 December 2009 13:25:31 Johan Nilsson wrote:
>>>>> 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).
>>> 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?
> I've tried to address this in small steps, and checked in a new
> builtin,
> PRECIOUS, that prevents removal of a target when update fails.
> See:
> Does this help at least half-way? If it mostly works, I'll implement
> an indirection to decide if to retain target based on exit code.

I think so (assuming that "clean" removes even PRECIOUS targets, which it
should do). Need to have the indirection implemented and be able to test it
before I can tell for sure. Also, I hope that there will be a Boost.Build
rule that allows this to be used more easily with Boost.Build level targets
(or am I just assuming this will make things easier)?

As for actually keeping the target based on the exit code, please consider
(such in this case) that the possible exit codes might not be possible to
determine in advance with reasonable effort. It should be possible to set
the exit code as a range, set, or logical/special expression (such as e.g.
NEGATIVE or "< 0"). I guess this could be implemented by allowing the user
to specify a rule used for determining the PRECIOUS-ness of the target.

Many thanks for your efforts.

/ Johan

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at