aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2018-03-12 22:19:53 +0100
committerJoel Klinghed <the_jk@spawned.biz>2018-03-12 22:19:53 +0100
commit4e1b229b37dcdf18cff11da377e47b1911a77868 (patch)
treeb96fd51d29ce88adc8391ad231334604079bf678
parented8197207ec31f8e084c0646a520df32302f13c5 (diff)
downloadmeson-4e1b229b37dcdf18cff11da377e47b1911a77868.zip
meson-4e1b229b37dcdf18cff11da377e47b1911a77868.tar.gz
meson-4e1b229b37dcdf18cff11da377e47b1911a77868.tar.bz2
fixup! Allow gcovr >= 3.1 to be used to generate html coverage report
Rename gcovr_3_1 to gcovr_new_rootdir
-rw-r--r--mesonbuild/backend/ninjabackend.py2
-rw-r--r--mesonbuild/scripts/coverage.py4
-rwxr-xr-xrun_unittests.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 17bc86c..9284f8a 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -668,7 +668,7 @@ int dummy;
elem.add_item('COMMAND', command)
elem.add_item('DESC', 'Generating HTML coverage report.')
elem.write(outfile)
- elif gcovr_exe and gcovr_3_1:
+ elif gcovr_exe and gcovr_new_rootdir:
added_rule = True
htmloutdir = os.path.join(self.environment.get_log_dir(), 'coveragereport')
phony_elem = NinjaBuildElement(self.all_outputs, 'meson-coverage-html', 'phony', os.path.join(htmloutdir, 'index.html'))
diff --git a/mesonbuild/scripts/coverage.py b/mesonbuild/scripts/coverage.py
index 4b4b7fb..2d1f8c3 100644
--- a/mesonbuild/scripts/coverage.py
+++ b/mesonbuild/scripts/coverage.py
@@ -70,7 +70,7 @@ def coverage(source_root, build_root, log_dir):
'--show-details',
'--branch-coverage',
covinfo])
- elif gcovr_exe and gcovr_3_1:
+ elif gcovr_exe and gcovr_new_rootdir:
htmloutdir = os.path.join(log_dir, 'coveragereport')
subprocess.check_call([gcovr_exe,
'--html',
@@ -84,7 +84,7 @@ def coverage(source_root, build_root, log_dir):
pathlib.Path(log_dir, 'coverage.xml').as_uri())
print('Text coverage report can be found at',
pathlib.Path(log_dir, 'coverage.txt').as_uri())
- if (lcov_exe and genhtml_exe) or (gcovr_exe and gcovr_3_1):
+ if (lcov_exe and genhtml_exe) or (gcovr_exe and gcovr_new_rootdir):
print('Html coverage report can be found at',
pathlib.Path(htmloutdir, 'index.html').as_uri())
return 0
diff --git a/run_unittests.py b/run_unittests.py
index 4c48041..deb4204 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2554,10 +2554,10 @@ class LinuxlikeTests(BasePlatformTests):
self.assertIn("-fsanitize=address", i["command"])
def test_coverage(self):
- gcovr_exe, gcovr_3_1 = mesonbuild.environment.detect_gcovr()
+ gcovr_exe, gcovr_new_rootdir = mesonbuild.environment.detect_gcovr()
if not gcovr_exe:
raise unittest.SkipTest('gcovr not found')
- if not shutil.which('genhtml') and not gcovr_3_1:
+ if not shutil.which('genhtml') and not gcovr_new_rootdir:
raise unittest.SkipTest('genhtml not found and gcovr is too old')
if 'clang' in os.environ.get('CC', ''):
# We need to use llvm-cov instead of gcovr with clang