[LNT] r306729 - Make a nice error message when we don't parse the test-suite json

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 12:24:50 PDT 2017


Author: cmatthews
Date: Thu Jun 29 12:24:50 2017
New Revision: 306729

URL: http://llvm.org/viewvc/llvm-project?rev=306729&view=rev
Log:
Make a nice error message when we don't parse the test-suite json

Modified:
    lnt/trunk/lnt/tests/test_suite.py

Modified: lnt/trunk/lnt/tests/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/test_suite.py?rev=306729&r1=306728&r2=306729&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Thu Jun 29 12:24:50 2017
@@ -728,7 +728,11 @@ class TestSuiteTest(BuiltinTest):
             # LIT is expected to exit with code 1 if there were test
             # failures!
             pass
-        return json.loads(open(output_json_path.name).read())
+        try:
+            return json.loads(open(output_json_path.name).read())
+        except ValueError as e:
+            fatal("Running test-suite did not create valid json report in {}: {}".format(
+                output_json_path.name, e.message))
 
     def _is_pass_code(self, code):
         return code in ('PASS', 'XPASS', 'XFAIL')




More information about the llvm-commits mailing list