aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorRichard Kjerstadius <kjerstadius@gmail.com>2019-04-24 11:28:27 +0200
committerRichard Kjerstadius <kjerstadius@gmail.com>2019-04-24 20:05:21 +0200
commit48ee6a6148190cda71ab69f4417e2df0cc77596b (patch)
tree643bebd05e28b826128d65751085b35f6e550481 /mesonbuild/environment.py
parentadd821db64b3c1fd7568736aaa67de53ad382eb4 (diff)
downloadmeson-48ee6a6148190cda71ab69f4417e2df0cc77596b.zip
meson-48ee6a6148190cda71ab69f4417e2df0cc77596b.tar.gz
meson-48ee6a6148190cda71ab69f4417e2df0cc77596b.tar.bz2
Add gcovr 4.2 support
The out-of-source build syntax for gcovr 4.2 is different compared to previous versions and therefore an update was needed. In researching the most appropriate solution it was found that any gcovr version older than 3.3 always resulted in 0% coverage. Because of this, rather than adding an additional layer of logic, some already existing logic was modified to ensure correct syntax for the new version, while versions older than 3.3 are flagged as not supported. Closes mesonbuild#5089.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index c296573..3d5d3ab 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -83,7 +83,7 @@ from .compilers import (
build_filename = 'meson.build'
-def detect_gcovr(version='3.1', log=False):
+def detect_gcovr(min_version='3.3', new_rootdir_version='4.2', log=False):
gcovr_exe = 'gcovr'
try:
p, found = Popen_safe([gcovr_exe, '--version'])[0:2]
@@ -91,10 +91,10 @@ def detect_gcovr(version='3.1', log=False):
# Doesn't exist in PATH or isn't executable
return None, None
found = search_version(found)
- if p.returncode == 0:
+ if p.returncode == 0 and mesonlib.version_compare(found, '>=' + min_version):
if log:
mlog.log('Found gcovr-{} at {}'.format(found, shlex.quote(shutil.which(gcovr_exe))))
- return gcovr_exe, mesonlib.version_compare(found, '>=' + version)
+ return gcovr_exe, mesonlib.version_compare(found, '>=' + new_rootdir_version)
return None, None
def find_coverage_tools():