Add sanitized test run to CI.
Chaos Ci / test-and-benchmark (push) Successful in 3m26s

This commit is contained in:
hashlag
2026-07-06 03:25:30 +03:00
parent e0768cde3c
commit 0126196ea8
2 changed files with 17 additions and 2 deletions
+11 -2
View File
@@ -17,21 +17,30 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential cmake valgrind lcov
- name: Configure and build tests [Debug]
- name: Configure and build tests [Debug and Coverage]
run: |
mkdir build-debug
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_COVERAGE=ON
cmake --build build-debug/ -t ChaosTests
- name: Configure and build tests [Debug, ASan and UBSan]
run: |
mkdir build-debug-asanubsan
cmake -S . -B build-debug-asanubsan/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_ASANUBSAN=ON
cmake --build build-debug-asanubsan/ -t ChaosTests
- name: Configure and build benchmarks [Release]
run: |
mkdir build-release
cmake -S . -B build-release/ -D CMAKE_BUILD_TYPE=Release
cmake --build build-release/ -t ChaosBenches
- name: Run tests
- name: Run tests under valgrind
run: valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all ./build-debug/ChaosTests/ChaosTests
- name: Run tests under ASan and UBSan
run: ./build-debug-asanubsan/ChaosTests/ChaosTests
- name: Run benchmarks
run: ./build-release/ChaosBenches/ChaosBenches
+6
View File
@@ -32,12 +32,18 @@ target_include_directories(ChaosTests PRIVATE
target_compile_options(ChaosTests PRIVATE -Wunused -Werror=unused)
option(CHAOS_COVERAGE "Enable coverage" OFF)
option(CHAOS_ASANUBSAN "Enable ASan and UBSan" OFF)
if(CHAOS_COVERAGE)
target_compile_options(ChaosTests PRIVATE --coverage)
target_link_options(ChaosTests PRIVATE --coverage)
endif()
if(CHAOS_ASANUBSAN)
target_compile_options(ChaosTests PRIVATE -fsanitize=address,undefined)
target_link_options(ChaosTests PRIVATE -fsanitize=address,undefined)
endif()
include(GoogleTest)
gtest_discover_tests(ChaosTests)