]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: fix submit_results.cmake
authorMatthias Maier <tamiko@43-1.org>
Thu, 29 Jun 2023 16:35:21 +0000 (11:35 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 29 Jun 2023 16:35:21 +0000 (11:35 -0500)
Nowadays, we need to set CTEST_SITE before we can submit an already
existing test result.

tests/submit_results.cmake

index f6e9d136f98bedc4c77fde4aec8cfc15877ce166..37da1a6aa75b23ba732a916e33f3807e1da2bbec 100644 (file)
@@ -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 "<Site>")
+string(REGEX REPLACE ".*<Site>(.*)</Site>" "\\1" CTEST_SITE "${CTEST_SITE}")
+
+message("-- CTEST_SITE:             ${CTEST_SITE}")
+
 ctest_start(Experimental TRACK ${_track} APPEND)
 ctest_submit()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.