cpp-coveralls icon indicating copy to clipboard operation
cpp-coveralls copied to clipboard

Support for out-of-source builds

Open lpenz opened this issue 11 years ago • 8 comments
trafficstars

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.

lpenz avatar Aug 06 '14 01:08 lpenz

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

jpfr avatar Aug 13 '14 12:08 jpfr

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.

lpenz avatar Aug 16 '14 14:08 lpenz

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?

zbeekman avatar Feb 27 '15 01:02 zbeekman

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

lpenz avatar Feb 27 '15 13:02 lpenz

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

0xced avatar May 07 '15 08:05 0xced

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?

AndreLouisCaron avatar Dec 30 '15 15:12 AndreLouisCaron

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.

zbeekman avatar Jan 03 '16 17:01 zbeekman

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

mathstuf avatar Sep 19 '17 13:09 mathstuf