git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: <git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] test-lib: save test counts across invocations
Date: Thu, 01 Sep 2011 09:14:26 -0700	[thread overview]
Message-ID: <7v62lcxmsd.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <8fe5381a6b69079b8c20452fd4d99a128764dd52.1314882443.git.trast@student.ethz.ch> (Thomas Rast's message of "Thu, 1 Sep 2011 15:08:45 +0200")

Thomas Rast <trast@student.ethz.ch> writes:

> Save the number of tests run ($test_count) in a file under
> test-counts/.  Then when sourcing test-lib.sh the next time, compare
> the timestamps.

... which is this logic ...

> +test_count_file="$TEST_DIRECTORY"/test-counts/$(basename "$0" .sh)
> +test_count_saved=$(
> +	if [ -n "$test_disable_saved_count" ]; then
> +		:
> +	# the saved count is only valid if the file is newer than the test
> +	elif [ -f "$test_count_file" -a "$test_count_file" -nt "$0" ]; then
> +		cat "$test_count_file" 2>/dev/null
> +	fi
> +	# otherwise we leave the variable empty
> +)

I think the patch is cute, but I however do not think this is sufficient
to catch prerequisite changes, unfortunately. I'd rather leave the total
unknown than giving incorrect numbers.

  reply	other threads:[~2011-09-01 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 13:08 [PATCH] test-lib: save test counts across invocations Thomas Rast
2011-09-01 16:14 ` Junio C Hamano [this message]
2011-09-01 16:38 ` Jeff King
2011-09-01 18:38   ` Alex Vandiver
2011-09-01 18:45     ` Jeff King
2011-09-02 12:39   ` Thomas Rast

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=7v62lcxmsd.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=trast@student.ethz.ch \
    /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).