mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-07 04:02:23 +03:00
Improved CPack tests error logging
This commit is contained in:
1 parent
0816ebcc07
commit
3eb0f08084
3 files changed
+6
-4
No files matched your search
@@ -33,7 +33,7 @@ function(getPackageContentList FILE RESULT_VAR)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(toExpectedContentList FILE_NO CONTENT_VAR)
|
function(toExpectedContentList FILE_NO CONTENT_VAR)
|
||||||
findExpectedFile("${FILE_NO}" "file_")
|
findExpectedFile("${FILE_NO}" "file_" "glob_expr_")
|
||||||
|
|
||||||
# component and monolithic packages differ for some reason by either having
|
# component and monolithic packages differ for some reason by either having
|
||||||
# package filename prefix in path or not
|
# package filename prefix in path or not
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function(getPackageContentList FILE RESULT_VAR)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(toExpectedContentList FILE_NO CONTENT_VAR)
|
function(toExpectedContentList FILE_NO CONTENT_VAR)
|
||||||
findExpectedFile("${FILE_NO}" "file_")
|
findExpectedFile("${FILE_NO}" "file_" "glob_expr_")
|
||||||
|
|
||||||
get_filename_component(prefix_ "${file_}" NAME)
|
get_filename_component(prefix_ "${file_}" NAME)
|
||||||
# NAME_WE removes everything after the dot and dot is in version so replace instead
|
# NAME_WE removes everything after the dot and dot is in version so replace instead
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR)
|
cmake_minimum_required(VERSION ${CMAKE_VERSION} FATAL_ERROR)
|
||||||
|
|
||||||
function(findExpectedFile FILE_NO RESULT_VAR)
|
function(findExpectedFile FILE_NO RESULT_VAR GLOBING_EXPR_VAR)
|
||||||
if(NOT DEFINED EXPECTED_FILE_${FILE_NO}) # explicit file name regex was not provided - construct one from other data
|
if(NOT DEFINED EXPECTED_FILE_${FILE_NO}) # explicit file name regex was not provided - construct one from other data
|
||||||
# set defaults if parameters are not provided
|
# set defaults if parameters are not provided
|
||||||
if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_NAME)
|
if(NOT DEFINED EXPECTED_FILE_${FILE_NO}_NAME)
|
||||||
@@ -21,6 +21,7 @@ function(findExpectedFile FILE_NO RESULT_VAR)
|
|||||||
file(GLOB found_file_ RELATIVE "${bin_dir}" "${EXPECTED_FILE_${FILE_NO}}")
|
file(GLOB found_file_ RELATIVE "${bin_dir}" "${EXPECTED_FILE_${FILE_NO}}")
|
||||||
|
|
||||||
set(${RESULT_VAR} "${found_file_}" PARENT_SCOPE)
|
set(${RESULT_VAR} "${found_file_}" PARENT_SCOPE)
|
||||||
|
set(${GLOBING_EXPR_VAR} "${EXPECTED_FILE_${FILE_NO}}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
include("${config_file}")
|
include("${config_file}")
|
||||||
@@ -39,7 +40,8 @@ include("${src_dir}/tests/${RunCMake_TEST_FILE_PREFIX}/ExpectedFiles.cmake")
|
|||||||
# check that expected generated files exist and contain expected content
|
# check that expected generated files exist and contain expected content
|
||||||
if(NOT EXPECTED_FILES_COUNT EQUAL 0)
|
if(NOT EXPECTED_FILES_COUNT EQUAL 0)
|
||||||
foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT})
|
foreach(file_no_ RANGE 1 ${EXPECTED_FILES_COUNT})
|
||||||
findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}")
|
findExpectedFile("${file_no_}" "FOUND_FILE_${file_no_}"
|
||||||
|
"EXPECTED_FILE_${file_no_}")
|
||||||
list(APPEND foundFiles_ "${FOUND_FILE_${file_no_}}")
|
list(APPEND foundFiles_ "${FOUND_FILE_${file_no_}}")
|
||||||
list(LENGTH FOUND_FILE_${file_no_} foundFilesCount_)
|
list(LENGTH FOUND_FILE_${file_no_} foundFilesCount_)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user