Skip to content

Commit

Permalink
change coverage-bin gcov -> llvm-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
injae committed Jan 1, 2024
1 parent b8307d2 commit a6457c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/code-cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
pull_request:

jobs:
ubuntu-gcc-code-cov:
ubuntu-code-cov:
runs-on: ubuntu-latest
env:
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON"
strategy:
matrix:
build-type: ["Debug"]
gcc-version: ["latest"]
container: gcc:${{ matrix.gcc-version }}
compiler-version: ["latest"]
container: silkeh/clang:${{ matrix.compiler-version }}
steps:
- name: Get latest CMake
uses: lukka/[email protected]
Expand All @@ -33,13 +33,15 @@ jobs:
cmake --build ./build --config ${{matrix.build-type}}
- name: Run Test Script
working-directory: build
run: ctest -C ${{matrix.build-type}} --output-on-failure
working-directory: build/${{matrix.build-type}}
run: |
./unittest
llvm-profdata merge -sparse default.profraw -o default.profdata
llvm-cov export ./unittest --instr-profile default.profdata -format=lcov >> coverage.info
- name: Prepare Codecov
run: |
apt-get install -y lcov
lcov --directory . --capture --output-file coverage.info --rc lcov_branch_coverage=1
lcov --remove coverage.info '/usr/*' --output-file coverage.info --rc lcov_branch_coverage=1
lcov --remove coverage.info '**/tests/*' --output-file coverage.info --rc lcov_branch_coverage=1
lcov --remove coverage.info '**/.cppm/*' --output-file coverage.info --rc lcov_branch_coverage=1
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cppm_setting()
cppm_cxx_standard(17)
cppm_compiler_option(
DEBUG
CLANG "-fprofile-instr-generate -fcoverage-mapping"
CLANG "-fprofile-instr-generate -fcoverage-mapping --coverage"
GCC "--coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
)

Expand Down

0 comments on commit a6457c9

Please sign in to comment.