From 1be91c3c8441235c9783e2081e10a0166341551f Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 29 Jun 2023 11:35:21 -0500 Subject: [PATCH] CMake: fix submit_results.cmake Nowadays, we need to set CTEST_SITE before we can submit an already existing test result. --- tests/submit_results.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/submit_results.cmake b/tests/submit_results.cmake index f6e9d136f9..37da1a6aa7 100644 --- a/tests/submit_results.cmake +++ b/tests/submit_results.cmake @@ -40,14 +40,23 @@ set(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) message("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag) +list(GET _tag 0 _subdirectory) list(GET _tag 1 _track) if("${_track}" STREQUAL "") - message(FATAL_ERROR " -No test results found. Bailing out. -" - ) + message(FATAL_ERROR "\nNo test results found. Bailing out.\n") endif() +set(_file "${CTEST_BINARY_DIRECTORY}/Testing/${_subdirectory}/Update.xml") + +if(NOT EXISTS "${_file}") + message(FATAL_ERROR "\nNo test results found. Bailing out.\n") +endif() + +file(STRINGS "${_file}" CTEST_SITE REGEX "") +string(REGEX REPLACE ".*(.*)" "\\1" CTEST_SITE "${CTEST_SITE}") + +message("-- CTEST_SITE: ${CTEST_SITE}") + ctest_start(Experimental TRACK ${_track} APPEND) ctest_submit() -- 2.39.5