Question

Ma source et la construction ressemble à l'arbre ce (voir Makefile pour mettre des fichiers objets à partir de fichiers source des répertoires différents en un seul répertoire distinct ) après une marque (qui construit et exécute FooAndBarTests):

src
- Foo.cpp
- Bar.cpp
inc
- Foo.h
- Bar.h
test
- FooTest.cpp
- BarTest.cpp
- Main.cpp
- Makefile
- obj
  - Foo.gcda
  - Foo.gcno
  - Bar.gcda
  - Bar.gcno
- FooAndBarTests
UnitTest++
- libUnitTest++.a
- src
  - ...

Je peux alors produire des fichiers .gcov dans le répertoire de test en exécutant gcov -o obj/ ../src/Foo.cpp et gcov -o obj/ ../src/Bar.cpp.

Mais si je cours lcov -d obj/ -c -o FooAndBarTests.lcov je reçois:

Capturing coverage data from obj/
Found gcov version: 4.2.1
Scanning obj/ for .gcda files ...
Found 4 data files in obj/
Processing Foo.gcda
../src/Foo.cpp:cannot open source file
Processing FooTest.gcda
FooTest.cpp:cannot open source file
../inc/Foo.h:cannot open source file
../UnitTest++/src/Checks.h:cannot open source file
...

Et puis quand je lance genhtml FooAndBarTests.lcov je reçois:

Reading data file FooAndBarTests.lcov
Found 45 entries.
Found common filename prefix "/Users/dspitzer/FooAndBar/test"
Writing .css and .png files.
Generating output.
Processing file UnitTest++/src/Checks.h
genhtml: ERROR: cannot open /Users/dspitzer/FooAndBar/test/UnitTest++/src/Checks.h for reading!

Comment puis-je dire lcov et Genhtml où le Cpp et les fichiers .h sont?

Était-ce utile?

La solution

Utilisez l'option -b à lcov. La base de code de l'option -b.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top