3 ##########################################################################
4 # Copyright (c) 2009, ETH Zurich.
7 # This file is distributed under the terms in the attached LICENSE file.
8 # If you do not find this file, copies can be found by writing to:
9 # ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
10 ##########################################################################
12 import os, optparse, re
13 import harness, debug, tests
17 p = optparse.OptionParser(usage='Usage: %prog [options] RESULTDIR...',
18 description='Reprocess raw results from scalebench/harness runs')
19 debug.addopts(p, 'debuglevel')
20 options, dirs = p.parse_args()
23 p.error('no result directories specified')
25 # check validity of result dirs
27 if not (os.path.isdir(d) and os.access(d, os.W_OK)
28 and os.access(os.path.join(d, 'description.txt'), os.R_OK)):
29 p.error('invalid results directory %s' % d)
31 debug.current_level = options.debuglevel
37 debug.log('reprocessing %s' % dirname)
38 debug.verbose('parse %s/description.txt for test' % dirname)
39 testname = test = None
40 f = open(os.path.join(dirname, 'description.txt'), 'r')
42 m = re.match(r'test:\s+(.*)', line)
49 debug.error('unable to parse description for %s, skipped' % dirname)
52 debug.verbose('locate test "%s"' % testname)
53 for t in tests.all_tests:
54 if t.name.lower() == testname.lower():
55 test = t(None) # XXX: dummy options
57 debug.error('unknown test "%s" in %s, skipped' % (testname, dirname))
60 debug.verbose('reprocess results')
61 harness.process_results(test, dirname)
63 if __name__ == "__main__":