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

Subscribers

People subscribed via source and target branches