aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r--mesonbuild/scripts/coverage.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/scripts/coverage.py b/mesonbuild/scripts/coverage.py
index 2bd93e8..a9e83c2 100644
--- a/mesonbuild/scripts/coverage.py
+++ b/mesonbuild/scripts/coverage.py
@@ -14,7 +14,7 @@
from mesonbuild import environment, mesonlib
-import argparse, sys, os, subprocess, pathlib, stat
+import argparse, re, sys, os, subprocess, pathlib, stat
import typing as T
def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build_root: str, log_dir: str, use_llvm_cov: bool) -> int:
@@ -38,7 +38,7 @@ def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build
if gcovr_exe:
subprocess.check_call(gcovr_base_cmd +
['-x',
- '-e', subproject_root,
+ '-e', re.escape(subproject_root),
'-o', os.path.join(log_dir, 'coverage.xml')
] + gcov_exe_args)
outfiles.append(('Xml', pathlib.Path(log_dir, 'coverage.xml')))
@@ -51,7 +51,7 @@ def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build
subprocess.check_call(gcovr_base_cmd +
['--sonarqube',
'-o', os.path.join(log_dir, 'sonarqube.xml'),
- '-e', subproject_root
+ '-e', re.escape(subproject_root)
] + gcov_exe_args)
outfiles.append(('Sonarqube', pathlib.Path(log_dir, 'sonarqube.xml')))
elif outputs:
@@ -61,7 +61,7 @@ def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build
if not outputs or 'text' in outputs:
if gcovr_exe:
subprocess.check_call(gcovr_base_cmd +
- ['-e', subproject_root,
+ ['-e', re.escape(subproject_root),
'-o', os.path.join(log_dir, 'coverage.txt')
] + gcov_exe_args)
outfiles.append(('Text', pathlib.Path(log_dir, 'coverage.txt')))
@@ -140,7 +140,7 @@ def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build
['--html',
'--html-details',
'--print-summary',
- '-e', subproject_root,
+ '-e', re.escape(subproject_root),
'-o', os.path.join(htmloutdir, 'index.html'),
])
outfiles.append(('Html', pathlib.Path(htmloutdir, 'index.html')))