diff mx/mx_graal.py @ 13949:f694daada5bf

mx jmh: display the number of benchmarks that will run
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 13 Feb 2014 17:03:20 +0100
parents 69928d77bc0a
children 392b6ac8da36
line wrap: on
line diff
--- a/mx/mx_graal.py	Thu Feb 13 15:39:18 2014 +0100
+++ b/mx/mx_graal.py	Thu Feb 13 17:03:20 2014 +0100
@@ -1281,6 +1281,7 @@
     mx.run(['mvn', 'package'], cwd = jmhPath, out = _blackhole)
 
     matchedSuites = set()
+    numBench = [0]
     for micros in os.listdir(jmhPath):
         absoluteMicro = os.path.join(jmhPath, micros)
         if not os.path.isdir(absoluteMicro):
@@ -1302,6 +1303,7 @@
                     match = match or (b in x)
 
                 if match:
+                    numBench[0] += 1
                     matchedSuites.add(micros)
 
             
@@ -1310,6 +1312,9 @@
             matchedSuites.add(micros)
 
     mx.logv("matchedSuites: " + str(matchedSuites))
+    plural = 's' if not benchmarks or numBench[0] > 1 else ''
+    number = str(numBench[0]) if benchmarks else "all"
+    mx.log("Running " + number + " benchmark" + plural + '...')
 
     regex = []
     if benchmarks: