From: "Lars Hjemli" <hjemli@gmail.com>
To: "Brian Gernhardt" <benji@silverinsanity.com>
Cc: "Morten Welinder" <mwelinder@gmail.com>,
git@vger.kernel.org, spearce@spearce.org
Subject: Re: [PATCH] Use exit 1 instead of die when req_Root fails.
Date: Wed, 17 Oct 2007 21:27:26 +0200 [thread overview]
Message-ID: <8c5c35580710171227o45c6b113ve10f293a4505bab5@mail.gmail.com> (raw)
In-Reply-To: <8B2F7666-DCEB-4D58-ACFE-F40587CD415D@silverinsanity.com>
On 10/17/07, Brian Gernhardt <benji@silverinsanity.com> wrote:
> I wish I got this much attention the first time I tried to get this
> problem fixed. ;-)
>
> On Oct 17, 2007, at 11:39 AM, Lars Hjemli wrote:
>
> > This makes me wonder: what about all the other instances of die() in
> > git-cvsserver? Or in any of the other perl scripts, for that matter?
> > Should they all be fixed, or is it this particular test that is wrong?
>
> The reason this comes up is because t/test-lib.sh:test_expect_failure
> () thinks codes > 128 (or negative values if you want to look at it
> that way) are bad tests. I believe this is because many shells use
> these codes to indicate things like "command not found" or other
> probably unexpected failures.
>
> Other than that, does it matter what die() returns, as long as it's
> non-zero?
My point exactly ;-)
If the test is changed to use 'test_expect_success' in the same way as
'req_Root failure (relative pathname)' does it, the test no longer
depends on the exact exit-code returned by die().
IMHO this is much better future-proofing than replacing die() with
print()/exit 1 whenever one of these tests fails.
--
larsh
next prev parent reply other threads:[~2007-10-17 19:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-17 14:05 [PATCH] Use exit 1 instead of die when req_Root fails Brian Gernhardt
2007-10-17 14:39 ` Morten Welinder
2007-10-17 15:16 ` Brian Gernhardt
2007-10-17 15:39 ` Lars Hjemli
2007-10-17 18:40 ` Brian Gernhardt
2007-10-17 19:27 ` Lars Hjemli [this message]
2007-10-18 18:54 ` Jan Hudec
2007-10-17 19:08 ` Frank Lichtenheld
2007-10-17 19:06 ` Frank Lichtenheld
2007-10-17 19:15 ` Brian Gernhardt
2007-10-18 5:04 ` Shawn O. Pearce
2007-10-18 13:33 ` Frank Lichtenheld
-- strict thread matches above, loose matches on Subject: below --
2007-10-04 1:19 git-cvsserver test failures (still) Frank Lichtenheld
2007-10-04 1:43 ` [PATCH] Use exit 1 instead of die when req_Root fails Brian Gernhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c5c35580710171227o45c6b113ve10f293a4505bab5@mail.gmail.com \
--to=hjemli@gmail.com \
--cc=benji@silverinsanity.com \
--cc=git@vger.kernel.org \
--cc=mwelinder@gmail.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).