1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

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 <william.r.dieter@intel.com>
This commit is contained in:
William R. Dieter
2021-01-15 02:03:34 -05:00
committed by Brad King
parent f6f048898d
commit f5d79dec53

View File

@@ -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_}'!"