From 3dbfdabe01f24ca6cb24b03b96b02aab8dadbbb8 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 30 Nov 2020 16:18:01 +0100 Subject: [PATCH] tests: Translate skips into error code 77 This makes the meson output nicer, as it will correctly display that the test has been skipped. It only happens if all tests in the run were skipped, but meson always does one test a time. --- tests/fprintd.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/fprintd.py b/tests/fprintd.py index 8efa6f4..1ff5c4f 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -1485,4 +1485,12 @@ if __name__ == '__main__': print("%s %s" % (machine, human), end="\n") sys.exit(0) - unittest.main(verbosity=2) + prog = unittest.main(verbosity=2, exit=False) + if prog.result.errors or prog.result.failures: + sys.exit(1) + + # Translate to skip error + if prog.result.testsRun == len(prog.result.skipped): + sys.exit(77) + + sys.exit(0)