提交 113f2fc3 编写于 作者: J jsalling

Add line numbers to Unity test Runner generated by awk script

上级 daad2bc8
......@@ -37,12 +37,13 @@ test: $(BUILD_DIR)/testunityRunner.c
$(BUILD_DIR)/testunityRunner.c: tests/testunity.c | $(BUILD_DIR)
awk $(AWK_SCRIPT) tests/testunity.c > $@
AWK_SCRIPT='/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0 } \
END{ print "\#include \"unity.h\" //Autogenerated by awk in Makefile" ; \
for (i=0; i<d; i++) { print declarations[i] ";" } \
printf "int main()\n{\n UNITY_BEGIN();\n" ; \
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ");" } \
printf " return UNITY_END();\n}\n" }'
AWK_SCRIPT=\
'/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0; line[u++]=NR } \
END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ; \
for (i=0; i<d; i++) { print declarations[i] ";" } \
printf "int main(void)\n{\n UNITY_BEGIN();\n" ; \
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ", " line[i] ");" } \
printf " return UNITY_END();\n}\n" }'
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册