Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When generating Vala coverage, govr fails to find source files #7426

Open
Cogitri opened this issue Jul 9, 2020 · 1 comment
Open

When generating Vala coverage, govr fails to find source files #7426

Cogitri opened this issue Jul 9, 2020 · 1 comment

Comments

@Cogitri
Copy link
Contributor

Cogitri commented Jul 9, 2020

Describe the bug
When generating coverage for Vala projects, gcovr fails to find source files, throwing the following error messages when running ninja -C build coverage-text:

ninja -C build/ coverage-text
[1/1] Generates text coverage report
lcov: LCOV version 20190809-346-g0d75ff8980
genhtml: LCOV version 20190809-346-g0d75ff8980
(WARNING) GCOV produced the following errors processing /home/rasmus/Projects/vala-test/build/test-lib/a915ebc@@lib.vala@sta/meson-generated_lib.c.gcda:
	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala
Cannot open source file lib.c

	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala
Cannot open source file lib.c

	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala

	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala
Cannot open source file lib.c

	Cannot open source file lib.c

	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala
Cannot open source file lib.c

	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala
Cannot open source file lib.c

	Cannot open source file test-lib/a915ebc@@lib.vala@sta/lib.c
Cannot open source file ../test-lib/lib.vala
Cannot open source file lib.c

	Could not open output file 'test-lib#a915ebc@@lib.vala@sta#lib.c.gcov'
Could not open output file '^#test-lib#lib.vala.gcov'
Could not open output file 'lib.c.gcov'

	Could not open output file 'test-lib#a915ebc@@lib.vala@sta#lib.c.gcov'
Could not open output file '^#test-lib#lib.vala.gcov'
Could not open output file 'lib.c.gcov'

	(gcovr could not infer a working directory that resolved it.)
(WARNING) GCOV produced the following errors processing /home/rasmus/Projects/vala-test/build/tests/59830eb@@test-exe@exe/meson-generated_test.c.gcda:
	Cannot open source file test.c
Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Cannot open source file test.c
Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Cannot open source file test.c
Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Cannot open source file test.c

	Cannot open source file test.c
Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Cannot open source file test.c
Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Cannot open source file test.c
Cannot open source file ../tests/test.vala
Cannot open source file tests/59830eb@@test-exe@exe/test.c

	Could not open output file 'test.c.gcov'
Could not open output file '^#tests#test.vala.gcov'
Could not open output file 'tests#59830eb@@test-exe@exe#test.c.gcov'

	Could not open output file 'test.c.gcov'
Could not open output file '^#tests#test.vala.gcov'
Could not open output file 'tests#59830eb@@test-exe@exe#test.c.gcov'

	(gcovr could not infer a working directory that resolved it.)

Text coverage report can be found at file:///home/rasmus/Projects/vala-test/build/meson-logs/coverage.txt

coverage.txt doesn't contain any info:

------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: /home/rasmus/Projects/vala-test
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
------------------------------------------------------------------------------
TOTAL                                          0       0    --%
------------------------------------------------------------------------------

To Reproduce
See the repo https://github.com/Cogitri/meson-vala-coverage-bug-reproducer for a minimal reproducer.

Expected behavior
gcovr should be able to find source files and as such generate coverage data.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? No
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) Tested on Ubuntu 20.04 and Alpine Linux 3.12
  • what Python version are you using e.g. 3.8.0: 3.9.3
  • what meson --version: 0.54.3
  • what ninja --version if it's a Ninja build: 1.9.0
martinpitt added a commit to martinpitt/umockdev that referenced this issue Nov 21, 2020
This unfortunately does not cover the Vala files due to
mesonbuild/meson#7426 , but at least the C
files.
@sergiotarxz
Copy link

This bug continues happening currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants