Modify the script to output the regressions and passes into categories. My Python...
authorBill Wendling <isanbard@gmail.com>
Fri, 21 Oct 2011 06:58:01 +0000 (06:58 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 21 Oct 2011 06:58:01 +0000 (06:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142643 91177308-0d34-0410-b5e6-96231b3b80d8

utils/release/findRegressions.py

index d3811a53b70725ca654b543b71bd139314a62651..758623199ff9bc7a39c5a9130ef90f7708de2308 100755 (executable)
@@ -62,6 +62,13 @@ def parse(file):
 
 # Diff results and look for regressions.
 def diffResults(d_old, d_new):
+  regressions = {}
+  passes = {}
+  removed = ''
+
+  for x in ['compile state', 'compile time', 'exec state', 'exec time']:
+    regressions[x] = ''
+    passes[x] = ''
 
   for t in sorted(d_old.keys()) :
     if d_new.has_key(t):
@@ -77,13 +84,13 @@ def diffResults(d_old, d_new):
 
             if d_old[t][x] == 'PASS':
               if d_new[t][x] != 'PASS':
-                print t + " *** REGRESSION (" + x + " now fails)"
+                regressions[x] += t + "\n"
             else:
               if d_new[t][x] == 'PASS':
-                print t + " * NEW PASS (" + x + " now fails)"
+                passes[x] += t + "\n"
 
           else :
-            print t + "*** REGRESSION (" + x + " now fails)"
+            regressions[x] += t + "\n"
 
         if x == 'compile state' or x == 'exec state':
           continue
@@ -92,25 +99,53 @@ def diffResults(d_old, d_new):
         if not d_old[t].has_key(x) and not d_new[t].has_key(x):
           continue
         elif not d_new[t].has_key(x):
-          print t + " *** REGRESSION (" + x + ")"
+          regressions[x] += t + "\n"
         elif not d_old[t].has_key(x):
-          print t + " * NEW PASS (" + x + ")"
+          passes[x] += t + "\n"
 
         if math.isnan(d_old[t][x]) and math.isnan(d_new[t][x]):
           continue
 
         elif math.isnan(d_old[t][x]) and not math.isnan(d_new[t][x]):
-          print t + " * NEW PASS (" + x + ")"
+          passes[x] += t + "\n"
 
         elif not math.isnan(d_old[t][x]) and math.isnan(d_new[t][x]):
-          print t + " *** REGRESSION (" + x + ")"
+          regressions[x] += t + ": NaN%\n"
 
         if d_new[t][x] > d_old[t][x] and d_old[t][x] > 0.0 and \
               (d_new[t][x] - d_old[t][x]) / d_old[t][x] > .05:
-          print t + " *** REGRESSION (" + x + ")"
+          regressions[x] += t + ": " + "{0:.1f}".format(100 * (d_new[t][x] - d_old[t][x]) / d_old[t][x]) + "%\n"
 
     else :
-      print t + ": Removed from test-suite."
+      removed += t + "\n"
+
+  if len(regressions['compile state']) != 0:
+    print 'REGRESSION: Compilation Failed'
+    print regressions['compile state']
+
+  if len(regressions['exec state']) != 0:
+    print 'REGRESSION: Execution Failed'
+    print regressions['exec state']
+
+  if len(regressions['compile time']) != 0:
+    print 'REGRESSION: Compilation Time'
+    print regressions['compile time']
+
+  if len(regressions['exec time']) != 0:
+    print 'REGRESSION: Execution Time'
+    print regressions['exec time']
+
+  if len(passes['compile state']) != 0:
+    print 'NEW PASSES: Compilation'
+    print passes['compile state']
+
+  if len(passes['exec state']) != 0:
+    print 'NEW PASSES: Execution'
+    print passes['exec state']
+
+  if len(removed) != 0:
+    print 'REMOVED TESTS'
+    print removed
 
 # Main
 if len(sys.argv) < 3 :