git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [StGit PATCH 1/2] Try "stg sink" without applied patches

From
Karl Hasselström <kha@treskal.com>
Date
Jun 30, 2008, 08:44 UTC
Message-ID
<20080630084433.GA20712@diana.vm.bytemark.co.uk>
In-Reply-To
<bd6139dc0806300053m4325104dx145cd8840c630453@mail.gmail.com>
On 2008-06-30 09:53:22 +0200, Sverre Rabbelier wrote:
Show 14 quoted lines
> On Mon, Jun 30, 2008 at 12:45 AM, Karl Hasselström <kha@treskal.com> 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
Previous: Sverre RabbelierNext: Karl Hasselström
Message 4 of 5 in “Test+fix for bug 11887 (stg sink)”
  1. 0/2 Test+fix for bug 11887 (stg sink)Karl Hasselström, Jun 29, 2008
  2. 1/2 Try "stg sink" without applied patchesKarl Hasselström, Jun 29, 2008
  3. Sverre RabbelierJun 30, 2008
  4. Karl HasselströmJun 30, 2008
  5. 2/2 Fix "stg sink" with no applied patches (bug 11887)Karl Hasselström, Jun 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.