Trying to get coverage from clang
I do not know if it will actually work in the end, but
The problem: i run codecov bash script with -x llvm-cov-3.8 -a gcov, which i assume should produce what the script expects.
However, $gcov_exe is also run with some hardcoded arguments: -pb or -pbcu
https://github.com/codecov/codecov-bash/blob/ef00447d164a2bea2a4ec69720a7afaac29e4585/codecov#L805
llvm-cov gcov does not support them, and fails https://travis-ci.org/darktable-org/rawspeed/builds/198960321#L1115
Perhaps these -pb or -pbcu should be configurable somehow?
https://github.com/codecov/codecov-python/issues/52 is related
Use quotes -x 'llvm-cov-3.8 gcov'. Alternative way is to create a symlink to llvm-cov with name gcov (llvm-cov will run in gcov mode if it has gcov name).
Same issue. Today llvm-cov from llvm 9.0 is not fully compatible with gcov from gcc 9.2.
I've compiled program using clang and tried to use gcov, received the following error:
version '402*', prefer 'A83*'
no functions found
So we have to use llvm-cov gcov instead of gcov.
My solution looks like:
if ([ -n "$CI" ] && [ -n "$TRAVIS" ]); then
curl -s "https://codecov.io/bash" > "codecov.sh"
chmod +x "codecov.sh"
fi
...
if (echo "$toolchain" | grep -q "clang/coverage.cmake$"); then
./codecov.sh -x "llvm-cov gcov"
else
./codecov.sh -x "gcov"
fi