
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>
20 lines
344 B
Bash
Executable File
20 lines
344 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if test $# -lt 2
|
|
then
|
|
echo "USAGE: $0 <OUTPUT> <SUITE>..." 2>&1
|
|
exit 1
|
|
fi
|
|
|
|
OUTPUT="$1"
|
|
shift
|
|
|
|
for suite in "$@"
|
|
do
|
|
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"
|