autorun_post: use absolute paths for lcov

Ubuntu LTS 16.04 has lcov 1.12 which is bugged: when
using relative paths for -a and -o lcov parameters command the
result is "error: cannot write / read file X".
Using absolute paths solves this issue.

Change-Id: If73a62335b75381ce944969723cfdca84aaff7bf
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/403679
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Karol Latecki 2018-03-13 14:00:53 +01:00 committed by Jim Harris
parent 5c36200d90
commit 7f3e956c73

View File

@ -11,7 +11,7 @@ import re
def generateCoverageReport(output_dir, repo_dir): def generateCoverageReport(output_dir, repo_dir):
with open(os.path.join(output_dir, 'coverage.log'), 'w+') as log_file: with open(os.path.join(output_dir, 'coverage.log'), 'w+') as log_file:
coveragePath = os.path.join(output_dir, '**', 'cov_total.info') coveragePath = os.path.join(output_dir, '**', 'cov_total.info')
covfiles = glob.glob(coveragePath, recursive=True) covfiles = [os.path.abspath(p) for p in glob.glob(coveragePath, recursive=True)]
for f in covfiles: for f in covfiles:
print(f, file=log_file) print(f, file=log_file)
if len(covfiles) == 0: if len(covfiles) == 0:
@ -24,7 +24,7 @@ def generateCoverageReport(output_dir, repo_dir):
'--rc genhtml_legend=1', '--rc genhtml_legend=1',
'--rc geninfo_all_blocks=1', '--rc geninfo_all_blocks=1',
] ]
cov_total = os.path.join(output_dir, 'cov_total.info') cov_total = os.path.abspath(os.path.join(output_dir, 'cov_total.info'))
coverage = os.path.join(output_dir, 'coverage') coverage = os.path.join(output_dir, 'coverage')
lcov = 'lcov' + ' ' + ' '.join(lcov_opts) + ' -q -a ' + ' -a '.join(covfiles) + ' -o ' + cov_total lcov = 'lcov' + ' ' + ' '.join(lcov_opts) + ' -q -a ' + ' -a '.join(covfiles) + ' -o ' + cov_total
genhtml = 'genhtml' + ' ' + ' '.join(lcov_opts) + ' -q ' + cov_total + ' --legend' + ' -t "Combined" --show-details -o ' + coverage genhtml = 'genhtml' + ' ' + ' '.join(lcov_opts) + ' -q ' + cov_total + ' --legend' + ' -t "Combined" --show-details -o ' + coverage