mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
ci: Add valgrind target
We used to have this in the old ctest. The code should be ready for this as we already skip tracing openssh sshd (ca4fb9c6) and have workaround for openssl issues (55252e4d), but it took me some time to figure out the secret command to run tests under valgrind with cmake. This adds also convenient custom target to run the memcheck manually. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Norbert Pocs <npocs@redhat.com>
This commit is contained in:
@@ -198,6 +198,15 @@ fedora/openssl_3.0.x/x86_64/minimal:
|
|||||||
-DWITH_GEX=OFF .. &&
|
-DWITH_GEX=OFF .. &&
|
||||||
make -j$(nproc)
|
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
|
# Address sanitizer doesn't mix well with LD_PRELOAD used in the testsuite
|
||||||
# so, this is only enabled for unit tests right now.
|
# so, this is only enabled for unit tests right now.
|
||||||
# TODO: add -DCLIENT_TESTING=ON -DSERVER_TESTING=ON
|
# TODO: add -DCLIENT_TESTING=ON -DSERVER_TESTING=ON
|
||||||
|
|||||||
@@ -337,3 +337,12 @@ endif ()
|
|||||||
if (FUZZ_TESTING)
|
if (FUZZ_TESTING)
|
||||||
add_subdirectory(fuzz)
|
add_subdirectory(fuzz)
|
||||||
endif()
|
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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user