From: Jonathan Nieder <jrnieder@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] test-lib: Multi-prereq support only checked the last prereq
Date: Tue, 10 Aug 2010 20:43:25 -0500 [thread overview]
Message-ID: <20100811014325.GA4169@burratino> (raw)
In-Reply-To: <1281482511-2461-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason wrote:
> The clever for-loop (which I blindly copied from Junio)
You did not copy his “return” statement, though. :)
> +++ b/t/test-lib.sh
> @@ -337,15 +337,30 @@ test_have_prereq () {
> IFS=,
> set -- $*
> IFS=$save_IFS
> +
> + total_prereq=0
> + ok_prereq=0
> + missing_prereq=
> +
> for prerequisite
> do
> + total_prereq=$(($total_prereq + 1))
> case $satisfied in
> *" $prerequisite "*)
> - : yes, have it ;;
> + ok_prereq=$(($ok_prereq + 1))
> + ;;
> *)
> - ! : nope ;;
> + # Keep a list of missing prerequisites
> + if test -z "$missing_prereq"
> + then
> + missing_prereq=$prerequisite
> + else
> + missing_prereq="$prerequisite,$missing_prereq"
> + fi
> esac
> done
> +
> + test $total_prereq = $ok_prereq
> }
Wouldn’t
- ! : nope ;;
+ return 1 ;;
be simpler?
This and a small cleanup, including a test that catches this, are at
http://thread.gmane.org/gmane.comp.version-control.git/152814/focus=152875
Hope that helps,
Jonathan
next prev parent reply other threads:[~2010-08-11 1:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 23:21 [PATCH] test-lib: Multi-prereq support only checked the last prereq Ævar Arnfjörð Bjarmason
2010-08-11 1:43 ` Jonathan Nieder [this message]
2010-08-11 12:04 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2010-08-13 20:28 ` Johannes Sixt
2010-08-24 7:34 ` [PATCH] tests: simplify "missing PREREQ" message Jonathan Nieder
2010-08-24 10:16 ` Johannes Sixt
2010-08-24 19:01 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100811014325.GA4169@burratino \
--to=jrnieder@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).