codecov-bash icon indicating copy to clipboard operation
codecov-bash copied to clipboard

Trying to get coverage from clang

Open LebedevRI opened this issue 8 years ago • 4 comments

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?

LebedevRI avatar Feb 06 '17 20:02 LebedevRI

https://github.com/codecov/codecov-python/issues/52 is related

LebedevRI avatar Feb 07 '17 09:02 LebedevRI

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).

Kojoley avatar Mar 06 '18 14:03 Kojoley

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.

andrew-aladev avatar Dec 05 '19 11:12 andrew-aladev

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

andrew-aladev avatar Dec 05 '19 12:12 andrew-aladev