Merge topic 'doc-ctest-interactive-popups'

cf8710da74 Help: Document ctest(1) --interactive-debug-mode limitation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6211
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
index 5aeae88..9f145c1 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -5,4 +5,7 @@
 will be collected by the :command:`ctest_test` command. Defaults to 307200
 (300 KiB).
 
+If a test's output contains the literal string "CTEST_FULL_OUTPUT",
+the output will not be truncated and may exceed the maximum size.
+
 .. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
index 1fbb8c5..71ecf52 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -5,4 +5,7 @@
 will be collected by the :command:`ctest_test` command. Defaults to 1024
 (1 KiB).
 
+If a test's output contains the literal string "CTEST_FULL_OUTPUT",
+the output will not be truncated and may exceed the maximum size.
+
 .. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index bfa84e4..8018e40 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 20)
-set(CMake_VERSION_PATCH 20210609)
+set(CMake_VERSION_PATCH 20210610)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake
index 294b9e8..76c1bea 100644
--- a/Tests/RunCMake/CPack/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/VerifyResult.cmake
@@ -87,7 +87,7 @@
           "which does not match:${msg_expected}\n"
           "${output_error_message}")
       endif()
-    elseif(foundFilescount_ EQUAL 0)
+    elseif(foundFilesCount_ EQUAL 0)
       message(FATAL_ERROR
         "Found no files for file ${file_no_}!\n"
         "Globbing expression:\n '${EXPECTED_FILE_${file_no_}}'\n"
diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake
index 73d7481..42e8384 100644
--- a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake
@@ -18,14 +18,20 @@
       OUTPUT_QUIET
   )
 
-set(output_error_message_
-    "\n${RPMBUILD_EXECUTABLE} error: '${error_}';\nresult: '${result_}';\n${output_error_message}")
+string(REPLACE "\n" "\n rpmbuild-err> " rpmbuild_err "\n${error_}")
+string(REPLACE "\n" "\n rpmbuild-res> " rpmbuild_res "\n${result_}")
+string(CONCAT output_error_message_
+  "${RPMBUILD_EXECUTABLE} error:${rpmbuild_err}\n"
+  "${RPMBUILD_EXECUTABLE} result:${rpmbuild_res}\n"
+  "${output_error_message}"
+  )
 
 # expected file content are test_prog and optional build-id links that are
 # generated by rpmbuild (introduced in rpm 4.13.0.1)
 set(EXPECTED_FILE_CONTENT_ "^/foo${whitespaces_}/foo/test_prog(${whitespaces_}.*\.build-id.*)*$")
+set(EXPECTED_FILE_ "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/*.rpm")
 
-file(GLOB_RECURSE FOUND_FILE_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/*.rpm")
+file(GLOB_RECURSE FOUND_FILE_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${EXPECTED_FILE_}")
 list(APPEND foundFiles_ "${FOUND_FILE_}")
 list(LENGTH FOUND_FILE_ foundFilesCount_)
 
@@ -37,17 +43,27 @@
       expected_content_list "${PACKAGE_CONTENT}")
 
   if(NOT expected_content_list)
+    string(REPLACE "\n" "\n actual> " msg_actual "\n${PACKAGE_CONTENT}")
+    string(REPLACE "\n" "\n expect> " msg_expected "\n${EXPECTED_FILE_CONTENT_}")
+    string(REPLACE "\r" "\\r" msg_expected "${msg_expected}")
+    string(REPLACE "\t" "\\t" msg_expected "${msg_expected}")
     message(FATAL_ERROR
       "Unexpected file content!\n"
-      " Content: '${PACKAGE_CONTENT}'\n\n"
-      " Expected: '${EXPECTED_FILE_CONTENT_}'"
+      "The content was:${msg_actual}\n"
+      "which does not match:${msg_expected}\n"
       "${output_error_message_}")
   endif()
+elseif(foundFilesCount_ EQUAL 0)
+  message(FATAL_ERROR
+    "Found no files!\n"
+    "Globbing expression:\n '${EXPECTED_FILE_}'\n"
+    "${output_error_message_}")
 else()
   message(FATAL_ERROR
-    "Found more than one file!"
-    " Found files count '${foundFilesCount_}'."
-    " Files: '${FOUND_FILE_}'"
+    "Found more than one file!\n"
+    "Found files count '${foundFilesCount_}'.\n"
+    "Files:\n '${FOUND_FILE_}'\n"
+    "Globbing expression:\n '${EXPECTED_FILE_}'\n"
     "${output_error_message_}")
 endif()
 
@@ -62,6 +78,7 @@
 
 if(NOT foundFilesCount_ EQUAL allFoundFilesCount_)
   message(FATAL_ERROR
-      "Found more files than expected! Found files: '${allFoundFiles_}'"
-      "${output_error_message_}")
+    "Found more files than expected!\n"
+    "Found files:\n '${allFoundFiles_}'\n"
+    "${output_error_message_}")
 endif()