Mercurial > hg > truffle
comparison mx/sanitycheck.py @ 4217:f3271682fe5a
Various small fix around benchmarks in gate scripts
author | Gilles Duboscq <gilles.m.duboscq@gmail.com> |
---|---|
date | Wed, 04 Jan 2012 19:57:51 +0100 |
parents | a2caa019ba3a |
children | 47f7d91d34cf |
comparison
equal
deleted
inserted
replaced
4216:a13d61d3910e | 4217:f3271682fe5a |
---|---|
23 } | 23 } |
24 | 24 |
25 class SanityCheckLevel: | 25 class SanityCheckLevel: |
26 Fast, Gate, Normal, Extensive = range(4) | 26 Fast, Gate, Normal, Extensive = range(4) |
27 | 27 |
28 def getDacapos(level=SanityCheckLevel.Normal, dacapoArgs=None): | 28 def getDacapos(level=SanityCheckLevel.Normal, dacapoArgs=[]): |
29 checks = {} | 29 checks = [] |
30 | 30 |
31 for (bench, ns) in dacapoSanityWarmup.items(): | 31 for (bench, ns) in dacapoSanityWarmup.items(): |
32 if ns[level] > 0: | 32 if ns[level] > 0: |
33 checks[bench] = getDacapo(bench, ns[level], dacapoArgs) | 33 checks.append(getDacapo(bench, ns[level], dacapoArgs)) |
34 | 34 |
35 return checks | 35 return checks |
36 | 36 |
37 def getDacapo(name, n, dacapoArgs=None): | 37 def getDacapo(name, n, dacapoArgs=[]): |
38 dacapo = mx.get_env('DACAPO_CP') | 38 dacapo = mx.get_env('DACAPO_CP') |
39 if dacapo is None: | 39 if dacapo is None: |
40 dacapo = commands._graal_home + r'/lib/dacapo-9.12-bach.jar' | 40 dacapo = commands._graal_home + r'/lib/dacapo-9.12-bach.jar' |
41 | 41 |
42 if not isfile(dacapo) or not dacapo.endswith('.jar'): | 42 if not isfile(dacapo) or not dacapo.endswith('.jar'): |
46 dacapoFail = re.compile(r"^===== DaCapo 9\.12 ([a-zA-Z0-9_]+) FAILED (warmup|) =====$") | 46 dacapoFail = re.compile(r"^===== DaCapo 9\.12 ([a-zA-Z0-9_]+) FAILED (warmup|) =====$") |
47 dacapoTime = re.compile(r"===== DaCapo 9\.12 (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====") | 47 dacapoTime = re.compile(r"===== DaCapo 9\.12 (?P<benchmark>[a-zA-Z0-9_]+) PASSED in (?P<time>[0-9]+) msec =====") |
48 | 48 |
49 dacapoMatcher = Matcher(dacapoTime, {'const:name' : 'benchmark', 'const:score' : 'time'}) | 49 dacapoMatcher = Matcher(dacapoTime, {'const:name' : 'benchmark', 'const:score' : 'time'}) |
50 | 50 |
51 return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], dacapoMatcher, ['-Xms1g', '-Xmx2g', '-XX:MaxPermSize=256m']) | 51 return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms1g', '-Xmx2g', '-XX:MaxPermSize=256m']) |
52 | 52 |
53 class Test: | 53 class Test: |
54 def __init__(self, name, group, cmd, succesREs=None, failureREs=None, scoreMatchers=None, vmOpts=None): | 54 def __init__(self, name, group, cmd, succesREs=[], failureREs=[], scoreMatchers=[], vmOpts=[]): |
55 self.name = name | 55 self.name = name |
56 self.group = group | 56 self.group = group |
57 self.succesREs = succesREs | 57 self.succesREs = succesREs |
58 self.failureREs = failureREs | 58 self.failureREs = failureREs |
59 self.scoreMatchers = scoreMatchers | 59 self.scoreMatchers = scoreMatchers |
60 self.vmOpts = vmOpts | 60 self.vmOpts = vmOpts |
61 self.cmd = cmd | 61 self.cmd = cmd |
62 | 62 |
63 def test(self, vm, cwd=None, opts=None): | 63 def test(self, vm, cwd=None, opts=[]): |
64 parser = OutputParser(nonZeroIsFatal = False) | 64 parser = OutputParser(nonZeroIsFatal = False) |
65 jvmError = re.compile(r"(?P<jvmerror>([A-Z]:|/).*[/\\]hs_err_pid[0-9]+\.log)") | 65 jvmError = re.compile(r"(?P<jvmerror>([A-Z]:|/).*[/\\]hs_err_pid[0-9]+\.log)") |
66 parser.addMatcher(Matcher(jvmError, {'const:jvmError' : 'jvmerror'})) | 66 parser.addMatcher(Matcher(jvmError, {'const:jvmError' : 'jvmerror'})) |
67 | 67 |
68 for succesRE in self.succesREs: | 68 for succesRE in self.succesREs: |
89 if parsed.has_key('failed') and parsed['failed'] is 1: | 89 if parsed.has_key('failed') and parsed['failed'] is 1: |
90 return False | 90 return False |
91 | 91 |
92 return result['retcode'] is 0 and parsed.has_key('passed') and parsed['passed'] is '1' | 92 return result['retcode'] is 0 and parsed.has_key('passed') and parsed['passed'] is '1' |
93 | 93 |
94 def bench(self, vm, cwd=None, opts=None): | 94 def bench(self, vm, cwd=None, opts=[]): |
95 parser = OutputParser(nonZeroIsFatal = False) | 95 parser = OutputParser(nonZeroIsFatal = False) |
96 | 96 |
97 for scoreMatcher in self.scoreMatchers: | 97 for scoreMatcher in self.scoreMatchers: |
98 parser.addMatcher(scoreMatcher) | 98 parser.addMatcher(scoreMatcher) |
99 | 99 |
100 result = parser.parse(self.vmOpts + opts + self.cmd, vm, cwd) | 100 result = parser.parse(vm, self.vmOpts + opts + self.cmd, cwd) |
101 if result['retcode'] is not 0: | |
102 return {} | |
101 | 103 |
102 parsed = result['parsed'] | 104 parsed = result['parsed'] |
103 | 105 |
104 ret = {} | 106 ret = {} |
105 | 107 |