tests: Various fixes for TAP output of tests

Merged Philip Withnall requested to merge pwithnall/glib:test-suite-fixes into main

See the commit messages for details.

Predominantly, this enables protocol: tap in our Meson test() calls, which exposes information about tests within each test program to Meson.

As a side effect, I’ve fixed a few bugs in the unit tests which I found while working through this.

Edit: I’ve updated this MR to just fix the bugs I found in the unit tests. It doesn’t enable protocol: tap in the tests yet because that requires more thought about logging of debug messages. I’ll do that in another MR once I’ve worked it out. The fixes here are still applicable though.

Edited by Philip Withnall

Merge request reports