mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
ci: support memcheck-testing external test processes
This commit is contained in:
@@ -33,6 +33,10 @@ elseif("$ENV{CMAKE_CONFIGURATION}" MATCHES "extdeps")
|
|||||||
set(CTEST_CONFIGURE_COMMAND "/opt/extdeps/bin/cmake -C \"${initial_cache}\" -G \"${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"")
|
set(CTEST_CONFIGURE_COMMAND "/opt/extdeps/bin/cmake -C \"${initial_cache}\" -G \"${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if ("$ENV{CMAKE_CI_RUN_MEMCHECK}" STREQUAL "true")
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/ctest_memcheck_prep.cmake")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Configure the project.
|
# Configure the project.
|
||||||
ctest_configure(
|
ctest_configure(
|
||||||
OPTIONS "${cmake_args}"
|
OPTIONS "${cmake_args}"
|
||||||
@@ -93,20 +97,37 @@ if (NOT "$ENV{CTEST_LABELS}" STREQUAL "")
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake")
|
||||||
ctest_test(
|
set(extra_annotations)
|
||||||
PARALLEL_LEVEL "${nproc}"
|
if ("$ENV{CMAKE_CI_RUN_MEMCHECK}" STREQUAL "true")
|
||||||
TEST_LOAD "${nproc}"
|
ctest_memcheck(
|
||||||
OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml"
|
PARALLEL_LEVEL "${nproc}"
|
||||||
RETURN_VALUE test_result
|
TEST_LOAD "${nproc}"
|
||||||
${ctest_label_args}
|
OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml"
|
||||||
EXCLUDE "${test_exclusions}")
|
RETURN_VALUE test_result
|
||||||
ctest_submit(PARTS Test)
|
${ctest_label_args}
|
||||||
|
EXCLUDE "${test_exclusions}")
|
||||||
|
ctest_submit(PARTS Test)
|
||||||
|
ctest_submit(PARTS Memcheck)
|
||||||
|
list(APPEND extra_annotations
|
||||||
|
"Dynamic Analysis" "https://open.cdash.org/viewDynamicAnalysis.php?buildid=${build_id}"
|
||||||
|
)
|
||||||
|
else ()
|
||||||
|
ctest_test(
|
||||||
|
PARALLEL_LEVEL "${nproc}"
|
||||||
|
TEST_LOAD "${nproc}"
|
||||||
|
OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml"
|
||||||
|
RETURN_VALUE test_result
|
||||||
|
${ctest_label_args}
|
||||||
|
EXCLUDE "${test_exclusions}")
|
||||||
|
ctest_submit(PARTS Test)
|
||||||
|
endif ()
|
||||||
|
|
||||||
ctest_annotation_report("${CTEST_BINARY_DIRECTORY}/annotations.json"
|
ctest_annotation_report("${CTEST_BINARY_DIRECTORY}/annotations.json"
|
||||||
"All Tests" "https://open.cdash.org/viewTest.php?buildid=${build_id}"
|
"All Tests" "https://open.cdash.org/viewTest.php?buildid=${build_id}"
|
||||||
"Test Failures" "https://open.cdash.org/viewTest.php?onlyfailed&buildid=${build_id}"
|
"Test Failures" "https://open.cdash.org/viewTest.php?onlyfailed&buildid=${build_id}"
|
||||||
"Tests Not Run" "https://open.cdash.org/viewTest.php?onlynotrun&buildid=${build_id}"
|
"Tests Not Run" "https://open.cdash.org/viewTest.php?onlynotrun&buildid=${build_id}"
|
||||||
"Test Passes" "https://open.cdash.org/viewTest.php?onlypassed&buildid=${build_id}")
|
"Test Passes" "https://open.cdash.org/viewTest.php?onlypassed&buildid=${build_id}"
|
||||||
|
${extra_annotations})
|
||||||
|
|
||||||
if (test_result)
|
if (test_result)
|
||||||
ctest_submit(PARTS Done)
|
ctest_submit(PARTS Done)
|
||||||
|
Reference in New Issue
Block a user