From 7f3e956c73d7472b0bfcec9aab7a1df8c4a79f98 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Tue, 13 Mar 2018 14:00:53 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/403679 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- autorun_post.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autorun_post.py b/autorun_post.py index 1296202db..8467ef67c 100755 --- a/autorun_post.py +++ b/autorun_post.py @@ -11,7 +11,7 @@ import re def generateCoverageReport(output_dir, repo_dir): with open(os.path.join(output_dir, 'coverage.log'), 'w+') as log_file: 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: print(f, file=log_file) if len(covfiles) == 0: @@ -24,7 +24,7 @@ def generateCoverageReport(output_dir, repo_dir): '--rc genhtml_legend=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') 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