diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2012-11-30 00:22:13 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2012-11-30 00:22:13 -0800 |
commit | 0ff2ec602863b13b05a693dbf17bc1d53d2ebba7 (patch) | |
tree | e7fc1aeffdcb29293958578653bd98d35b434a2b | |
parent | 49e088c9bd3bfce1b2a2ba4a41d376e988333c5a (diff) |
report: support intersection of test sets rather than union, optionally.
-rwxr-xr-x | programs/report.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/programs/report.py b/programs/report.py index a7bce2c..9c8c5f9 100755 --- a/programs/report.py +++ b/programs/report.py @@ -198,16 +198,17 @@ def writeSummaryHtml(run_names, results, reportDir): ##### Main program ############################################################################# -def getCombinedResults(db, run_names): +def getCombinedResults(db, run_names, intersect): # Sadly, SQLite can't do full outer joins, so we have to query the results # for each run individually and reassemble them here. individual_results = dict([(run, db.getResults(run)) for run in run_names]) # Get a set containing all test names (in slash-separated form). # Some runs may have more tests than others; take the union. - test_names = set() - for run in run_names: - test_names |= set(individual_results[run].keys()) + if intersect: + test_names = set.intersection(*[set(individual_results[run].keys()) for run in run_names]) + else: + test_names = set.union(*[set(individual_results[run].keys()) for run in run_names]) results = {} for test in test_names: @@ -222,6 +223,9 @@ def parseArguments(argv, config): p = ArgumentParser(prog='robyn report', description='A GPU test runner') p.add_argument('-o', '--output', default='summary', metavar='<directory to write HTML reports to>') + p.add_argument('-i', '--intersect', default=False, action='store_true', + help='Take the intersection of the test sets rather than the union.') + p.add_argument('runs', nargs='+', metavar='<run name>') # XXX: alternate database (pending refactoring) @@ -238,7 +242,7 @@ def main(argv, config): run_names = list(args.runs) - results = getCombinedResults(db, run_names) + results = getCombinedResults(db, run_names, args.intersect) # XXX: write detail pages |