git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: [PATCH v2] test suite: add a check that all test numbers are unique
Date: Fri, 21 Aug 2009 15:13:23 +0200	[thread overview]
Message-ID: <4A8E9D73.1090604@viscovery.net> (raw)
In-Reply-To: <20090821125324.GA6280@coredump.intra.peff.net>

Jeff King schrieb:
> Why not the much shorter:
> 
> tests() {
>   ls | sed -n 's/^\(t[0-9][0-9][0-9][0-9]\)-.*\.sh$/\1/p'
> }
> dups=`tests | uniq -d`
> 
> instead of the long shell loop?

Because it's faster on Windows ;-) No, seriously, I didn't know about
uniq -d.

Here is a replacement patch.

--- 8< ---
From: Johannes Sixt <j6t@kdbg.org>
Subject: [PATCH] t/Makefile: add a check that all test numbers are unique

The test runs only if 'make all' is used. Its purpose is to alert our
valued integrator if different branches are merged that happen to
introduce the same test number.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/t/Makefile b/t/Makefile
index bd09390..ed8281a 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -17,6 +17,10 @@ T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
 TSVN = $(wildcard t91[0-9][0-9]-*.sh)

 all: pre-clean
+	@dups=`ls | sed -n 's/^\(t[0-9][0-9][0-9][0-9]\)-.*\.sh$$/\1/p' | \
+			uniq -d` && \
+		test -z "$$dups" || { \
+		echo "duplicate test numbers:" $$dups; exit 1; }
 	$(MAKE) aggregate-results-and-cleanup

 $(T):
-- 
1.6.4.204.g6aad7

  reply	other threads:[~2009-08-21 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21  9:28 [PATCH] test suite: add a check that all test numbers are unique Johannes Sixt
2009-08-21 12:53 ` Jeff King
2009-08-21 13:13   ` Johannes Sixt [this message]
2009-08-21 14:37     ` [PATCH v2] " Jeff King

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=4A8E9D73.1090604@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).