From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Joachim Schmitz <jojo@schmitz-digital.de>
Subject: Re: [PATCH 1/4] t3419-rebase-patch-id: heed USR_BIN_TIME prereq
Date: Tue, 16 Oct 2012 09:32:03 -0700 [thread overview]
Message-ID: <7vd30itm2k.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <b04898886f0c7ed9d943aef0ce6e047f10c97d76.1350387132.git.git@drmicha.warpmail.net> (Michael J. Gruber's message of "Tue, 16 Oct 2012 13:39:44 +0200")
Michael J Gruber <git@drmicha.warpmail.net> writes:
> t3419 sets the t3419-rebase-patch-id.sh prereq based on the availability
> of /usr/bin/time but calls the binary unconditionally (in debug mode).
>
> Make it run the timing only when the prereq is matched.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
I do not think we should ship our tests with too many test_debug in
the first place (it is something you as a developer who are trying
to figure out why your change broke tests can insert into tests).
It might be useful to be able to say "sh ./t1234-*.sh -d" and see
debug output that somebody else thought that it might be useful, so
I wouldn't say we should remove all existing test_debug, but at the
same time, if a developer finds existing test_debug does not work
for him (either what the debug output gives him is insufficient for
his needs, or what the debug command uses is not available on his
system), he should be willing to update (and capable of doing so) it
to suit his needs. Adding prereq in front of test_debug is simply
an act of insanity.
For this particular one, I think this should suffice. If the shell
does not have "time" built-in, then timeme can be set to even an
empty string, but that is left as an exercise to the readers.
t/t3419-rebase-patch-id.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git i/t/t3419-rebase-patch-id.sh w/t/t3419-rebase-patch-id.sh
index e70ac10..bf2736a 100755
--- i/t/t3419-rebase-patch-id.sh
+++ w/t/t3419-rebase-patch-id.sh
@@ -6,7 +6,11 @@ test_description='git rebase - test patch id computation'
test_set_prereq NOT_EXPENSIVE
test -n "$GIT_PATCHID_TIMING_TESTS" && test_set_prereq EXPENSIVE
-test -x /usr/bin/time && test_set_prereq USR_BIN_TIME
+if test -x /usr/bin/time
+ timeme=/usr/bin/time
+else
+ timeme=time
+fi
count()
{
@@ -35,7 +39,7 @@ scramble()
run()
{
echo \$ "$@"
- /usr/bin/time "$@" >/dev/null
+ $timeme "$@" >/dev/null
}
test_expect_success 'setup' '
next prev parent reply other threads:[~2012-10-16 16:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 10:56 t3302-notes-index-expensive.sh and t3419-rebase-patch-id.sh need time in /usr/bin Joachim Schmitz
2012-10-16 11:39 ` [PATCH 0/4] Allow different time commands Michael J Gruber
2012-10-16 11:39 ` [PATCH 1/4] t3419-rebase-patch-id: heed USR_BIN_TIME prereq Michael J Gruber
2012-10-16 16:32 ` Junio C Hamano [this message]
2012-10-16 11:39 ` [PATCH 2/4] test-lib: allow variable export from lazy prereq tests Michael J Gruber
2012-10-16 16:16 ` Junio C Hamano
2012-10-16 11:39 ` [RFC/PATCH 3/4] test-lib: provide lazy TIME_COMMAND prereq Michael J Gruber
2012-10-16 14:13 ` Joachim Schmitz
2012-10-16 15:06 ` Michael J Gruber
2012-10-16 15:11 ` Joachim Schmitz
2012-10-16 15:07 ` [RFC/PATCH 3/4v2] " Michael J Gruber
2012-10-16 16:28 ` Andreas Schwab
2012-10-16 18:28 ` Stefano Lattarini
2012-10-16 19:21 ` Johannes Sixt
2012-10-16 19:34 ` Junio C Hamano
2012-10-16 16:41 ` [RFC/PATCH 3/4] " Junio C Hamano
2012-10-16 11:39 ` [PATCH 4/4] t3302,t3419: use the " Michael J Gruber
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=7vd30itm2k.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=jojo@schmitz-digital.de \
/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).