summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/coverage.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix html coverage report generation when using clang on linuxJakob Widauer2023-04-251-1/+1
|
* treewide: add future annotations importEli Schwartz2023-02-011-0/+1
|
* Fix purely white space issues reported by flake8Alf Henrik Sauge2022-08-261-1/+0
|
* coverage: be clever and detect config files for gcovr/lcovEli Schwartz2022-05-061-13/+28
| | | | | | | | | | | | | | gcovr will read this file anyway, but if it exists we don't need to assume that the project wishes to exclude subprojects/ -- they can determine that themselves. Fixes #3287 Closes #9761 lcov doesn't read the config file by default, but we can do the smart thing here. Fixes #4628
* coverage generator: obey the documentation and only generate supported outputsEli Schwartz2021-11-011-6/+6
| | | | | | | | | | | | | We say: > If version 4.2 or higher of the first is found, targets coverage-text, > coverage-xml, coverage-sonarqube and coverage-html are generated. But this is totally untrue. Make it true, by actually checking (and not generating broken coverage commands when older versions of gcovr are found). Fixes #9505
* Escape path in exclude filter passed to gcovrAlois Wohlschlager2021-08-041-5/+5
| | | | | | Gcovr interprets exclude filters, as passed to the -e option, as regexes. Since we want to exclude a raw path, the argument must be escaped.
* Add support for gcovr --sonarqube reportWeston Schmidt2021-07-231-0/+14
| | | | | | | | Sonarcloud.io only can read the sonarqube based report that gcovr can produce. This change enables support for this output in meson and ninja. Signed-off-by: Weston Schmidt <Weston_Schmidt@alumni.purdue.edu>
* fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger2021-06-291-2/+2
|
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-041-2/+2
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* typing: fully annotate scriptsDaniel Mensinger2020-09-081-2/+3
|
* coverage: llvm-cov supportCary Converse2020-06-171-12/+34
|
* Add gcovr 4.2 supportRichard Kjerstadius2019-04-241-16/+13
| | | | | | | | | | | | 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.
* coverage: Also remove source_root prefixesWilliam A. Kennington III2018-12-161-0/+1
| | | | | | | The code our projects care about verifying coverage for mostly lives in the source_root with the exception of the generated source files in build_root. This change cleans up the output so we don't have prefixed paths on our source files anymore.
* coverage: Print summary after gcovr html generationMohammed Sadiq2018-12-021-1/+2
| | | | | | | | | | summary from stdout is often used by Automated builds to show build details The --print-summary option was added to gcovr in v3.2, since html output was added only in 3.1, limitting support to 3.2 won’t be a big deal. --print-summary is not enabled for text/xml report generation as it will result in meson not supporting any gcovr version less than 3.2.
* coverage: fix lcov branch coverage generationMohammed Sadiq2018-10-091-0/+3
| | | | | | | lcov branch coverage are disabled by default. So branch coverage has to be enabled for every stage to make them work. Fixes https://github.com/mesonbuild/meson/issues/4319
* Generate coveragereport directory for gcovr html targetJoel Klinghed2018-03-191-0/+2
|
* Exclude subprojects when doing coverageJoel Klinghed2018-03-191-2/+12
| | | | | | | Restore subproject exclusion for the html coverage report that existed in the ninja backend legacy target. Also exclude subprojects for the gcovr generated reports.
* Use standalone coverage script for legacy targetsJoel Klinghed2018-03-191-73/+109
| | | | | | | | | | | | | | | ninja coverage -> generate all possible reports (text, xml, html) depending on gcovr and/or lcov/genhtml availability. ninja coverage-html -> generate only html report ninja coverage-xml -> generate only xml report ninja coverage-text -> generate only text report Make all targets phony, the old legacy rules where just annoying as you would have to remove the old report before being able to generate a new one. ninja coverage succeeds if it can generate at least one report. ninja coverage-* only succeeds if it can generate the requested report
* fixup! Allow gcovr >= 3.1 to be used to generate html coverage reportJoel Klinghed2018-03-121-2/+2
| | | | Rename gcovr_3_1 to gcovr_new_rootdir
* fixup! Fix coverage-xml and coverage-text targets for gcovr >= 3.1Joel Klinghed2018-03-121-2/+2
| | | | Rename gcovr_3_1 to gcovr_new_rootdir
* Allow gcovr >= 3.1 to be used to generate html coverage reportJoel Klinghed2018-02-271-1/+9
| | | | | | | | | | | | Modern gcovr includes html generation support so if lcov and genhtml are not available fallback to gcovr. Kept lcov and genhtml as default so to not surprise existing users of coverage-html with the different output of gcovr. gcovr added html support in 3.0 but as there already is a test for 3.1 because of the changes to -r/--rootdir I opted to only allow html generation for >= 3.1 to keep things simple.
* Fix coverage-xml and coverage-text targets for gcovr >= 3.1Joel Klinghed2018-02-271-3/+8
| | | | | | | | | | In gcovr 3.1 the -r/--rootdir argument changed meaning causing reports generated with gcovr 3.1 to not find the source files and look for *.gcda in the whole source tree rather than the build dir. So, detect gcovr version and if 3.1 give build_root to -r instead of source_root.
* Remove all files outside the source directory from the coverage reportHenk van der Laan2018-02-081-10/+7
| | | | | | | Cuurently, a set of directories is filtered out from the output based on the location of system includes on most common linux distro's. This commit does away with the blacklist and implements a whitelist approach: only the files inside the source root are shown.
* Echo coverage report uris after generation. Fixes #2805.Félix Piédallu2018-01-301-1/+10
|
* Exclude llvm/clang lib headers from test coveragesnsmac2017-12-171-0/+1
| | | | | Excludes the /usr/lib/llvm-*/include/ directory from coverage. This directory is used on Ubuntu for the libclang-dev packages
* Exclude system sources from test coverageStefan Sonski2017-08-111-0/+1
| | | Exclude /usr/src/ from code coverage, this is included for e.g. gtest/gmock.
* Strip system directories and show coverage for files not executed at all. ↵Jussi Pakkanen2017-05-131-19/+37
| | | | Closes #1721.
* Moved coverage commands to a standalone script.Jussi Pakkanen2017-05-131-0/+61