diff options
| -rw-r--r-- | .gitlab-ci.yml | 21 | ||||
| -rw-r--r-- | tests/CMakeLists.txt | 9 |
2 files changed, 30 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a28377d..d22bfb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,6 +77,27 @@ fedora/undefined-sanitizer: paths: - obj/ +# realpath() doesn't work with libtsan and returns EINVAL +# +# fedora/thread-sanitizer: +tumbleweed/thread-sanitizer: + image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD + script: + - mkdir -p obj && cd obj && cmake + -DCMAKE_BUILD_TYPE=ThreadSanitizer + -DPICKY_DEVELOPER=ON + -DUNIT_TESTING=ON .. && + make -j$(nproc) && ctest --output-on-failure + tags: + - shared + except: + - tags + artifacts: + expire_in: 1 week + when: on_failure + paths: + - obj/ + fedora/csbuild: image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 46a81c9..72cda71 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -92,6 +92,15 @@ function(ADD_CMOCKA_TEST_ENVIRONMENT _TEST_NAME) set(TORTURE_ENVIRONMENT "LD_PRELOAD=${_TMP_ENV}") endif() + if (CMAKE_BUILD_TYPE) + string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) + if (CMAKE_BUILD_TYPE_LOWER STREQUAL "addresssanitizer" OR + CMAKE_BUILD_TYPE_LOWER STREQUAL "threadsanitizer" OR + CMAKE_BUILD_TYPE_LOWER STREQUAL "undefinedsanitizer") + list(APPEND TORTURE_ENVIRONMENT "SOCKET_WRAPPER_DISABLE_DEEPBIND=1") + endif() + endif() + set_property(TEST ${_TEST_NAME} PROPERTY |
