CPack tests: add possibility for expecting config developer warnings

This commit is contained in:
Domen Vrankar
2017-11-19 14:22:17 +01:00
parent 176281e131
commit 325f34d150
2 changed files with 28 additions and 1 deletions
@@ -35,10 +35,27 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
"-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}" "-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}"
"-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}" "-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}"
"-DPACKAGING_TYPE=${PACKAGING_TYPE}") "-DPACKAGING_TYPE=${PACKAGING_TYPE}")
foreach(o out err)
if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/configure-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/configure-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/configure-${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/configure-${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/configure-${PACKAGING_TYPE}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/configure-${PACKAGING_TYPE}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/configure-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/configure-std${o}.txt")
else()
unset(RunCMake-std${o}-file)
endif()
endforeach()
run_cmake(${full_test_name_}) run_cmake(${full_test_name_})
# execute optional build step # execute optional build step
if(build) if(build)
unset(RunCMake-stdout-file)
unset(RunCMake-stderr-file)
run_cmake_command(${full_test_name_}-Build "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}") run_cmake_command(${full_test_name_}-Build "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}")
endif() endif()
@@ -72,6 +89,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${SUBTEST_SUFFIX}-std${o}.txt") set(RunCMake-std${o}-file "tests/${TEST_NAME}/${SUBTEST_SUFFIX}-std${o}.txt")
elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/default_expected_std${o}.txt) elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/default_expected_std${o}.txt)
set(RunCMake-std${o}-file "${TEST_TYPE}/default_expected_std${o}.txt") set(RunCMake-std${o}-file "${TEST_TYPE}/default_expected_std${o}.txt")
else()
unset(RunCMake-std${o}-file)
endif() endif()
endforeach() endforeach()
+9 -1
View File
@@ -96,6 +96,14 @@ the test has to run some functions after CPack.cmake is included. In such cases
a function run_after_include_cpack can be declared in test.cmake file and that a function run_after_include_cpack can be declared in test.cmake file and that
function will run after the inclusion of CPack.cmake. function will run after the inclusion of CPack.cmake.
NOTE: During CMake configure stage developer warnings may be expected. In such
cases an expected output regular expression can be provided by creating
'<test_name>/configure-stdout.txt' and/or '<test_name>/configure-stderr.txt'
file. There are also more specialized versions of the file available:
- configure-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt
- configure-${SUBTEST_SUFFIX}-std${o}.txt
- configure-${PACKAGING_TYPE}-std${o}.txt
build phase (optional and not available for source package tests) build phase (optional and not available for source package tests)
----------------------------------------------------------------- -----------------------------------------------------------------
@@ -165,7 +173,7 @@ This phase is executed if '<test_name>/VerifyResult.cmake' script exists.
VerifyResult.cmake script also automatically prints out standard output and VerifyResult.cmake script also automatically prints out standard output and
standard error from CPack execution phase that is compared with standard error from CPack execution phase that is compared with
'<test_name>/<generator_name>-stdout.txt' regular expression and '<test_name>/<generator_name>-stdout.txt' regular expression and
and '<test_name>/<generator_name>-stderr.txt' regular expresson respectively. '<test_name>/<generator_name>-stderr.txt' regular expresson respectively.
NOTE: For subtests generator name can also be suffixed with subtest name and/or NOTE: For subtests generator name can also be suffixed with subtest name and/or
packaging type (MONOLITHIC, COMPONENT, GROUP) and in such cases the packaging type (MONOLITHIC, COMPONENT, GROUP) and in such cases the
preferences of which file will be used are as follows: preferences of which file will be used are as follows: