summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt45
1 files changed, 44 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 03d50fb..74bbc07 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -19,7 +19,7 @@ IF(BUILD_TESTING)
OPTION(CMAKE_RUN_LONG_TESTS
"Should the long tests be run (such as Bootstrap)." ON)
MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
-
+
IF (CMAKE_RUN_LONG_TESTS)
OPTION(CTEST_TEST_CTEST
"Should the tests that run a full sub ctest process be run?"
@@ -27,6 +27,34 @@ IF(BUILD_TESTING)
MARK_AS_ADVANCED(CTEST_TEST_CTEST)
ENDIF (CMAKE_RUN_LONG_TESTS)
+ # Should CPack tests be run? By default, yes, but...
+ #
+ # Disable packaging test on Apple 10.3 and below. PackageMaker starts
+ # DiskManagementTool as root and disowns it
+ # (http://lists.apple.com/archives/installer-dev/2005/Jul/msg00005.html).
+ # It is left holding open pipe handles and preventing ProcessUNIX from
+ # detecting end-of-data even after its immediate child exits. Then
+ # the test hangs until it times out and is killed. This is a
+ # well-known bug in kwsys process execution that I would love to get
+ # time to fix.
+ #
+ OPTION(CTEST_TEST_CPACK
+ "Should the tests that use '--build-target package' be run?"
+ ON)
+ MARK_AS_ADVANCED(CTEST_TEST_CPACK)
+ IF(APPLE AND CTEST_TEST_CPACK)
+ EXECUTE_PROCESS(
+ COMMAND sw_vers -productVersion
+ OUTPUT_VARIABLE OSX_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ IF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
+ MESSAGE(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
+ MESSAGE(STATUS "OSX_VERSION='${OSX_VERSION}'")
+ SET(CTEST_TEST_CPACK OFF)
+ ENDIF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
+ ENDIF(APPLE AND CTEST_TEST_CPACK)
+
# Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
# whichever is greater.
SET(CMAKE_LONG_TEST_TIMEOUT 1500)
@@ -259,6 +287,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
"-DSTAGE2:BOOL=1"
--test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2)
+ IF(CTEST_TEST_CPACK)
+ ADD_TEST(CPackComponents ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/CPackComponents"
+ "${CMake_BINARY_DIR}/Tests/CPackComponents"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project CPackComponents
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-two-config
+ --build-target package
+ --test-command ${CMAKE_CMAKE_COMMAND}
+ "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents"
+ -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake")
+ ENDIF(CTEST_TEST_CPACK)
+
ADD_TEST(X11 ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/X11"