blob: d28c4d5b365d58e006518e8aab4a1e74210c766e [file] [log] [blame]
mblighb71116b2006-05-17 21:32:55 +00001import test
2from autotest_utils import *
3
4class unixbench(test.test):
5 version = 1
6
7 # http://www.tux.org/pub/tux/niemi/unixbench/unixbench-4.1.0.tgz
8 def setup(self, tarball = 'unixbench-4.1.0.tar.bz2'):
9 tarball = unmap_url(self.bindir, tarball, self.tmpdir)
10 extract_tarball_to_dir(tarball, self.srcdir)
11 os.chdir(self.srcdir)
12
13 system('make')
14
15 def execute(self, iterations = 1, args = ''):
mbligh9f5113d2007-06-25 23:41:10 +000016 vars = 'TMPDIR=\"%s\" RESULTDIR=\"%s\"' % (self.tmpdir, self.resultsdir)
17 profilers = self.job.profilers
18 if not profilers.only():
19 for i in range(iterations):
20 os.chdir(self.srcdir)
21 system(vars + ' ./Run ' + args)
mbligha9991982006-05-25 18:32:43 +000022
23 # Do a profiling run if necessary
mbligha9991982006-05-25 18:32:43 +000024 if profilers.present():
25 profilers.start(self)
26 system(vars + ' ./Run ' + args)
27 profilers.stop(self)
28 profilers.report(self)