Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Trying to get coverage from clang #55

Open
LebedevRI opened this issue Feb 6, 2017 · 4 comments
Open

Trying to get coverage from clang #55

LebedevRI opened this issue Feb 6, 2017 · 4 comments

Comments

@LebedevRI
Copy link

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

bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -exec $gcov_exe -pb $gcov_arg {} +" || true

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
Copy link
Author

codecov/codecov-python#52 is related

@Kojoley
Copy link

Kojoley commented Mar 6, 2018

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

@andrew-aladev
Copy link

andrew-aladev commented Dec 5, 2019

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
Copy link

andrew-aladev commented Dec 5, 2019

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

@thomasrockhu thomasrockhu self-assigned this Nov 29, 2020
@thomasrockhu thomasrockhu removed their assignment Jul 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants