[jamming] Conditionalizing Jam's Program Flow

Matze Braun matze at braunis.de
Tue Nov 9 17:31:21 PST 2004


That's what dependencies are for: Make the unit tests dependencies of the 
build results.

Greetings,
 	Matze

On Tue, 9 Nov 2004, Michael Peterson wrote:

> All,
>
> I want to use Jam to build a source tree and execute the tree's unit
> tests. These two operations are trivial and I have 'em working quite
> nicely. However, I want to extend this just a bit. Specifically, I would
> like to conditionalize the jamfile to NOT execute the unit tests if the
> build fails.
>
> Some background: If the build fails two files, build.log and build.err,
> are produced. If the build succeeds, only build.log is produced. I would
> like to be able to detect when the build fails (e.g., the presence of
> build.err) and halt all jam processing. If the build succeeds, I want to
> continue jam processing and execute the unit tests. In other words:
>
>
>
> IF( BUILD_SUCCEEDS )
> {
>    execute unit_tests;
>    email build.log to dev team;
>    email unit test results to dev team;
> }
> ELSE
> {
>    email build.log to dev team;
>    email build.err to dev team;
> }
>
>
> I know how to set up the rules/actions for the email and the unit_tests
> operations.  However, I am at a loss as to how to implement the
> conditionalization. Can someone point me in the right direction?
>
> Cheers,
>
> Michael
>
>



More information about the jamming mailing list