Git fork

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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
c081e734 23eeee08

+8 -5
+2 -2
Makefile
··· 1344 1344 THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/% 1345 1345 THIRD_PARTY_SOURCES += $(UNIT_TEST_DIR)/clar/clar/% 1346 1346 1347 - CLAR_TEST_SUITES += ctype 1348 - CLAR_TEST_SUITES += strvec 1347 + CLAR_TEST_SUITES += u-ctype 1348 + CLAR_TEST_SUITES += u-strvec 1349 1349 CLAR_TEST_PROG = $(UNIT_TEST_BIN)/unit-tests$(X) 1350 1350 CLAR_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(CLAR_TEST_SUITES)) 1351 1351 CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/clar/clar.o
+2 -2
t/meson.build
··· 1 1 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', 4 4 ] 5 5 6 6 clar_sources = [
t/unit-tests/ctype.c t/unit-tests/u-ctype.c
+4 -1
t/unit-tests/generate-clar-decls.sh
··· 11 11 12 12 for suite in "$@" 13 13 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" || 15 18 exit 1 16 19 done >"$OUTPUT"
t/unit-tests/strvec.c t/unit-tests/u-strvec.c