Przeglądaj źródła

Tests: Cleanup CPack message when files are expected and none are found

Previously, when looking for exactly one file and the number of files
was not one, the test printed out an error message saying that too many
files were found, then printing the list of files.  However, 0 is not
1 and also not too many files.

To reduce confusion, this commit adds a different message when 0 files
are found and 1 is expected.

Signed-off-by: William R. Dieter <[email protected]>
William R. Dieter 5 lat temu
rodzic
commit
f5d79dec53
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      Tests/RunCMake/CPack/VerifyResult.cmake

+ 5 - 0
Tests/RunCMake/CPack/VerifyResult.cmake

@@ -79,6 +79,11 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
           "which does not match:${msg_expected}\n"
           "${output_error_message}")
       endif()
+    elseif(foundFilescount_ EQUAL 0)
+      message(FATAL_ERROR
+        "Found no files for file No. '${file_no_}'!"
+        " Globbing expression: '${EXPECTED_FILE_${file_no_}}'"
+        "${output_error_message}")
     else()
       message(FATAL_ERROR
         "Found more than one file for file No. '${file_no_}'!"