Skip to content

Commit c081e73

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 23eeee0 commit c081e73

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,8 +1344,8 @@ THIRD_PARTY_SOURCES += sha1dc/%
13441344
THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/%
13451345
THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/clar/%
13461346

1347-
CLAR_TEST_SUITES += ctype
1348-
CLAR_TEST_SUITES += strvec
1347+
CLAR_TEST_SUITES += u-ctype
1348+
CLAR_TEST_SUITES += u-strvec
13491349
CLAR_TEST_PROG = $(UNIT_TEST_BIN)/unit-tests$(X)
13501350
CLAR_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(CLAR_TEST_SUITES))
13511351
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/clar/clar.o

t/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
clar_test_suites = [
2-
'unit-tests/ctype.c',
3-
'unit-tests/strvec.c',
2+
'unit-tests/u-ctype.c',
3+
'unit-tests/u-strvec.c',
44
]
55

66
clar_sources = [

t/unit-tests/generate-clar-decls.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ shift
1111

1212
for suite in "$@"
1313
do
14-
sed -ne "s/^\(void test_$(basename "${suite%.c}")__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" ||
14+
suite_name=$(basename "$suite")
15+
suite_name=${suite_name%.c}
16+
suite_name=${suite_name#u-}
17+
sed -ne "s/^\(void test_${suite_name}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" ||
1518
exit 1
1619
done >"$OUTPUT"
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)