git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: git@vger.kernel.org
Cc: tboegi@web.de, Jeff King <peff@peff.net>
Subject: [PATCH] test-lint-duplicates: consider only numbered test cases
Date: Wed, 10 Apr 2013 16:22:57 +0200	[thread overview]
Message-ID: <201304101622.58688.tboegi@web.de> (raw)

Running make inside contrib/remote-helpers may fail in "test-lint-duplicates"

This was because the regexp checking for duplicate numbers strips everything
after the first "-" in the filename, including the prefix.

As a result, 2 pathnames like
"xxxx/contrib/remote-helpers/test-XX.sh" and
"xxxx/contrib/remote-helpers/test-YY.sh"

are both converted into
"xxxx/contrib/remote", and reported as duplicate.

Improve the regexp:
- strip the leading path and look only at the basename
- only look at files which have tNNNN- (where N stand for a digit) in the name

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---

http://comments.gmane.org/gmane.comp.version-control.git/214194

 t/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/t/Makefile b/t/Makefile
index 1923cc1..cfd6d5a 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -48,7 +48,9 @@ clean: clean-except-prove-cache
 test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
 
 test-lint-duplicates:
-	@dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
+	@dups=`echo $(T) | tr ' ' '\n' | \
+		sed -e 's,.*/,,' -ne 's|\(.*/\)*t\([0-9][0-9][0-9][0-9]\)-.*|\2|p' | \
+		sort | uniq -d` && \
 		test -z "$$dups" || { \
 		echo >&2 "duplicate test numbers:" $$dups; exit 1; }
 
-- 
1.8.2.282.g4bc7171

             reply	other threads:[~2013-04-10 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 14:22 Torsten Bögershausen [this message]
2013-04-10 16:03 ` [PATCH] test-lint-duplicates: consider only numbered test cases 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=201304101622.58688.tboegi@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --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).