[test-suite] r291931 - utils/compare.py: Print understandable error message when files have the wrong format

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 10:36:16 PST 2017


Author: matze
Date: Fri Jan 13 12:36:16 2017
New Revision: 291931

URL: http://llvm.org/viewvc/llvm-project?rev=291931&view=rev
Log:
utils/compare.py: Print understandable error message when files have the wrong format

Modified:
    test-suite/trunk/utils/compare.py

Modified: test-suite/trunk/utils/compare.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/utils/compare.py?rev=291931&r1=291930&r2=291931&view=diff
==============================================================================
--- test-suite/trunk/utils/compare.py (original)
+++ test-suite/trunk/utils/compare.py Fri Jan 13 12:36:16 2017
@@ -17,6 +17,9 @@ def read_lit_json(filename):
     columns = []
     columnindexes = {}
     info_columns = ['hash']
+    if 'tests' not in jsondata:
+        print "%s: Could not find toplevel 'tests' key"
+        sys.exit(1)
     for test in jsondata['tests']:
         if "name" not in test:
             print "Skipping unnamed test!"




More information about the llvm-commits mailing list