fixup! Fix coverage-xml and coverage-text targets for gcovr >= 3.1

Rename gcovr_3_1 to gcovr_new_rootdir
pull/3145/head
Joel Klinghed 7 years ago
parent 6266089866
commit ed8197207e
  1. 4
      mesonbuild/backend/ninjabackend.py
  2. 4
      mesonbuild/environment.py
  3. 4
      mesonbuild/scripts/coverage.py

@ -628,11 +628,11 @@ int dummy;
self.generate_coverage_legacy_rules(outfile)
def generate_coverage_legacy_rules(self, outfile):
(gcovr_exe, gcovr_3_1, lcov_exe, genhtml_exe) = environment.find_coverage_tools()
(gcovr_exe, gcovr_new_rootdir, lcov_exe, genhtml_exe) = environment.find_coverage_tools()
added_rule = False
if gcovr_exe:
# gcovr >= 3.1 interprets rootdir differently
if gcovr_3_1:
if gcovr_new_rootdir:
rootdir = self.environment.get_build_dir()
else:
rootdir = self.environment.get_source_dir(),

@ -91,7 +91,7 @@ def detect_gcovr(version='3.1', log=False):
return gcovr_exe, mesonlib.version_compare(found, '>=' + version)
def find_coverage_tools():
gcovr_exe, gcovr_3_1 = detect_gcovr()
gcovr_exe, gcovr_new_rootdir = detect_gcovr()
lcov_exe = 'lcov'
genhtml_exe = 'genhtml'
@ -101,7 +101,7 @@ def find_coverage_tools():
if not mesonlib.exe_exists([genhtml_exe, '--version']):
genhtml_exe = None
return gcovr_exe, gcovr_3_1, lcov_exe, genhtml_exe
return gcovr_exe, gcovr_new_rootdir, lcov_exe, genhtml_exe
def detect_ninja(version='1.5', log=False):
for n in ['ninja', 'ninja-build']:

@ -17,10 +17,10 @@ from mesonbuild import environment
import sys, os, subprocess, pathlib
def coverage(source_root, build_root, log_dir):
(gcovr_exe, gcovr_3_1, lcov_exe, genhtml_exe) = environment.find_coverage_tools()
(gcovr_exe, gcovr_new_rootdir, lcov_exe, genhtml_exe) = environment.find_coverage_tools()
if gcovr_exe:
# gcovr >= 3.1 interprets rootdir differently
if gcovr_3_1:
if gcovr_new_rootdir:
rootdir = build_root
else:
rootdir = source_root

Loading…
Cancel
Save