tests: support notifying that a test skipped itself
In addition to printing a message of the form "due to foo, skipping",
detect a return code of 77 as indicating a test skip and report it as
such.
This is the "GNU exitcode protocol" for test reporting, as used by
automake:
https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html
as well as Meson:
https://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors
Hence, it makes for a decent "existing practice" to follow.
Also, in the presence of a dedicated environment variable indicating
that the GNU exitcode protocol is expected, make the test harness bubble
up that return code. This cannot happen by default, because when running
the test harness as a simple Makefile rule, make itself will not know
what to do with such an error code... but if it is ever run via another
testing tool the skip status may be programmatically wanted.
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
1 file changed