From: Karl Hasselström Date: Mon, 30 Jun 2008 08:44:33 GMT Subject: Re: [StGit PATCH 1/2] Try "stg sink" without applied patches Message-ID: <20080630084433.GA20712@diana.vm.bytemark.co.uk> In-Reply-To: On 2008-06-30 09:53:22 +0200, Sverre Rabbelier wrote: > On Mon, Jun 30, 2008 at 12:45 AM, Karl Hasselström wrote: > > > (The implicit sink testcase actually passes, but that's just > > because the test suite can't distinguish between a program bug and > > an orderly abort.) > > Yes it can, that's where "test_must_fail" comes in. > > > +test_expect_success 'sink without applied patches' ' > > + test_must_fail stg sink > > +' > > + > > Like that. Well, except that 1. test_must_fail doesn't even exist in StGit's test-lib.sh, because I've omitted it on purpose when stealing good stuff from git's test-lib.sh, because 2. StGit is written in Python, so random bugs virtually never cause segfaults and stuff, they just raise various exceptions. That said, StGit (especially in the master branch -- but this patch was against stable, where this is much less true) does exit with different exit codes depending on what kind of exception interrupted the program, and all exceptions not on a certain list cause it to exit with an exit code that means there's a bug (see the end of stgit/main.py for details). So writing a test_must_fail with sane behavior is perfectly doable and not actually all that hard. Patch? :-) -- Karl Hasselström, kha@treskal.com www.treskal.com/kalle