Skip to content

Commit 943f470

Browse files
committed
improve test readability for self tests under rake.
1 parent 08d09f5 commit 943f470

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/unity_internals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
445445
#endif
446446

447447
/*-------------------------------------------------------
448-
* Internal Structs Needed
448+
* Internal Types Needed
449449
*-------------------------------------------------------*/
450450

451451
typedef void (*UnityTestFunction)(void);

test/rakefile_helper.rb

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,30 @@ def run_tests(test_files)
299299
# Verify outputs seem to have happened
300300
failures = 0
301301
output = output.each_line.map do |line|
302-
if line =~ /Element.*Expected.*Was/ && !(line =~ /Element \d+ Expected \S+ Was \S+/)
303-
failures += 1
304-
line + " [[[[ OUTPUT FAILED TO PRINT CORRECTLY ]]]]"
302+
if (line =~ /Element.*Expected.*Was/)
303+
if !(line =~ /Element \d+ Expected \S+ Was \S+/) &&
304+
!(line =~ /Element \d+ Expected "[^"]+" Was "[^"]+"/)
305+
failures += 1
306+
"[FAIL] " + line
307+
else
308+
"[p ] " + line
309+
end
310+
elsif (line =~ /Expected.*Was/)
311+
if !(line =~ /Expected \S+ Was \S+/) &&
312+
!(line =~ /Expected "[^"]+" Was "[^"]+"/)
313+
failures += 1
314+
"[FAIL] " + line
315+
else
316+
"[p ] " + line
317+
end
318+
elsif (line =~ /:PASS$/)
319+
"[p ] " + line
320+
elsif (line =~ /:FAIL$/)
321+
"[FAIL] " + line
322+
elsif (line =~ /:IGNORE$/)
323+
"[i---] " + line
305324
else
306-
line
325+
"[ ] " + line
307326
end
308327
end.join
309328

0 commit comments

Comments
 (0)