Merge lp:~patrick-crews/drizzle-automation/drizzle-automation-lcov17 into lp:drizzle-automation

Proposed by Patrick Crews
Status: Merged
Merged at revision: not available
Proposed branch: lp:~patrick-crews/drizzle-automation/drizzle-automation-lcov17
Merge into: lp:drizzle-automation
Diff against target: 22 lines (+11/-1)
1 file modified
drizzle/automation/lcov/run.py (+11/-1)
To merge this branch: bzr merge lp:~patrick-crews/drizzle-automation/drizzle-automation-lcov17
Reviewer Review Type Date Requested Status
Jay Pipes Approve
Review via email: mp+17423@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Patrick Crews (patrick-crews) wrote :

Added changes to drizzle/automation/lcov/run.py (starting ~line 280) that will add a flag to the genhtml call to add function-level coverage to the generated html reports. Will run as usual otherwise.

Revision history for this message
Jay Pipes (jaypipes) wrote :

Sweet. Merging in now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzle/automation/lcov/run.py'
2--- drizzle/automation/lcov/run.py 2010-01-14 17:33:28 +0000
3+++ drizzle/automation/lcov/run.py 2010-01-14 21:55:17 +0000
4@@ -277,7 +277,17 @@
5 # Produce HTML coverage reports
6 logging.info("Producing LCOV HTML coverage reports.")
7
8- (retcode, output)= commands.getstatusoutput("genhtml -o %s %s" % (output_dir, output_file))
9+ # Check lcov version. If it is >= 1.7, we want to have function-level coverage
10+ # We do a quick check of the version number
11+ # At the time of this code, lcov verno output is of the form: lcov: LCOV version 1.7
12+ lcov_version = float(commands.getoutput("lcov --version").split()[-1])
13+ if lcov_version >= 1.7:
14+ function_string = "--function-coverage"
15+ else:
16+ function_string = ""
17+ genhtml_cmd = "genhtml %s -o %s %s" %(function_string, output_dir, output_file)
18+
19+ (retcode, output)= commands.getstatusoutput(genhtml_cmd)
20 if not retcode == 0:
21 logging.error("Failed to generate LCOV HTML coverage report. Got error %s after running %s" % (output, cmd))
22 sys.exit(1)

Subscribers

People subscribed via source and target branches