summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
authorAndrew McNulty <amcn102@gmail.com>2024-10-12 11:15:45 +0100
committerEli Schwartz <eschwartz93@gmail.com>2024-11-04 19:30:28 -0500
commit4c7226e3632704e38606839cc962b27d44cd32e3 (patch)
treee45465e78cbe1f16e8f42c1d646896e9a695ce90 /mesonbuild/scripts
parent273894d9897dc60e524506e5dbefc550184aa2cf (diff)
downloadmeson-4c7226e3632704e38606839cc962b27d44cd32e3.tar.gz
coverage.py: Guard use of `--html-nested` behind version check.
`--html-nested` was added to gcovr in version 6.0 so passing it to versions before this will result in gcovr complaining that it doesn't recognise the argument. Added a version check to ensure that we pass a recognised argument for versions before 6.0 Fixes #13781
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r--mesonbuild/scripts/coverage.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/scripts/coverage.py b/mesonbuild/scripts/coverage.py
index f01946944..a4dfebfb9 100644
--- a/mesonbuild/scripts/coverage.py
+++ b/mesonbuild/scripts/coverage.py
@@ -159,9 +159,14 @@ def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build
htmloutdir = os.path.join(log_dir, 'coveragereport')
if not os.path.isdir(htmloutdir):
os.mkdir(htmloutdir)
+ # Use `--html-details` if gcovr version < 6.0, otherwise
+ # use `--html-nested`.
+ html_arg = '--html-details'
+ if mesonlib.version_compare(gcovr_version, '>=6.0'):
+ html_arg = '--html-nested'
subprocess.check_call(gcovr_base_cmd + gcovr_config +
['--html',
- '--html-nested',
+ html_arg,
'--print-summary',
'-o', os.path.join(htmloutdir, 'index.html'),
] + gcov_exe_args)