From 943f4706eed8221827937b8373c3f6de24c1a2ee Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Thu, 12 Mar 2026 12:40:49 -0400 Subject: [PATCH] improve test readability for self tests under rake. --- src/unity_internals.h | 2 +- test/rakefile_helper.rb | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/unity_internals.h b/src/unity_internals.h index 80143b0..0ea22fb 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -445,7 +445,7 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT; #endif /*------------------------------------------------------- - * Internal Structs Needed + * Internal Types Needed *-------------------------------------------------------*/ typedef void (*UnityTestFunction)(void); diff --git a/test/rakefile_helper.rb b/test/rakefile_helper.rb index a870fe6..0938505 100644 --- a/test/rakefile_helper.rb +++ b/test/rakefile_helper.rb @@ -299,11 +299,30 @@ module RakefileHelpers # Verify outputs seem to have happened failures = 0 output = output.each_line.map do |line| - if line =~ /Element.*Expected.*Was/ && !(line =~ /Element \d+ Expected \S+ Was \S+/) - failures += 1 - line + " [[[[ OUTPUT FAILED TO PRINT CORRECTLY ]]]]" + if (line =~ /Element.*Expected.*Was/) + if !(line =~ /Element \d+ Expected \S+ Was \S+/) && + !(line =~ /Element \d+ Expected "[^"]+" Was "[^"]+"/) + failures += 1 + "[FAIL] " + line + else + "[p ] " + line + end + elsif (line =~ /Expected.*Was/) + if !(line =~ /Expected \S+ Was \S+/) && + !(line =~ /Expected "[^"]+" Was "[^"]+"/) + failures += 1 + "[FAIL] " + line + else + "[p ] " + line + end + elsif (line =~ /:PASS$/) + "[p ] " + line + elsif (line =~ /:FAIL$/) + "[FAIL] " + line + elsif (line =~ /:IGNORE$/) + "[i---] " + line else - line + "[ ] " + line end end.join