git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] test-lint-duplicates: Only check for numbered test cases

From
Torsten Bögershausen <tboegi@web.de>
Date
Apr 3, 2013, 05:54 UTC
Message-ID
<201304030754.03100.tboegi@web.de>
Running make inside contrib/remote-helpers fails 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-bzr.sh" and "xxxx/contrib/remote-helpers/test-hg-bidi.sh"

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

Improve the regexp: Remove everything after tNNNN- (where X stand for a digit)

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 t/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/Makefile b/t/Makefile
index 1923cc1..f123d02 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -48,7 +48,7 @@ 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 -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.411.g65a544e
Next: Jeff King
Message 1 of 4 in “test-lint-duplicates: Only check for numbered test cases”
  1. test-lint-duplicates: Only check for numbered test casesTorsten Bögershausen, Apr 3, 2013
  2. Jeff KingApr 3, 2013
  3. Torsten BögershausenApr 10, 2013
  4. Jeff KingApr 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.