From: Phil Sutter Date: Thu, 12 Aug 2021 13:12:30 +0000 (+0200) Subject: tests: xlate-test: Print errors to stderr X-Git-Tag: v1.8.8~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5166c4451fb837e7d5dbb54a7d7cbf2f0c2469cc;p=thirdparty%2Fiptables.git tests: xlate-test: Print errors to stderr Return code is always zero, so grepping for output on stderr is a simple way to detect testsuite failures. Signed-off-by: Phil Sutter --- diff --git a/xlate-test.py b/xlate-test.py index 1fa5eca3..bb7a447d 100755 --- a/xlate-test.py +++ b/xlate-test.py @@ -75,7 +75,7 @@ def run_test(name, payload): if (passed == tests) and not args.test: print(name + ": " + green("OK")) if not test_passed: - print("\n".join(result)) + print("\n".join(result), file=sys.stderr) if args.test: print("1 test file, %d tests, %d tests passed, %d tests failed, %d errors" % (tests, passed, failed, errors)) else: @@ -111,7 +111,7 @@ def main(): with open(args.test, "r") as payload: run_test(args.test, payload) except IOError: - print(red("Error: ") + "test file does not exist") + print(red("Error: ") + "test file does not exist", file=sys.stderr) else: load_test_files()