eddyxu / cpp-coveralls

Upload gcov results to coveralls.io
Apache License 2.0
282 stars 74 forks source link

Support for out-of-source builds #61

Open lpenz opened 10 years ago

lpenz commented 10 years ago

The utility assumes that the .c files and the git repository are in the same tree as the .gcno files (-r option). With cmake, it is quite easy (and common) to build utilities in a separate "build" directory. I think a --source-root option would make sense.

jpfr commented 10 years ago

We use coveralls with cmake. Works just fine if the folder with the compiler output is selected. https://github.com/acplt/open62541/blob/master/CMakeLists.txt https://github.com/acplt/open62541/blob/master/.travis.yml

lpenz commented 10 years ago

It works if the build directory is under the source directory, as coveralls searches for both .gcno and .c files recursively in the -r directory. If the build directory has no relation with the source directory, the following happens: -r : find .c, don't find .gcno -r : find .gcno, don't find .c I checked this behaviour, and for now I am using it in travis, but the issue is still valid.

zbeekman commented 9 years ago

huh, so am I correct in saying that if you have:

-project_root
|-src
|-other_stuff
|-build
    |-compiler_1

you won’t run into any issues?

lpenz commented 9 years ago

I'd say that I have to test it, but I think that is correct: it would work if I "-r project_root"

0xced commented 9 years ago

Yes, this is correct, having both src and build directories under a common parent root directory works fine.

AndreLouisCaron commented 8 years ago

I'm also trying to use this with CMake on Travis. The problem I'm getting is that the exclude folders for the coverage reports and the source files is the same. I keep getting these matches for source files on CMake internal files (feature_tests.c, CompilerId*). I can use some specific rules but it seems like this is depending on CMake internals.

Any way we can have exclusion patterns specifically for source file discovery?

zbeekman commented 8 years ago

I've found better functionality and support on codecov.io and have moved there. The bash script works quite well, and is easier to use than coveralls.

mathstuf commented 7 years ago

Would it be easy to just have two arguments, one for the build tree and another for the source tree?