mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-29 03:04:27 +01:00
Add line numbers to Unity test Runner generated by awk script
This commit is contained in:
@@ -37,12 +37,13 @@ test: $(BUILD_DIR)/testunityRunner.c
|
|||||||
$(BUILD_DIR)/testunityRunner.c: tests/testunity.c | $(BUILD_DIR)
|
$(BUILD_DIR)/testunityRunner.c: tests/testunity.c | $(BUILD_DIR)
|
||||||
awk $(AWK_SCRIPT) tests/testunity.c > $@
|
awk $(AWK_SCRIPT) tests/testunity.c > $@
|
||||||
|
|
||||||
AWK_SCRIPT='/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0 } \
|
AWK_SCRIPT=\
|
||||||
END{ print "\#include \"unity.h\" //Autogenerated by awk in Makefile" ; \
|
'/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0; line[u++]=NR } \
|
||||||
for (i=0; i<d; i++) { print declarations[i] ";" } \
|
END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ; \
|
||||||
printf "int main()\n{\n UNITY_BEGIN();\n" ; \
|
for (i=0; i<d; i++) { print declarations[i] ";" } \
|
||||||
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ");" } \
|
printf "int main(void)\n{\n UNITY_BEGIN();\n" ; \
|
||||||
printf " return UNITY_END();\n}\n" }'
|
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ", " line[i] ");" } \
|
||||||
|
printf " return UNITY_END();\n}\n" }'
|
||||||
|
|
||||||
$(BUILD_DIR):
|
$(BUILD_DIR):
|
||||||
mkdir -p $(BUILD_DIR)
|
mkdir -p $(BUILD_DIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user