This commit is contained in:
@@ -17,21 +17,30 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential cmake valgrind lcov
|
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: |
|
run: |
|
||||||
mkdir build-debug
|
mkdir build-debug
|
||||||
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_COVERAGE=ON
|
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_COVERAGE=ON
|
||||||
cmake --build build-debug/ -t ChaosTests
|
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]
|
- name: Configure and build benchmarks [Release]
|
||||||
run: |
|
run: |
|
||||||
mkdir build-release
|
mkdir build-release
|
||||||
cmake -S . -B build-release/ -D CMAKE_BUILD_TYPE=Release
|
cmake -S . -B build-release/ -D CMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build-release/ -t ChaosBenches
|
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
|
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
|
- name: Run benchmarks
|
||||||
run: ./build-release/ChaosBenches/ChaosBenches
|
run: ./build-release/ChaosBenches/ChaosBenches
|
||||||
|
|
||||||
|
|||||||
@@ -32,12 +32,18 @@ target_include_directories(ChaosTests PRIVATE
|
|||||||
target_compile_options(ChaosTests PRIVATE -Wunused -Werror=unused)
|
target_compile_options(ChaosTests PRIVATE -Wunused -Werror=unused)
|
||||||
|
|
||||||
option(CHAOS_COVERAGE "Enable coverage" OFF)
|
option(CHAOS_COVERAGE "Enable coverage" OFF)
|
||||||
|
option(CHAOS_ASANUBSAN "Enable ASan and UBSan" OFF)
|
||||||
|
|
||||||
if(CHAOS_COVERAGE)
|
if(CHAOS_COVERAGE)
|
||||||
target_compile_options(ChaosTests PRIVATE --coverage)
|
target_compile_options(ChaosTests PRIVATE --coverage)
|
||||||
target_link_options(ChaosTests PRIVATE --coverage)
|
target_link_options(ChaosTests PRIVATE --coverage)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CHAOS_ASANUBSAN)
|
||||||
|
target_compile_options(ChaosTests PRIVATE -fsanitize=address,undefined)
|
||||||
|
target_link_options(ChaosTests PRIVATE -fsanitize=address,undefined)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
|
|
||||||
gtest_discover_tests(ChaosTests)
|
gtest_discover_tests(ChaosTests)
|
||||||
|
|||||||
Reference in New Issue
Block a user