From 113f2fc32a2a96dcba65275601ff6d4f7d74c76b Mon Sep 17 00:00:00 2001 From: jsalling Date: Wed, 27 Apr 2016 23:38:43 -0500 Subject: [PATCH 1/2] Add line numbers to Unity test Runner generated by awk script --- test/Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/Makefile b/test/Makefile index b0c4d2c..2d6ba23 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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 Date: Wed, 27 Apr 2016 23:40:47 -0500 Subject: [PATCH 2/2] Make testunity.c printing uniform during failure, delete word "Previous" --- test/tests/testunity.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/tests/testunity.c b/test/tests/testunity.c index 830dc57..a796704 100644 --- a/test/tests/testunity.c +++ b/test/tests/testunity.c @@ -30,7 +30,7 @@ static const _UD d_zero = 0.0; UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ UNITY_OUTPUT_CHAR(':'); \ UnityPrint(Unity.CurrentTestName); \ - UnityPrint("[[[[ Previous Test Should Have Failed But Did Not ]]]]"); \ + UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]"); \ UNITY_OUTPUT_CHAR('\n'); \ } @@ -40,7 +40,10 @@ static const _UD d_zero = 0.0; Unity.CurrentTestIgnored = 0; \ if (Unity.CurrentTestFailed == 1) { \ SetToOneMeanWeAlreadyCheckedThisGuy = 1; \ - UnityPrint("[[[[ Previous Test Should Have Ignored But Did Not ]]]]"); \ + UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \ + UNITY_OUTPUT_CHAR(':'); \ + UnityPrint(Unity.CurrentTestName); \ + UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]"); \ UNITY_OUTPUT_CHAR('\n'); \ } @@ -59,7 +62,7 @@ void tearDown(void) TEST_FAIL_MESSAGE("<= Failed in tearDown"); if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) { - UnityPrint("[[[[ Previous Test Should Have Passed But Did Not ]]]]"); + UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]"); UNITY_OUTPUT_CHAR('\n'); } }