From: Eric Hodel Date: 2003-02-12T16:05:00+09:00 Subject: Re: Test::Unit exit status --ULyIDA2m8JTe+TiX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable nathaniel@NOSPAMtalbott.ws (nathaniel@NOSPAMtalbott.ws) wrote: > Bil Kleb [mailto:William.L.Kleb@NASA.Gov] wrote: >=20 > > The version of testunit that I'm using doesn't appear to=20 > > return a non-zero exit status when it finds failures or errors. > >=20 > > Does a newer version set this, or does anyone have a patch > > to do this? (I haven't browsed the source yet...) >=20 > Is there a way to set the exit status besides Kernel#exit()? The > difficulty is that the runners do not (and should not) explicitly exit. > One way around this is to do the following in the test you're running: >=20 > exit(1) > unless(Test::Unit::UI::Console::TestRunner.start(MyTestSuite).passed?) >=20 > The other facet of this is automatic running via #at_exit, and I don't > think I can do anything there, either. The problem is that calling #exit > from an #at_exit block doesn't set the exit status (I guess because > #at_exit blocks happen after the official exit of the program). >=20 > I'd love to hear about other possibilities... How about not using at_exit, and instead using oh, say, zentestrunner.rb... --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --ULyIDA2m8JTe+TiX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+SfIZMypVHHlsnwQRAgPzAJ0SOLfw8m+dSAibxFEdLfNdoDrTVwCbB7xd zYLIqbBNY/4tZC3AfxTIvVM= =A2Lq -----END PGP SIGNATURE----- --ULyIDA2m8JTe+TiX--