summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CPack/CPackTestHelpers.cmake
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-09-30 22:13:12 +0200
committerBrad King <brad.king@kitware.com>2015-10-01 09:48:04 -0400
commit1b13af46accba6ed73bf2975221def388cd5e90d (patch)
treed2bf1d94a901b92c36ddb3dd39ff0cb6f7f588cd /Tests/RunCMake/CPack/CPackTestHelpers.cmake
parent981068b79f3703a095f5aa254da6c7d3f997a265 (diff)
downloadcmake-1b13af46accba6ed73bf2975221def388cd5e90d.tar.gz
Tests: Fix RunCMake.CPack_* tests to use proper CMake generator
Use the run_cmake() function to generate the test build tree with the proper CMake generator and also to verify that it succeeds. Drop our PreTestError helper as it is no longer needed.
Diffstat (limited to 'Tests/RunCMake/CPack/CPackTestHelpers.cmake')
-rw-r--r--Tests/RunCMake/CPack/CPackTestHelpers.cmake41
1 files changed, 3 insertions, 38 deletions
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
index 7ea2a24b30..aef1086ff7 100644
--- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake
+++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
@@ -10,47 +10,12 @@ function(run_cpack_test TEST_NAME types build)
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
# execute cmake
- execute_process(
- COMMAND "${CMAKE_COMMAND}" -DRunCMake_TEST=${TEST_NAME}
- -DGENERATOR_TYPE=${TEST_TYPE} "${RunCMake_SOURCE_DIR}"
- WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
- RESULT_VARIABLE res
- OUTPUT_FILE "${RunCMake_TEST_BINARY_DIR}/test_output.txt"
- ERROR_FILE "${RunCMake_TEST_BINARY_DIR}/test_error.txt"
- )
-
- if(res)
- run_cmake_command(
- ${TEST_TYPE}/${TEST_NAME}
- "${CMAKE_COMMAND}"
- -DRunCMake_TEST_STEP=configure
- -Dreturn_code=${res}
- "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
- -P "${RunCMake_SOURCE_DIR}/PreTestError.cmake"
- )
- return()
- endif()
+ set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${TEST_TYPE}")
+ run_cmake(${TEST_NAME})
# execute optional build step
if(build)
- execute_process(
- COMMAND "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}"
- RESULT_VARIABLE res
- OUTPUT_FILE "${RunCMake_TEST_BINARY_DIR}/test_output.txt"
- ERROR_FILE "${RunCMake_TEST_BINARY_DIR}/test_error.txt"
- )
- endif()
-
- if(res)
- run_cmake_command(
- ${TEST_TYPE}/${TEST_NAME}
- "${CMAKE_COMMAND}"
- -DRunCMake_TEST_STEP=build
- -Dreturn_code=${res}
- "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
- -P "${RunCMake_SOURCE_DIR}/PreTestError.cmake"
- )
- return()
+ run_cmake_command(${TEST_NAME}-Build "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}")
endif()
# execute cpack