From 49d39c4ede45742f27a7f6306e714ae4b2d5cc21 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 13 Jul 2018 16:08:48 +1000 Subject: [PATCH] json/compare: change to useful exit codes in test suite --- test/json/compare.py.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/json/compare.py.in b/test/json/compare.py.in index 4119c9c4..6fbd12e2 100755 --- a/test/json/compare.py.in +++ b/test/json/compare.py.in @@ -8,6 +8,8 @@ tool="@CMAKE_CURRENT_BINARY_DIR@/json-compare" src="@CMAKE_CURRENT_SOURCE_DIR@/test/json/compare" suffix=".a.json" +failures = 0 + for expected in [ "good", "bad" ]: for path in glob(f"{src}/{expected}/*{suffix}"): base = path[:-len(suffix)] @@ -17,5 +19,12 @@ for expected in [ "good", "bad" ]: success = (expected == "good") == (code == 0) - prefix = "not " if not success else "" + prefix = "" + + if not success: + prefix = "not " + failures += 1 + print(prefix, "ok - ", expected, basename(base), code) + +exit(1 if failures else 0)