mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 22:37:30 +08:00
ci: support valgrind memcheck runs
This commit is contained in:
@@ -146,6 +146,19 @@
|
|||||||
junit:
|
junit:
|
||||||
- ${CMAKE_CI_BUILD_DIR}/junit.xml
|
- ${CMAKE_CI_BUILD_DIR}/junit.xml
|
||||||
|
|
||||||
|
.cmake_valgrind_artifacts:
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1d
|
||||||
|
when: always
|
||||||
|
reports:
|
||||||
|
annotations:
|
||||||
|
- ${CMAKE_CI_BUILD_DIR}/annotations.json
|
||||||
|
junit:
|
||||||
|
- ${CMAKE_CI_BUILD_DIR}/junit.xml
|
||||||
|
paths:
|
||||||
|
# Valgrind logs.
|
||||||
|
- ${CMAKE_CI_BUILD_DIR}/Testing/Temporary/MemoryChecker.*.log
|
||||||
|
|
||||||
.cmake_sphinx_artifacts:
|
.cmake_sphinx_artifacts:
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1d
|
expire_in: 1d
|
||||||
|
@@ -5,3 +5,46 @@ set(lsan_suppressions "${CMAKE_CURRENT_LIST_DIR}/ctest_memcheck_$ENV{CMAKE_CONFI
|
|||||||
if (EXISTS "${lsan_suppressions}")
|
if (EXISTS "${lsan_suppressions}")
|
||||||
set(ENV{LSAN_OPTIONS} "suppressions='${lsan_suppressions}'")
|
set(ENV{LSAN_OPTIONS} "suppressions='${lsan_suppressions}'")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (CTEST_MEMORYCHECK_TYPE STREQUAL "Valgrind")
|
||||||
|
find_program(valgrind_exe NAMES valgrind)
|
||||||
|
set(CTEST_MEMORYCHECK_COMMAND "${valgrind_exe}")
|
||||||
|
|
||||||
|
set(valgrind_suppressions "${CMAKE_CURRENT_LIST_DIR}/ctest_memcheck_$ENV{CMAKE_CONFIGURATION}.valgrind.supp")
|
||||||
|
set(common_valgrind_suppressions "${CMAKE_CURRENT_LIST_DIR}/ctest_memcheck_$ENV{CMAKE_VALGRIND_CONFIGURATION}.valgrind.supp")
|
||||||
|
if (EXISTS "${valgrind_suppressions}")
|
||||||
|
set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "${valgrind_suppressions}")
|
||||||
|
elseif (EXISTS "${common_valgrind_suppressions}")
|
||||||
|
set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "${common_valgrind_suppressions}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(valgrind_skip
|
||||||
|
/bin/*
|
||||||
|
/sbin/*
|
||||||
|
/usr/bin/*
|
||||||
|
/usr/lib64/qt5/bin/*
|
||||||
|
/usr/lib64/qt6/bin/*
|
||||||
|
/usr/lib64/qt6/libexec/*
|
||||||
|
bootstrap
|
||||||
|
sample_script
|
||||||
|
*/Tests/CTestTest2/kwsysBin/*
|
||||||
|
*/Tests/CTestTestCrash/Crash
|
||||||
|
*QtAutogen
|
||||||
|
# Ignore ISPC files which may contain unimplemented instructions.
|
||||||
|
*/build/Tests/ISPC/TryCompile/ISPCTryCompile
|
||||||
|
# Ignore anything CI downloads.
|
||||||
|
*/.gitlab/*)
|
||||||
|
list(JOIN valgrind_skip "," valgrind_skip)
|
||||||
|
string(CONCAT valgrind_options
|
||||||
|
"--gen-suppressions=all "
|
||||||
|
"--child-silent-after-fork=yes "
|
||||||
|
"--trace-children=yes "
|
||||||
|
"--trace-children-skip=${valgrind_skip} "
|
||||||
|
"--track-origins=yes "
|
||||||
|
"-q "
|
||||||
|
"--leak-check=yes "
|
||||||
|
"--show-reachable=yes "
|
||||||
|
"--num-callers=50 "
|
||||||
|
"-v ")
|
||||||
|
set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "${valgrind_options}")
|
||||||
|
endif ()
|
||||||
|
Reference in New Issue
Block a user