Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
13948:69928d77bc0a | 13949:f694daada5bf |
---|---|
1279 mx.logv(x[:-1]) | 1279 mx.logv(x[:-1]) |
1280 mx.log("Building benchmarks...") | 1280 mx.log("Building benchmarks...") |
1281 mx.run(['mvn', 'package'], cwd = jmhPath, out = _blackhole) | 1281 mx.run(['mvn', 'package'], cwd = jmhPath, out = _blackhole) |
1282 | 1282 |
1283 matchedSuites = set() | 1283 matchedSuites = set() |
1284 numBench = [0] | |
1284 for micros in os.listdir(jmhPath): | 1285 for micros in os.listdir(jmhPath): |
1285 absoluteMicro = os.path.join(jmhPath, micros) | 1286 absoluteMicro = os.path.join(jmhPath, micros) |
1286 if not os.path.isdir(absoluteMicro): | 1287 if not os.path.isdir(absoluteMicro): |
1287 continue | 1288 continue |
1288 if not micros.startswith("micros-"): | 1289 if not micros.startswith("micros-"): |
1300 match = False | 1301 match = False |
1301 for b in benchmarks: | 1302 for b in benchmarks: |
1302 match = match or (b in x) | 1303 match = match or (b in x) |
1303 | 1304 |
1304 if match: | 1305 if match: |
1306 numBench[0] += 1 | |
1305 matchedSuites.add(micros) | 1307 matchedSuites.add(micros) |
1306 | 1308 |
1307 | 1309 |
1308 mx.run_java(['-jar', microJar, "-l"], cwd = jmhPath, out = _addBenchmark) | 1310 mx.run_java(['-jar', microJar, "-l"], cwd = jmhPath, out = _addBenchmark) |
1309 else: | 1311 else: |
1310 matchedSuites.add(micros) | 1312 matchedSuites.add(micros) |
1311 | 1313 |
1312 mx.logv("matchedSuites: " + str(matchedSuites)) | 1314 mx.logv("matchedSuites: " + str(matchedSuites)) |
1315 plural = 's' if not benchmarks or numBench[0] > 1 else '' | |
1316 number = str(numBench[0]) if benchmarks else "all" | |
1317 mx.log("Running " + number + " benchmark" + plural + '...') | |
1313 | 1318 |
1314 regex = [] | 1319 regex = [] |
1315 if benchmarks: | 1320 if benchmarks: |
1316 regex.append(r".*(" + "|".join(benchmarks) + ").*") | 1321 regex.append(r".*(" + "|".join(benchmarks) + ").*") |
1317 | 1322 |