mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Add separate jobs to run tests with ASAN, TSAN, UBSAN
To not slow down benchmarks with all optimizations.
This commit is contained in:
parent
b0f192d878
commit
28ce8fd0f3
@ -105,7 +105,7 @@ Ubuntu_GCC:
|
||||
Ubuntu_GCC_tests:
|
||||
extends: Ubuntu_GCC
|
||||
cache:
|
||||
key: Ubuntu_GCC_tests.v2
|
||||
key: Ubuntu_GCC_tests.v3
|
||||
variables:
|
||||
CCACHE_SIZE: 1G
|
||||
BUILD_TESTS_ONLY: 1
|
||||
@ -125,6 +125,50 @@ Ubuntu_GCC_tests_Debug:
|
||||
paths: []
|
||||
expire_in: 1 minute
|
||||
|
||||
Ubuntu_GCC_tests_asan:
|
||||
extends: Ubuntu_GCC
|
||||
cache:
|
||||
key: Ubuntu_GCC_asan.v1
|
||||
variables:
|
||||
CCACHE_SIZE: 1G
|
||||
BUILD_TESTS_ONLY: 1
|
||||
CMAKE_BUILD_TYPE: Debug
|
||||
CMAKE_CXX_FLAGS_DEBUG: -g -O1 -fno-omit-frame-pointer -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak
|
||||
CMAKE_EXE_LINKER_FLAGS: -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak
|
||||
ASAN_OPTIONS: halt_on_error=1:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
|
||||
artifacts:
|
||||
paths: []
|
||||
expire_in: 1 minute
|
||||
|
||||
Ubuntu_GCC_tests_ubsan:
|
||||
extends: Ubuntu_GCC
|
||||
cache:
|
||||
key: Ubuntu_GCC_ubsan.v1
|
||||
variables:
|
||||
CCACHE_SIZE: 1G
|
||||
BUILD_TESTS_ONLY: 1
|
||||
CMAKE_BUILD_TYPE: Debug
|
||||
CMAKE_CXX_FLAGS_DEBUG: -g -O0 -fsanitize=undefined
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
artifacts:
|
||||
paths: []
|
||||
expire_in: 1 minute
|
||||
|
||||
Ubuntu_GCC_tests_tsan:
|
||||
extends: Ubuntu_GCC
|
||||
cache:
|
||||
key: Ubuntu_GCC_tsan.v1
|
||||
variables:
|
||||
CCACHE_SIZE: 1G
|
||||
BUILD_TESTS_ONLY: 1
|
||||
CMAKE_BUILD_TYPE: Debug
|
||||
CMAKE_CXX_FLAGS_DEBUG: -g -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=thread -fPIE
|
||||
CMAKE_EXE_LINKER_FLAGS: -pthread -pie -fsanitize=thread
|
||||
TSAN_OPTIONS: second_deadlock_stack=1:halt_on_error=1
|
||||
artifacts:
|
||||
paths: []
|
||||
expire_in: 1 minute
|
||||
|
||||
Ubuntu_Static_Deps:
|
||||
extends: Ubuntu_Clang
|
||||
rules:
|
||||
@ -179,7 +223,7 @@ Ubuntu_Clang:
|
||||
Ubuntu_Clang_tests:
|
||||
extends: Ubuntu_Clang
|
||||
cache:
|
||||
key: Ubuntu_Clang_tests.v2
|
||||
key: Ubuntu_Clang_tests.v3
|
||||
variables:
|
||||
CCACHE_SIZE: 1G
|
||||
BUILD_TESTS_ONLY: 1
|
||||
|
@ -52,13 +52,25 @@ if [[ "${CMAKE_BUILD_TYPE}" ]]; then
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ "${CMAKE_CXX_FLAGS_DEBUG}" ]]; then
|
||||
CMAKE_CONF_OPTS+=(
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}"
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ "${CMAKE_EXE_LINKER_FLAGS}" ]]; then
|
||||
CMAKE_CONF_OPTS+=(
|
||||
-DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}"
|
||||
)
|
||||
fi
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
if [[ "${BUILD_TESTS_ONLY}" ]]; then
|
||||
|
||||
# flags specific to our test suite
|
||||
CXX_FLAGS="-Wno-error=deprecated-declarations -Wno-error=nonnull -Wno-error=deprecated-copy -fsanitize=address"
|
||||
CXX_FLAGS="-Wno-error=deprecated-declarations -Wno-error=nonnull -Wno-error=deprecated-copy"
|
||||
if [[ "${CXX}" == 'clang++' ]]; then
|
||||
CXX_FLAGS="${CXX_FLAGS} -Wno-error=unused-lambda-capture -Wno-error=gnu-zero-variadic-macro-arguments"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user