git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>,
	Don Slutz <Don.Slutz@SierraAtlantic.com>
Subject: Re: [PATCH 1/3] test-lib: tests can have multiple prerequisites
Date: Mon, 26 Apr 2010 21:25:11 -0400	[thread overview]
Message-ID: <20100427012511.GA1844@coredump.intra.peff.net> (raw)
In-Reply-To: <7vpr1liwrk.fsf@alter.siamese.dyndns.org>

On Mon, Apr 26, 2010 at 05:06:55PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I do wonder if it might be less error-prone to have:
> >
> >   test_expect_success PREREQ1 PREREQ2 'desc' 'test'
> >
> > instead of
> >
> >   test_expect_success 'PREREQ1 PREREQ2' 'desc' 'test'
> 
> Spot what is wrong with this:
> 
>         test_expect_success make sure we have the repo '
>                 test -d .git
>         '

To me it's easy to spot, but there is nothing wrong with it that the
shell will spot, so that is a downside. Whatever we go with, it would
perhaps be less error prone to set "NOPREREQ1" when we don't have
PREREQ1, and check that either $1 or NO$1 is set when checking
prerequisites. But that is probably just over-engineering. This is not
an error we have seen a lot of, and it is not that hard to spot with
code review.

-Peff

  reply	other threads:[~2010-04-27  1:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 13:12 [PATCH 0/3] running tests as fakeroot Jonathan Nieder
2010-04-21 13:38 ` [PATCH 1/3] test-lib: tests can have multiple prerequisites Jonathan Nieder
2010-04-21 14:57   ` Jonathan Nieder
2010-04-26 19:17   ` Jeff King
2010-04-27  0:06     ` Junio C Hamano
2010-04-27  1:25       ` Jeff King [this message]
2010-04-21 13:44 ` [PATCH 2/3] t1004 (read-tree): the unremovable symlink test requires POSIXPERM Jonathan Nieder
2010-04-21 14:20 ` [PATCH 3/3] Permit tests to be run as a (fake) root user Jonathan Nieder

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=20100427012511.GA1844@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Don.Slutz@SierraAtlantic.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jrnieder@gmail.com \
    /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).