Skip to content

Commit

Permalink
feat: track engine test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
luishfonseca committed Feb 2, 2024
1 parent 1e8553d commit a93b2f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
sudo apt-get install xorg-dev libglu1-mesa-dev gcc-11 g++-11 lcov
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_COVERAGE=ON -DBUILD_CORE_TESTS=ON -DUSE_CLANG_TIDY=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_COVERAGE=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_TESTS=ON -DUSE_CLANG_TIDY=OFF
shell: bash
env:
CC: gcc-11
Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,26 @@ if(ENABLE_COVERAGE)
append_coverage_compiler_flags()

setup_target_for_coverage_lcov(
NAME coverage
NAME coverage-core
EXECUTABLE core/tests/cubos-core-tests
DEPENDENCIES cubos-core-tests

EXCLUDE "core/lib/*" "core/tests/*" "tools/quadrados" "*-components.cpp"

LCOV_ARGS "--no-external"
)

setup_target_for_coverage_lcov(
NAME coverage-engine
EXECUTABLE engine/tests/cubos-engine-tests
DEPENDENCIES cubos-engine-tests

EXCLUDE "engine/lib/*" "engine/tests/*" "tools/quadrados" "*-components.cpp"

LCOV_ARGS "--no-external"
)

add_custom_target(coverage DEPENDS coverage-core coverage-engine)
endif()

# Enable CCache
Expand Down

0 comments on commit a93b2f2

Please sign in to comment.