aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-13 11:41:18 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-13 06:48:46 -0800
commitc081e7340f5545342f80e77f4578851d77dc9cf6 (patch)
treec00c0631e196f124b95660f8cd994087cae8c15c /t/unit-tests
parent23eeee08d6a22de197b17e791508ddcb3a953dc7 (diff)
downloadgit-c081e7340f5545342f80e77f4578851d77dc9cf6.tar.gz
t/unit-tests: rename clar-based unit tests to have a common prefix
All of the code files for unit tests using the self-grown unit testing framework have a "t-" prefix to their name. This makes it easy to identify them and use globbing in our Makefile and in other places. On the other hand though, our clar-based unit tests have no prefix at all and thus cannot easily be discerned from other files in the unit test directory. Introduce a new "u-" prefix for clar-based unit tests. This prefix will be used in a subsequent commit to easily identify such tests. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
-rwxr-xr-xt/unit-tests/generate-clar-decls.sh5
-rw-r--r--t/unit-tests/u-ctype.c (renamed from t/unit-tests/ctype.c)0
-rw-r--r--t/unit-tests/u-strvec.c (renamed from t/unit-tests/strvec.c)0
3 files changed, 4 insertions, 1 deletions
diff --git a/t/unit-tests/generate-clar-decls.sh b/t/unit-tests/generate-clar-decls.sh
index 688e0885f4..3b315c64b3 100755
--- a/t/unit-tests/generate-clar-decls.sh
+++ b/t/unit-tests/generate-clar-decls.sh
@@ -11,6 +11,9 @@ shift
for suite in "$@"
do
- sed -ne "s/^\(void test_$(basename "${suite%.c}")__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" ||
+ suite_name=$(basename "$suite")
+ suite_name=${suite_name%.c}
+ suite_name=${suite_name#u-}
+ sed -ne "s/^\(void test_${suite_name}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" ||
exit 1
done >"$OUTPUT"
diff --git a/t/unit-tests/ctype.c b/t/unit-tests/u-ctype.c
index 32e65867cd..32e65867cd 100644
--- a/t/unit-tests/ctype.c
+++ b/t/unit-tests/u-ctype.c
diff --git a/t/unit-tests/strvec.c b/t/unit-tests/u-strvec.c
index 855b602337..855b602337 100644
--- a/t/unit-tests/strvec.c
+++ b/t/unit-tests/u-strvec.c