Fix coverage target breakage and add a test for it.

pull/2169/merge
Jussi Pakkanen 7 years ago
parent e02f1dc809
commit a1326581a5
  1. 1
      ciimage/Dockerfile
  2. 2
      mesonbuild/backend/ninjabackend.py
  3. 13
      run_unittests.py

@ -10,4 +10,5 @@ RUN apt-get -y update && apt-get -y upgrade \
&& apt-get -y install python3-pip libxml2-dev libxslt1-dev cmake libyaml-dev \
&& apt-get -y install openmpi-bin libopenmpi-dev \
&& apt-get -y install libvulkan-dev libpcap-dev \
&& apt-get -y install gcovr lcov \
&& python3 -m pip install hotdoc codecov

@ -626,7 +626,7 @@ int dummy;
added_rule = True
htmloutdir = os.path.join(self.environment.get_log_dir(), 'coveragereport')
covinfo = os.path.join(self.environment.get_log_dir(), 'coverage.info')
phony_elem = NinjaBuildElement(self.all_outputs, 'coverage-html', 'phony', os.path.join(htmloutdir, 'index.html'))
phony_elem = NinjaBuildElement(self.all_outputs, 'meson-coverage-html', 'phony', os.path.join(htmloutdir, 'index.html'))
phony_elem.write(outfile)
# Alias that runs the target defined above
self.create_target_alias('meson-coverage-html', outfile)

@ -1910,6 +1910,19 @@ class LinuxlikeTests(BasePlatformTests):
for i in compdb:
self.assertIn("-fsanitize=address", i["command"])
def test_coverage(self):
if not shutil.which('gcovr'):
raise unittest.SkipTest('gcovr not found')
if not shutil.which('genhtml'):
raise unittest.SkipTest('genhtml not found')
if 'clang' in os.environ.get('CC', '') and os.environ.get('TRAVIS_OS_NAME', '') == 'linux':
raise unittest.SkipTest('Gcovr has a bug and does not work with Clang in the CI environment.')
testdir = os.path.join(self.common_test_dir, '1 trivial')
self.init(testdir, ['-Db_coverage=true'])
self.build()
self.run_tests()
self.run_target('coverage-html')
class LinuxArmCrossCompileTests(BasePlatformTests):
'''
Tests that verify cross-compilation to Linux/ARM

Loading…
Cancel
Save