2 messages in com.perforce.jamming[jamming] Newbie Q: Automated unit test
FromSent OnAttachments
Ullr...@informatik.uni-hamburg.de08 Mar 2000 15:13 
Matt...@corp.phone.com09 Mar 2000 11:07 
Subject:[jamming] Newbie Q: Automated unit test
From:Ullr...@informatik.uni-hamburg.de (Ullr@informatik.uni-hamburg.de)
Date:03/08/2000 03:13:15 PM
List:com.perforce.jamming

Hi,

I'm trying to built Jam rules which ensure that a package is only build if a number of unit tests have successfully been executed. However, in my Jamfiles, the package gets build even if the unit tests fail. What needs to be changed to make the idea work ?

Thanks for any help Ulli

# Jamrules DEPENDS obj lib exe : unittest ; NOTFILE unittest ;

rule TestedLibrary { UnitTest $(<) : $(3) ;

# this rule shouldn't succeed if the UnitTest failed Library $(<) : $(>) ; }

rule UnitTest { DEPENDS unittest : $(<) ; }

actions UnitTest { $(>) # produces nonzero exit code upon failure }

# Jamfile

Main test : test.c ; TestedLibrary libmod1 : mod1.c : test ;

# Output

UnitTest libmod1

/home/koethe/C++/make/sandbox/src/mod1/test

...failed UnitTest libmod1 ... Cc /home/koethe/C++/make/sandbox/src/mod1/mod1.o Archive /home/koethe/C++/make/sandbox/src/mod1/libmod1.a (The last line shouldn't be there)