nf7/test/run.c.sh
2023-12-03 11:33:25 +09:00

18 lines
400 B
Bash
Executable File

#!/bin/bash
tests=$(cat ${@//;/ } | sed -e '/^NF7TEST(/!d; s|^NF7TEST(\([^)]*\)).*$|\1|' | xargs echo)
echo "#include \"test/common.h\""
echo "#include \"test/run.h\""
echo
echo
echo "bool nf7test_run(struct nf7test* test) {"
echo " // $tests"
for test in $tests; do
echo " extern bool $test(struct nf7test*);"
echo " test->run(test, \"$test\", $test);"
done
echo " return true;"
echo "}"