Skip to content

Commit

Permalink
Fix test coverage settings
Browse files Browse the repository at this point in the history
Set new OPENCMW_ENABLE_COVERAGE flag in CI setup.

Make sure SonarCloud doesn't complain about tests not covered by tests.

Add all tests as dependencies of the coverage targets.
  • Loading branch information
frankosterfeld committed Dec 15, 2023
1 parent 99ae7d2 commit a87126f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
if: matrix.configurations.compiler != 'emscripten'
# Use a bash shell, so we can use the same syntax for environment variable access regardless of the host operating system
shell: bash
run: cmake -S . -B ../build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DENABLE_COVERAGE=${{ matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug' }}
run: cmake -S . -B ../build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DOPENCMW_ENABLE_COVERAGE=${{ matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug' }}

- name: Configure CMake Emscripten
if: matrix.configurations.compiler == 'emscripten'
Expand Down
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,22 @@ if(OPENCMW_ENABLE_TESTING)
EXECUTABLE
ctest
DEPENDENCIES
base64pp_tests
clientPublisher_tests
client_tests
core_tests
disruptor_core_tests
disruptor_tests
disruptor_waitstrategy_tests
majordomo_worker_rest_tests
majordomo_worker_tests
majordomo_tests
mockserver_tests
RBAC_tests
rest_client_mock_server_tests
rest_client_only_tests
serialiser_tests
SubscriptionMatch_tests
EXCLUDE
"$CMAKE_BUILD_DIR/*"
"concepts/.*"
Expand All @@ -159,9 +172,22 @@ if(OPENCMW_ENABLE_TESTING)
EXECUTABLE
ctest
DEPENDENCIES
base64pp_tests
clientPublisher_tests
client_tests
core_tests
disruptor_core_tests
disruptor_tests
disruptor_waitstrategy_tests
majordomo_worker_rest_tests
majordomo_worker_tests
majordomo_tests
mockserver_tests
RBAC_tests
rest_client_mock_server_tests
rest_client_only_tests
serialiser_tests
SubscriptionMatch_tests
EXCLUDE
"$CMAKE_BUILD_DIR/*"
"concepts/.*"
Expand Down
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ sonar.organization=fair-acc
# exclude benchmark which crashes the Analysis
# sonar.exclusions=bench/bm_case1.cpp
sonar.coverageReportPaths=/home/runner/work/opencmw-cpp/build/coverage_sonarcube.xml
sonar.sources = src/
sonar.tests = src/
sonar.exclusions = src/**/test/**/*
sonar.test.inclusions = src/**/test/**/*

0 comments on commit a87126f

Please sign in to comment.