[PATCH] D64065: Skip test earlier if metric is not found in compare.py

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 02:43:56 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366999: Skip test earlier if metric is not found in compare.py (authored by fhahn, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64065/new/

https://reviews.llvm.org/D64065

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


Index: test-suite/trunk/utils/compare.py
===================================================================
--- test-suite/trunk/utils/compare.py
+++ test-suite/trunk/utils/compare.py
@@ -32,10 +32,10 @@
         if name in names:
             sys.stderr.write("Error: Multiple tests with name '%s'\n" % name)
             sys.exit(1)
-        names.add(name)
         if "metrics" not in test:
-            print("Warning: '%s' has No metrics!" % test['name'])
+            print("Warning: '%s' has no metrics, skipping!" % test['name'])
             continue
+        names.add(name)
         for name in test["metrics"].keys():
             if name not in columnindexes:
                 columnindexes[name] = len(columns)
@@ -50,15 +50,16 @@
     data = []
     testnames = []
     for test in jsondata['tests']:
+        if "metrics" not in test:
+            continue
         name = test['name']
         if 'shortname' in test:
             name = test['shortname']
         testnames.append(name)
 
         datarow = [nan] * len(columns)
-        if "metrics" in test:
-            for (metricname, value) in test['metrics'].items():
-                datarow[columnindexes[metricname]] = value
+        for (metricname, value) in test['metrics'].items():
+            datarow[columnindexes[metricname]] = value
         for (name, value) in test.items():
             index = columnindexes.get(name)
             if index is not None:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64065.211702.patch
Type: text/x-patch
Size: 1446 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190725/5a791fcd/attachment.bin>


More information about the llvm-commits mailing list