Merge lp:~deeptik/lava-test/gmpbench into lp:lava-test/0.0

Proposed by Deepti B. Kalakeri
Status: Merged
Merged at revision: 37
Proposed branch: lp:~deeptik/lava-test/gmpbench
Merge into: lp:lava-test/0.0
Diff against target: 53 lines (+49/-0)
1 file modified
abrek/test_definitions/gmpbench.py (+49/-0)
To merge this branch: bzr merge lp:~deeptik/lava-test/gmpbench
Reviewer Review Type Date Requested Status
Paul Larson (community) Approve
Deepti B. Kalakeri (community) Needs Resubmitting
Review via email: mp+36841@code.launchpad.net

Description of the change

This patch automates the installation, execution, and parsing of GMPbench test suite. This patch has been tested on Manderick for installation/execution and parsing of results with the latest abrek revision 35.

To post a comment you must log in.
lp:~deeptik/lava-test/gmpbench updated
37. By Deepti B. Kalakeri

Fix typo in the comment

Revision history for this message
Paul Larson (pwlars) wrote :

+RUNSTEPS = ['cd gmpbench-0.2 && PATH=$PATH:. ./runbench ']
> +PATTERN = "\s*(?P<test_case_id>GMPbench\.*\w*\.*\w*):?\s*(?P<result>\d+.\d+)"
> +
> +class GMPParser(abrek.testdef.AbrekTestParser):
> + def parse(self):
> + filename = "testoutput.log"
> + pat = re.compile(self.pattern)
> + with open(filename) as fd:
> + for line in fd:
> + match = pat.match(line)
> + if match:
> + results = match.groupdict()
> + self.results['test_results'].append(results)
> Since this is a performance benchmark, I would expect that you would have a measurement field, and I don't see that here. Also, I don't see where you needed to extend AbrekTestParser yet for this test. It seems that the base class would be sufficient here. Take a look at stream for an example of a performance test.

review: Needs Fixing
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

> +RUNSTEPS = ['cd gmpbench-0.2 && PATH=$PATH:. ./runbench ']
> > +PATTERN =
> "\s*(?P<test_case_id>GMPbench\.*\w*\.*\w*):?\s*(?P<result>\d+.\d+)"
> > +
> > +class GMPParser(abrek.testdef.AbrekTestParser):
> > + def parse(self):
> > + filename = "testoutput.log"
> > + pat = re.compile(self.pattern)
> > + with open(filename) as fd:
> > + for line in fd:
> > + match = pat.match(line)
> > + if match:
> > + results = match.groupdict()
> > + self.results['test_results'].append(results)
> > Since this is a performance benchmark, I would expect that you would have a
> measurement field, and I don't see that here. Also, I don't see where you
> needed to extend AbrekTestParser yet for this test. It seems that the base
> class would be sufficient here. Take a look at stream for an example of a
> performance test.

Yeah!! the AbrekTestParser would do the same work for parsing instead of rewriting my own parse function. Somehow it slipped from my mind. I will use the default parser available. The result field contains the measurement field. I will change the name of the results to measurement so that it makes more sense.

lp:~deeptik/lava-test/gmpbench updated
38. By Deepti B. Kalakeri

Addressing review comments

Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

This patch addresses the review comments and includes the following changes:

1) Removed the parse() function in the file and used the default available in abrek framework.
2) Renamed the parse field from results to measurement to make it more meaningful.

review: Needs Resubmitting
Revision history for this message
Paul Larson (pwlars) wrote :

Please add units and result via appendall as you see in stream. Discussed this with you over email earlier, but wanted to mention it here as well.

lp:~deeptik/lava-test/gmpbench updated
39. By Deepti B. Kalakeri

Adding the results and unit field to the test_results

Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

Added the results and units field to the gmpbench test_results

Revision history for this message
Paul Larson (pwlars) wrote :

28 +import re
unused

Other than that and a few minor whitespace cleanups, it all looks good. I will go ahead and merge. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'abrek/test_definitions/gmpbench.py'
2--- abrek/test_definitions/gmpbench.py 1970-01-01 00:00:00 +0000
3+++ abrek/test_definitions/gmpbench.py 2010-09-29 11:21:18 +0000
4@@ -0,0 +1,49 @@
5+# Copyright (c) 2010 Linaro
6+#
7+# This program is free software: you can redistribute it and/or modify
8+# it under the terms of the GNU General Public License as published by
9+# the Free Software Foundation, either version 3 of the License, or
10+# (at your option) any later version.
11+#
12+# This program is distributed in the hope that it will be useful,
13+# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+# GNU General Public License for more details.
16+#
17+# You should have received a copy of the GNU General Public License
18+# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+#
20+"""
21+ This script automates the automate installation, execution, and
22+ results parsing for the GMPbench test suite.
23+ The GMPbench test Suite is an open source test suite with the goal of
24+ comparing different processors performance against eachother.
25+
26+"""
27+
28+import re
29+
30+import abrek.testdef
31+
32+VERSION='0.2'
33+URL="ftp://ftp.gmplib.org/pub/misc/gmpbench-%s.tar.bz2" %(VERSION)
34+URL_gexpr="http://www.gmplib.org/gexpr.c"
35+DEPS = ['libgmp3-dev', 'wget']
36+
37+INSTALLSTEPS = ['tar -xjf gmpbench-0.2.tar.bz2',
38+ 'wget -c %s' %(URL_gexpr),
39+ 'mv gexpr.c gmpbench-0.2',
40+ 'cd gmpbench-0.2 && gcc -o gexpr gexpr.c -static -lm']
41+
42+RUNSTEPS = ['cd gmpbench-0.2 && PATH=$PATH:. ./runbench ']
43+PATTERN = "\s*(?P<test_case_id>GMPbench\.*\w*\.*\w*):?\s*"\
44+ "(?P<measurement>\d+.\d+)"
45+
46+gmpbenchinst = abrek.testdef.AbrekTestInstaller(INSTALLSTEPS, deps=DEPS,
47+ url=URL)
48+gmpbenchrun = abrek.testdef.AbrekTestRunner(RUNSTEPS)
49+gmpbenchparser = abrek.testdef.AbrekTestParser(PATTERN,
50+ appendall={'units':'operations/s',
51+ 'result':'pass'})
52+testobj = abrek.testdef.AbrekTest(testname="gmpbench", installer=gmpbenchinst,
53+ runner=gmpbenchrun, parser=gmpbenchparser)

Subscribers

People subscribed via source and target branches