From 22f17137395922e9b4cdf0c07ab5208fc5bae924 Mon Sep 17 00:00:00 2001 From: iTrooz Date: Sat, 18 May 2024 20:35:49 +0200 Subject: [PATCH] fix: actually generate coverage data when compiling/running program (#1686) --- .github/codecov.yml | 1 + .github/workflows/tests.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index c1bf9f84b..1bfa8112b 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,3 +1,4 @@ ignore: - "lib/third_party" # Third party libraries should be ignored - "lib/external" # Our own libraries should be checked in their own repositories + - "tests" # https://about.codecov.io/blog/should-i-include-test-files-in-code-coverage-calculations/ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d08cc84e..5b5fbe1de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,14 +45,14 @@ jobs: set -x mkdir -p build cd build - CC=gcc-12 CXX=g++-12 cmake \ - -DCMAKE_BUILD_TYPE=Debug \ - -DIMHEX_ENABLE_UNIT_TESTS=ON \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_C_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all" \ - -DCMAKE_CXX_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all" \ - -DIMHEX_OFFLINE_BUILD=ON \ + CC=gcc-12 CXX=g++-12 cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DIMHEX_ENABLE_UNIT_TESTS=ON \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all --coverage" \ + -DCMAKE_CXX_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all --coverage" \ + -DIMHEX_OFFLINE_BUILD=ON \ .. make -j4 unit_tests