Skip to content

TAP: some further cleanups

I was about to repush these fixes to !3140 (merged) but it went in (thanks!), so here's a new MR with few improvements.

The main one is to actually to have some better output when a test fails, so we have:

TAP version 13
# random seed: R02Sb24a47092712c11042c6c90f63b57bff
1..2
not ok /error - GLib-FATAL-ERROR: This should error out Because it's just wrong!
Bail out!

Instead of

TAP version 13
# random seed: R02S056d4f019e49cf26648b3ae014dceaff
1..2
Bail out! GLib-FATAL-ERROR: This should error out Because it's just wrong!

Making it very hard to understand what sub-test failed without looking at the logs.


Which reflects in meson output to be:

▶ 1/2 /tap/print                    OK            
▶ 1/2 /tap/subtest/error            OK            
▶ 1/2 /tap/subtest/error-and-pass - testing:ERROR:../../glib/glib/tests/testing.c:2818:test_tap_subtest_error_and_pass: assertion failed (interesting_lines == TAP_SUBTEST_PREFIX "not ok /error - GLib-FATAL-ERROR: This should error out " "Because it's just wrong!\n" TAP_SUBTEST_PREFIX "Bail oust!\n"): (" FAIL          
▶ 1/2                               ERROR         
1/2 glib:glib+core / testing        ERROR           1.76s   killed by signal 6 SIGABRT

While in the past we'd get:

▶ 1/2 /tap/print                    OK            
▶ 1/2 testing:ERROR:../../glib/glib/tests/testing.c:2679:test_tap_error: assertion failed (interesting_lines == "not ok /error - GLib-FATAL-ERROR: This should error out " "Because it's just wrong!\n" "Bail out!\n"): ("Bail out! GLib-FATAL-ERROR: This should error out Because it's just wrong!\n" == "not ok /error - GLib-FATAL-ERROR: This should error out Because it's just wrong!\nBail out!\n") ERROR         
1/2 glib:glib+core / testing        ERROR           1.06s   killed by signal 6 SIGABRT

Merge request reports