[jamming] Conditionalizing Jam's Program Flow

Michael Peterson mtp1032 at comcast.net
Tue Nov 9 14:21:28 PST 2004


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
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/jamming/attachments/20041109/fe827610/attachment-0001.html>


More information about the jamming mailing list