diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b27810f0..6f79c8d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -198,6 +198,15 @@ fedora/openssl_3.0.x/x86_64/minimal: -DWITH_GEX=OFF .. && make -j$(nproc) +fedora/valgrind: + extends: .fedora + stage: analysis + script: + - cmake $CMAKE_OPTIONS $CMAKE_ADDITIONAL_OPTIONS .. && + make -j$(nproc) && + make test_memcheck + - cat Testing/Temporary/MemoryChecker.*.log | wc -l | grep "^0$" + # Address sanitizer doesn't mix well with LD_PRELOAD used in the testsuite # so, this is only enabled for unit tests right now. # TODO: add -DCLIENT_TESTING=ON -DSERVER_TESTING=ON diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 50bbe9b4..52c5be1e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -337,3 +337,12 @@ endif () if (FUZZ_TESTING) add_subdirectory(fuzz) endif() + +add_custom_target(test_memcheck + # FIXME: The threads_pki_rsa test is skipped under valgrind as it times out + # Passing suppression file is also stupid so lets go with override here: + # https://stackoverflow.com/a/56116311 + COMMAND ${CMAKE_CTEST_COMMAND} -E torture_threads_pki_rsa + --output-on-failure --force-new-ctest-process --test-action memcheck + --overwrite MemoryCheckSuppressionFile=${CMAKE_SOURCE_DIR}/tests/valgrind.supp + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")