2007-05-11 18:22:20 +04:00
# a macro for tests that have a simple format where the name matches the
# directory and project
2007-05-18 23:11:20 +04:00
MACRO ( ADD_TEST_MACRO NAME COMMAND )
2007-05-11 18:22:20 +04:00
ADD_TEST ( ${ NAME } ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / $ { N A M E } "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / $ { N A M E } "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t $ { N A M E }
2007-05-18 23:11:20 +04:00
- - t e s t - c o m m a n d $ { C O M M A N D } )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${NAME}" )
2007-05-11 18:22:20 +04:00
ENDMACRO ( ADD_TEST_MACRO )
2008-12-18 22:26:20 +03:00
# Make sure the 'testing' test gets a proper configuration.
2009-01-05 22:14:25 +03:00
CONFIGURE_FILE ( ${ CMake_SOURCE_DIR } /Tests/EnforceConfig.cmake.in
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E n f o r c e C o n f i g . c m a k e @ O N L Y )
SET_DIRECTORY_PROPERTIES ( PROPERTIES
T E S T _ I N C L U D E _ F I L E " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E n f o r c e C o n f i g . c m a k e "
)
2008-12-18 22:26:20 +03:00
2007-05-11 17:02:17 +04:00
# Testing
IF ( BUILD_TESTING )
2008-08-19 19:43:57 +04:00
# Collect a list of all test build directories.
SET ( TEST_BUILD_DIRS )
2007-05-11 17:02:17 +04:00
# Should the long tests be run?
OPTION ( CMAKE_RUN_LONG_TESTS
" S h o u l d t h e l o n g t e s t s b e run ( such as Bootstrap ) . " O N )
MARK_AS_ADVANCED ( CMAKE_RUN_LONG_TESTS )
2008-06-17 19:39:26 +04:00
2007-05-11 17:02:17 +04:00
IF ( CMAKE_RUN_LONG_TESTS )
OPTION ( CTEST_TEST_CTEST
" S h o u l d t h e t e s t s t h a t r u n a f u l l s u b c t e s t p r o c e s s b e r u n ? "
O F F )
MARK_AS_ADVANCED ( CTEST_TEST_CTEST )
2009-10-16 02:18:23 +04:00
OPTION ( TEST_KDE4_STABLE_BRANCH
" S h o u l d t h e K D E 4 s t a b l e b r a n c h t e s t b e r u n ? "
O F F )
MARK_AS_ADVANCED ( TEST_KDE4_STABLE_BRANCH )
2007-05-11 17:02:17 +04:00
ENDIF ( CMAKE_RUN_LONG_TESTS )
2007-05-18 23:11:20 +04:00
2009-07-24 23:58:23 +04:00
# Should tests that use CVS be run?
#
set ( do_cvs_tests 0 )
2009-07-25 00:31:33 +04:00
if ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
find_package ( CVS QUIET )
2009-07-25 02:30:00 +04:00
else ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
find_program ( CVS_EXECUTABLE NAMES cvs )
2009-07-25 00:31:33 +04:00
endif ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
2009-07-24 23:58:23 +04:00
2009-07-25 02:30:00 +04:00
if ( CVS_EXECUTABLE )
set ( do_cvs_tests 1 )
endif ( CVS_EXECUTABLE )
2009-07-24 23:58:23 +04:00
if ( do_cvs_tests AND NOT UNIX )
if ( "${CVS_EXECUTABLE}" MATCHES "cygwin" )
set ( do_cvs_tests 0 )
2009-07-25 00:31:33 +04:00
endif ( "${CVS_EXECUTABLE}" MATCHES "cygwin" )
endif ( do_cvs_tests AND NOT UNIX )
2009-07-24 23:58:23 +04:00
2008-06-17 19:39:26 +04:00
# 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
" S h o u l d t h e t e s t s t h a t u s e ' - - b u i l d - t a r g e t p a c k a g e ' b e r u n ? "
O N )
MARK_AS_ADVANCED ( CTEST_TEST_CPACK )
2009-10-21 21:01:17 +04:00
SET ( CTEST_TEST_OSX_ARCH 0 )
IF ( APPLE )
2008-06-17 19:39:26 +04:00
EXECUTE_PROCESS (
C O M M A N D s w _ v e r s - p r o d u c t V e r s i o n
O U T P U T _ V A R I A B L E O S X _ V E R S I O N
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
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 )
2009-10-21 21:01:17 +04:00
ELSE ( OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]" )
SET ( CTEST_TEST_OSX_ARCH 1 )
2008-06-17 19:39:26 +04:00
ENDIF ( OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]" )
2009-10-21 21:01:17 +04:00
ENDIF ( APPLE )
2008-06-17 19:39:26 +04:00
2008-04-19 21:37:38 +04:00
# Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
# whichever is greater.
SET ( CMAKE_LONG_TEST_TIMEOUT 1500 )
IF ( CTEST_TEST_TIMEOUT )
SET ( CMAKE_LONG_TEST_TIMEOUT ${ CTEST_TEST_TIMEOUT } )
ENDIF ( CTEST_TEST_TIMEOUT )
IF ( CMAKE_LONG_TEST_TIMEOUT LESS 1500 )
SET ( CMAKE_LONG_TEST_TIMEOUT 1500 )
ENDIF ( CMAKE_LONG_TEST_TIMEOUT LESS 1500 )
2007-05-18 23:11:20 +04:00
# add a bunch of standard build-and-test style tests
2007-05-11 18:22:20 +04:00
ADD_TEST_MACRO ( CommandLineTest CommandLineTest )
ADD_TEST_MACRO ( FindPackageTest FindPackageTest )
2008-06-17 18:51:37 +04:00
ADD_TEST_MACRO ( FindModulesExecuteAll FindModulesExecuteAll )
2007-05-11 18:22:20 +04:00
ADD_TEST_MACRO ( StringFileTest StringFileTest )
ADD_TEST_MACRO ( TryCompile TryCompile )
ADD_TEST_MACRO ( TarTest TarTest )
ADD_TEST_MACRO ( SystemInformation SystemInformation )
ADD_TEST_MACRO ( MathTest MathTest )
ADD_TEST_MACRO ( Simple Simple )
ADD_TEST_MACRO ( PreOrder PreOrder )
ADD_TEST_MACRO ( COnly COnly )
ADD_TEST_MACRO ( CxxOnly CxxOnly )
2009-10-02 21:52:29 +04:00
ADD_TEST_MACRO ( IPO COnly/COnly )
2009-10-28 20:35:53 +03:00
ADD_TEST_MACRO ( OutDir runtime/OutDir )
2007-05-11 18:22:20 +04:00
ADD_TEST_MACRO ( NewlineArgs NewlineArgs )
ADD_TEST_MACRO ( SetLang SetLang )
2007-05-18 23:11:20 +04:00
ADD_TEST_MACRO ( ExternalOBJ ExternalOBJ )
ADD_TEST_MACRO ( LoadCommand LoadedCommand )
2009-07-10 21:53:38 +04:00
ADD_TEST_MACRO ( LinkLanguage LinkLanguage )
2007-05-18 23:11:20 +04:00
ADD_TEST_MACRO ( LinkLine LinkLine )
ADD_TEST_MACRO ( MacroTest miniMacroTest )
2007-12-03 21:35:41 +03:00
ADD_TEST_MACRO ( FunctionTest miniFunctionTest )
2008-01-23 18:29:21 +03:00
ADD_TEST_MACRO ( ReturnTest ReturnTest )
2007-05-31 18:29:13 +04:00
ADD_TEST_MACRO ( Properties Properties )
2007-07-05 17:05:40 +04:00
ADD_TEST_MACRO ( Assembler HelloAsm )
2007-08-27 22:17:29 +04:00
ADD_TEST_MACRO ( SourceGroups SourceGroups )
2008-01-14 17:20:58 +03:00
ADD_TEST_MACRO ( Preprocess Preprocess )
2008-01-28 16:40:21 +03:00
ADD_TEST_MACRO ( ExportImport ExportImport )
2008-08-25 18:31:29 +04:00
ADD_TEST_MACRO ( Unset Unset )
2009-01-22 21:16:47 +03:00
ADD_TEST_MACRO ( PolicyScope PolicyScope )
2009-11-09 19:14:21 +03:00
ADD_TEST_MACRO ( CrossCompile CrossCompile )
2009-11-09 20:05:49 +03:00
SET_TESTS_PROPERTIES ( CrossCompile PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " T R Y _ R U N . . i n v o k e d i n c r o s s - c o m p i l i n g m o d e " )
2009-09-29 01:34:34 +04:00
IF ( "${CMAKE_TEST_GENERATOR}" MATCHES "Make" )
ADD_TEST_MACRO ( Policy0002 Policy0002 )
ENDIF ( "${CMAKE_TEST_GENERATOR}" MATCHES "Make" )
2009-10-21 21:01:17 +04:00
IF ( CTEST_TEST_OSX_ARCH )
ADD_TEST_MACRO ( Architecture Architecture )
SET_TESTS_PROPERTIES ( Architecture PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " ( f i l e i s n o t o f r e q u i r e d a r c h i t e c t u r e | d o e s n o t m a t c h c p u t y p e ) " )
ENDIF ( CTEST_TEST_OSX_ARCH )
2008-01-30 20:04:38 +03:00
2008-10-15 21:56:07 +04:00
SET ( CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly" )
SET ( CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e B u i l d T e s t . c m a k e " @ O N L Y )
ADD_TEST ( CMakeBuildTest ${ CMAKE_CMAKE_COMMAND } -P
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e B u i l d T e s t . c m a k e " )
2008-08-07 00:16:53 +04:00
# If we are running right now with a UnixMakefiles based generator,
# build the "Simple" test with the ExtraGenerators, if available
# This doesn't test whether the generated project files work (unfortunately),
# mainly it tests that cmake doesn't crash when generating these project files.
IF ( ${ CMAKE_TEST_GENERATOR } MATCHES "Unix Makefiles" OR ${ CMAKE_TEST_GENERATOR } MATCHES "KDevelop" )
# check which generators we have
EXEC_PROGRAM ( ${ CMAKE_CMAKE_COMMAND } ARGS --help OUTPUT_VARIABLE cmakeOutput )
# check for the Eclipse generator
IF ( "${cmakeOutput}" MATCHES Eclipse )
ADD_TEST ( Simple_EclipseGenerator ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e _ E c l i p s e G e n e r a t o r "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r " E c l i p s e C D T 4 - U n i x M a k e f i l e s "
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t S i m p l e
- - t e s t - c o m m a n d S i m p l e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" )
2008-08-07 00:16:53 +04:00
ENDIF ( "${cmakeOutput}" MATCHES Eclipse )
# check for the CodeBlocks generator
IF ( "${cmakeOutput}" MATCHES CodeBlocks )
ADD_TEST ( Simple_CodeBlocksGenerator ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e _ C o d e B l o c k s G e n e r a t o r "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r " C o d e B l o c k s - U n i x M a k e f i l e s "
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t S i m p l e
- - t e s t - c o m m a n d S i m p l e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" )
2008-08-07 00:16:53 +04:00
ENDIF ( "${cmakeOutput}" MATCHES CodeBlocks )
# check for the KDevelop3 generator
IF ( "${cmakeOutput}" MATCHES KDevelop3 )
ADD_TEST ( Simple_KDevelop3Generator ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e _ K D e v e l o p 3 G e n e r a t o r "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r " K D e v e l o p 3 - U n i x M a k e f i l e s "
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t S i m p l e
- - t e s t - c o m m a n d S i m p l e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" )
2008-08-07 01:43:34 +04:00
ENDIF ( "${cmakeOutput}" MATCHES KDevelop3 )
2008-08-07 00:16:53 +04:00
ENDIF ( ${ CMAKE_TEST_GENERATOR } MATCHES "Unix Makefiles" OR ${ CMAKE_TEST_GENERATOR } MATCHES "KDevelop" )
2008-01-30 20:04:38 +03:00
# test for correct sub-project generation
# not implemented in VS6 or Xcode
2008-02-02 00:17:06 +03:00
IF ( NOT MSVC60 AND NOT XCODE AND NOT MSVC70 )
2008-01-30 20:04:38 +03:00
# run cmake and configure all of SubProject
# but only build the independent executable car
ADD_TEST ( SubProject ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b P r o j e c t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b P r o j e c t "
- - b u i l d - p r o j e c t S u b P r o j e c t
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t a r g e t c a r
- - t e s t - c o m m a n d c a r
)
# For stage 2, do not run cmake again.
# Then build the foo sub project which should build
# the bar library which should be referenced because
# foo links to the static library bar, but bar is not
# directly in the foo sub project
ADD_TEST ( SubProject-Stage2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b P r o j e c t / f o o "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b P r o j e c t / f o o "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - n o c m a k e
- - b u i l d - p r o j e c t f o o
- - b u i l d - t a r g e t f o o
- - t e s t - c o m m a n d f o o
)
2008-07-03 22:34:28 +04:00
SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject" )
2008-02-02 00:17:06 +03:00
ENDIF ( NOT MSVC60 AND NOT XCODE AND NOT MSVC70 )
2008-01-30 20:04:38 +03:00
2007-11-06 22:11:00 +03:00
IF ( CMAKE_STRICT )
ADD_TEST_MACRO ( DocTest DocTest )
ENDIF ( CMAKE_STRICT )
2009-09-23 20:45:39 +04:00
# macro to add a test that will build a nightly release
# of CMake for given platform using the release scripts
MACRO ( ADD_NIGHTLY_BUILD_TEST name script )
SET ( _TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}" )
FILE ( MAKE_DIRECTORY "${_TEST_DIR}" )
FILE ( WRITE "${_TEST_DIR}/nightly-cmake.sh"
" c d $ { _ T E S T _ D I R }
$ { C M a k e _ B I N A R Y _ D I R } / b i n / c m a k e - D C M A K E _ C R E A T E _ V E R S I O N = C V S - P $ { C M a k e _ S O U R C E _ D I R } / U t i l i t i e s / R e l e a s e / $ { s c r i p t }
2007-09-10 18:49:05 +04:00
$ { C M a k e _ B I N A R Y _ D I R } / b i n / c m a k e - D V E R S I O N = C V S - P $ { C M a k e _ S O U R C E _ D I R } / U t i l i t i e s / R e l e a s e / u p l o a d _ r e l e a s e . c m a k e
2009-09-23 20:45:39 +04:00
" )
ADD_TEST ( ${ name } /bin/sh ${ _TEST_DIR } /nightly-cmake.sh )
IF ( COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY )
2009-10-28 22:50:40 +03:00
SET_TESTS_PROPERTIES ( ${ name } PROPERTIES TIMEOUT ${ CMAKE_LONG_TEST_TIMEOUT } )
2009-09-23 20:45:39 +04:00
ENDIF ( COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY )
ENDMACRO ( ADD_NIGHTLY_BUILD_TEST )
IF ( CMAKE_BUILD_NIGHTLY_RELEASES )
ADD_NIGHTLY_BUILD_TEST ( CMakeNightlyWindows
d a s h 2 w i n 6 4 _ r e l e a s e . c m a k e )
ADD_NIGHTLY_BUILD_TEST ( CMakeNightlyMac
d a s h m a c m i n i 2 _ r e l e a s e . c m a k e )
ADD_NIGHTLY_BUILD_TEST ( CMakeNightlyLinux
m a g r a t h e a _ r e l e a s e . c m a k e )
ENDIF ( CMAKE_BUILD_NIGHTLY_RELEASES )
2007-10-10 19:06:15 +04:00
2007-05-18 23:11:20 +04:00
# add tests with more complex invocations
2007-10-10 19:06:15 +04:00
ADD_TEST ( Framework ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / F r a m e w o r k "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / F r a m e w o r k "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t F r a m e w o r k
- - b u i l d - o p t i o n s
" - D C M A K E _ I N S T A L L _ P R E F I X : P A T H = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / F r a m e w o r k / I n s t a l l "
- - t e s t - c o m m a n d b a r )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework" )
2007-10-10 19:06:15 +04:00
2007-05-11 17:02:17 +04:00
ADD_TEST ( TargetName ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T a r g e t N a m e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T a r g e t N a m e "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t T a r g e t N a m e
- - t e s t - c o m m a n d $ { C M A K E _ C M A K E _ C O M M A N D } - E c o m p a r e _ f i l e s
$ { C M a k e _ S O U R C E _ D I R } / T e s t s / T a r g e t N a m e / s c r i p t s / h e l l o _ w o r l d
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T a r g e t N a m e / s c r i p t s / h e l l o _ w o r l d )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( LibName ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i b N a m e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i b N a m e "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t L i b N a m e
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i b N a m e / l i b "
- - t e s t - c o m m a n d f o o b a r
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( CustComDepend ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C u s t C o m D e p e n d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t C o m D e p e n d "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t C u s t C o m D e p e n d
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t C o m D e p e n d / b i n "
- - t e s t - c o m m a n d f o o b a r . c
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( CustomCommand ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C u s t o m C o m m a n d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t o m C o m m a n d "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t C u s t o m C o m m a n d
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t o m C o m m a n d / b i n "
- - t e s t - c o m m a n d C u s t o m C o m m a n d
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( CustomCommandWorkingDirectory ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C u s t o m C o m m a n d W o r k i n g D i r e c t o r y "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t o m C o m m a n d W o r k i n g D i r e c t o r y "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t T e s t W o r k i n g D i r
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - t e s t - c o m m a n d w o r k i n g
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory" )
2007-05-11 17:02:17 +04:00
2007-05-11 20:17:27 +04:00
#ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND}
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/SimpleExclude"
# "${CMake_BINARY_DIR}/Tests/SimpleExclude"
# --build-generator ${CMAKE_TEST_GENERATOR}
# --build-project SimpleExclude
# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-two-config
# --test-command t4
2007-05-11 17:02:17 +04:00
#--test-command "${CMAKE_COMMAND}"
#"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
#-P "${CMAKE_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
2007-05-11 20:17:27 +04:00
#)
2007-05-11 17:02:17 +04:00
# ADD_TEST(SameName ${CMAKE_CTEST_COMMAND}
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/SameName"
# "${CMake_BINARY_DIR}/Tests/SameName"
# --build-generator ${CMAKE_TEST_GENERATOR}
# --build-project SameName
# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-two-config
# --test-command
# "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
ADD_TEST ( OutOfSource ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / O u t O f S o u r c e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / O u t O f S o u r c e "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t O u t O f S o u r c e
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - t e s t - c o m m a n d
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / O u t O f S o u r c e / S u b D i r / O u t O f S o u r c e S u b d i r / s i m p l e " )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource" )
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep" )
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( BuildDepends ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u i l d D e p e n d s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u i l d D e p e n d s "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t B u i l d D e p e n d s
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends" )
2007-05-11 17:02:17 +04:00
SET ( SimpleInstallInstallDir
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e I n s t a l l / I n s t a l l D i r e c t o r y " )
ADD_TEST ( SimpleInstall ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e I n s t a l l "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e I n s t a l l "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t T e s t S i m p l e I n s t a l l
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - b u i l d - o p t i o n s
" - D C M A K E _ I N S T A L L _ P R E F I X : P A T H = $ { S i m p l e I n s t a l l I n s t a l l D i r } "
2009-11-16 23:35:04 +03:00
" - D C T E S T _ T E S T _ C P A C K : B O O L = $ { C T E S T _ T E S T _ C P A C K } "
2007-10-01 23:57:34 +04:00
- - t e s t - c o m m a n d $ { S i m p l e I n s t a l l I n s t a l l D i r } / M y T e s t / b i n / S i m p l e I n s t E x e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( SimpleInstall-Stage2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e I n s t a l l S 2 "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e I n s t a l l S 2 "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t T e s t S i m p l e I n s t a l l
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - b u i l d - o p t i o n s
" - D C M A K E _ I N S T A L L _ P R E F I X : P A T H = $ { S i m p l e I n s t a l l I n s t a l l D i r } "
" - D S T A G E 2 : B O O L = 1 "
2007-10-01 23:57:34 +04:00
- - t e s t - c o m m a n d $ { S i m p l e I n s t a l l I n s t a l l D i r } / M y T e s t / b i n / S i m p l e I n s t E x e S 2 )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2" )
2007-05-11 17:02:17 +04:00
2008-06-19 19:08:08 +04:00
# By default, run the CPackComponents test if the CTEST_TEST_CPACK
# option is ON:
#
set ( CTEST_RUN_CPackComponents ${ CTEST_TEST_CPACK } )
2009-01-22 18:22:30 +03:00
set ( CTEST_package_X11_TEST ${ CTEST_TEST_CPACK } )
2008-06-19 19:08:08 +04:00
2009-10-26 00:00:51 +03:00
find_program ( NSIS_MAKENSIS_EXECUTABLE NAMES makensis
P A T H S [ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ N S I S ]
D O C " m a k e n s i s p r o g r a m l o c a t i o n "
)
2008-06-19 19:08:08 +04:00
# But on Windows, only run the CPackComponents test if the NSIS
# installer builder is available:
#
if ( WIN32 )
if ( NSIS_MAKENSIS_EXECUTABLE )
set ( CTEST_RUN_CPackComponents ON )
else ( NSIS_MAKENSIS_EXECUTABLE )
set ( CTEST_RUN_CPackComponents OFF )
2009-01-22 18:22:30 +03:00
set ( CTEST_package_X11_TEST OFF )
2008-06-19 19:08:08 +04:00
endif ( NSIS_MAKENSIS_EXECUTABLE )
endif ( WIN32 )
IF ( CTEST_RUN_CPackComponents )
2009-01-22 20:12:44 +03:00
set ( CPackComponents_EXTRA_OPTIONS )
if ( APPLE )
set ( CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON )
endif ( APPLE )
2009-10-26 00:00:51 +03:00
if ( NSIS_MAKENSIS_EXECUTABLE )
set ( CPackComponents_EXTRA_OPTIONS ${ CPackComponents_EXTRA_OPTIONS }
- D C P A C K _ B I N A R Y _ N S I S : B O O L = O N )
endif ( NSIS_MAKENSIS_EXECUTABLE )
2009-01-22 20:12:44 +03:00
2008-06-17 19:39:26 +04:00
ADD_TEST ( CPackComponents ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k C o m p o n e n t s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k C o m p o n e n t s "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t C P a c k C o m p o n e n t s
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - b u i l d - t a r g e t p a c k a g e
2008-10-29 19:27:19 +03:00
- - b u i l d - o p t i o n s
- D C P A C K _ B I N A R Y _ D E B : B O O L = $ { C P A C K _ B I N A R Y _ D E B }
- D C P A C K _ B I N A R Y _ R P M : B O O L = $ { C P A C K _ B I N A R Y _ R P M }
2009-01-22 20:12:44 +03:00
$ { C P a c k C o m p o n e n t s _ E X T R A _ O P T I O N S }
2009-10-27 19:18:41 +03:00
- - g r a p h v i z = C P a c k C o m p o n e n t s . d o t
2008-06-17 19:39:26 +04:00
- - t e s t - c o m m a n d $ { C M A K E _ C M A K E _ C O M M A N D }
" - D C P a c k C o m p o n e n t s _ B I N A R Y _ D I R : P A T H = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k C o m p o n e n t s "
- P " $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k C o m p o n e n t s / V e r i f y R e s u l t . c m a k e " )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents" )
2008-06-19 19:08:08 +04:00
ENDIF ( CTEST_RUN_CPackComponents )
2008-06-17 19:39:26 +04:00
2009-10-20 22:31:10 +04:00
# By default, turn this test off (because it takes a long time...)
#
if ( NOT DEFINED CTEST_RUN_CPackTestAllGenerators )
set ( CTEST_RUN_CPackTestAllGenerators OFF )
# ...but: if it appears to be a coverage dashboard, or long tests are
# on, then set it to the generic CTEST_TEST_CPACK setting.
#
if ( CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR
N O T " $ E N V { C O V F I L E } " S T R E Q U A L " " O R
C M A K E _ R U N _ L O N G _ T E S T S )
set ( CTEST_RUN_CPackTestAllGenerators ${ CTEST_TEST_CPACK } )
endif ( CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR
N O T " $ E N V { C O V F I L E } " S T R E Q U A L " " O R
C M A K E _ R U N _ L O N G _ T E S T S )
endif ( NOT DEFINED CTEST_RUN_CPackTestAllGenerators )
IF ( CTEST_RUN_CPackTestAllGenerators )
ADD_TEST ( CPackTestAllGenerators ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k T e s t A l l G e n e r a t o r s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k T e s t A l l G e n e r a t o r s "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t C P a c k T e s t A l l G e n e r a t o r s
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - t e s t - c o m m a n d
$ { C M A K E _ C M A K E _ C O M M A N D }
- D d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k T e s t A l l G e n e r a t o r s
- D c p a c k = $ { C M A K E _ C P A C K _ C O M M A N D }
- P $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k T e s t A l l G e n e r a t o r s / R u n C P a c k . c m a k e
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" )
ENDIF ( CTEST_RUN_CPackTestAllGenerators )
2009-01-22 18:22:30 +03:00
IF ( CTEST_package_X11_TEST )
2009-01-21 19:54:30 +03:00
SET ( X11_build_target_arg --build-target package )
2009-01-22 18:22:30 +03:00
ELSE ( CTEST_package_X11_TEST )
2009-01-21 19:54:30 +03:00
SET ( X11_build_target_arg )
2009-01-22 18:22:30 +03:00
ENDIF ( CTEST_package_X11_TEST )
2009-01-21 19:54:30 +03:00
ADD_TEST ( X11 ${ CMAKE_CTEST_COMMAND }
2007-05-11 17:02:17 +04:00
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / X 1 1 "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / X 1 1 "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t U s e X 1 1
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
2009-01-21 19:54:30 +03:00
$ { X 1 1 _ b u i l d _ t a r g e t _ a r g }
2007-05-11 17:02:17 +04:00
- - t e s t - c o m m a n d U s e X 1 1 )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11" )
2007-05-11 17:02:17 +04:00
2009-10-22 18:14:40 +04:00
if ( NOT DEFINED CTEST_RUN_CMakeTestAllGenerators )
set ( CTEST_RUN_CMakeTestAllGenerators ON )
endif ( NOT DEFINED CTEST_RUN_CMakeTestAllGenerators )
IF ( CTEST_RUN_CMakeTestAllGenerators )
ADD_TEST ( CMakeTestAllGenerators ${ CMAKE_CMAKE_COMMAND }
- D d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t A l l G e n e r a t o r s
- D C M a k e _ S O U R C E _ D I R = $ { C M a k e _ S O U R C E _ D I R }
- P $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C M a k e T e s t A l l G e n e r a t o r s / R u n C M a k e . c m a k e
)
LIST ( APPEND TEST_BUILD_DIRS
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t A l l G e n e r a t o r s " )
ENDIF ( CTEST_RUN_CMakeTestAllGenerators )
2009-10-27 19:18:41 +03:00
if ( NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines )
set ( CTEST_RUN_CMakeTestBadCommandLines ON )
endif ( NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines )
IF ( CTEST_RUN_CMakeTestBadCommandLines )
ADD_TEST ( CMakeTestBadCommandLines ${ CMAKE_CMAKE_COMMAND }
- D d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t B a d C o m m a n d L i n e s
- D g e n = $ { C M A K E _ T E S T _ G E N E R A T O R }
- D C M a k e _ S O U R C E _ D I R = $ { C M a k e _ S O U R C E _ D I R }
- P $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C M a k e T e s t B a d C o m m a n d L i n e s / R u n C M a k e . c m a k e
)
LIST ( APPEND TEST_BUILD_DIRS
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t B a d C o m m a n d L i n e s " )
ENDIF ( CTEST_RUN_CMakeTestBadCommandLines )
2009-10-26 23:09:27 +03:00
if ( NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures )
set ( CTEST_RUN_CMakeTestMultipleConfigures ON )
endif ( NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures )
IF ( CTEST_RUN_CMakeTestMultipleConfigures )
ADD_TEST ( CMakeTestMultipleConfigures ${ CMAKE_CMAKE_COMMAND }
- D d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t M u l t i p l e C o n f i g u r e s
- D g e n = $ { C M A K E _ T E S T _ G E N E R A T O R }
- D C M a k e _ S O U R C E _ D I R = $ { C M a k e _ S O U R C E _ D I R }
- P $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C M a k e T e s t M u l t i p l e C o n f i g u r e s / R u n C M a k e . c m a k e
)
LIST ( APPEND TEST_BUILD_DIRS
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t M u l t i p l e C o n f i g u r e s " )
ENDIF ( CTEST_RUN_CMakeTestMultipleConfigures )
2007-05-11 17:02:17 +04:00
ADD_TEST ( LoadedCommandOneConfig ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L o a d C o m m a n d O n e C o n f i g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L o a d C o m m a n d O n e C o n f i g "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
2007-05-20 18:11:48 +04:00
- - b u i l d - p r o j e c t L o a d C o m m a n d
2007-05-11 17:02:17 +04:00
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - t e s t - c o m m a n d L o a d e d C o m m a n d
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" )
2007-05-11 17:02:17 +04:00
# Como does not seem to support shared libraries.
GET_FILENAME_COMPONENT ( CMAKE_BASE_NAME ${ CMAKE_CXX_COMPILER } NAME_WE )
IF ( CMAKE_BASE_NAME MATCHES "^como$" )
SET ( COMPILER_IS_COMO 1 )
ENDIF ( CMAKE_BASE_NAME MATCHES "^como$" )
IF ( NOT COMPILER_IS_COMO )
2009-10-08 00:11:52 +04:00
SET ( COMPLEX_TEST_CMAKELIB 1 )
IF ( CMAKE_TEST_DIFFERENT_GENERATOR OR CMAKE_TEST_SYSTEM_LIBRARIES )
SET ( COMPLEX_TEST_CMAKELIB 0 )
ENDIF ( CMAKE_TEST_DIFFERENT_GENERATOR OR CMAKE_TEST_SYSTEM_LIBRARIES )
2009-10-08 19:56:07 +04:00
IF ( BORLAND )
SET ( COMPLEX_TEST_CMAKELIB 0 )
ENDIF ( BORLAND )
2007-05-11 17:02:17 +04:00
ADD_TEST ( complex ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C o m p l e x "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C o m p l e x "
- - b u i l d - t w o - c o n f i g
- - b u i l d - c o n f i g - s a m p l e " $ { C M A K E _ C T E S T _ C O M M A N D } "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t C o m p l e x
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C o m p l e x / b i n "
- - b u i l d - o p t i o n s
2009-10-08 00:11:52 +04:00
- D C O M P L E X _ T E S T _ C M A K E L I B : B O O L = $ { C O M P L E X _ T E S T _ C M A K E L I B }
2009-09-21 23:26:59 +04:00
- D C M A K E _ B U I L D _ T Y P E : S T R I N G = $ { C M A K E _ B U I L D _ T Y P E }
2007-05-11 17:02:17 +04:00
- - t e s t - c o m m a n d c o m p l e x
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( complexOneConfig ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C o m p l e x O n e C o n f i g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C o m p l e x O n e C o n f i g "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t C o m p l e x
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C o m p l e x O n e C o n f i g / b i n "
- - b u i l d - o p t i o n s
2009-10-08 00:11:52 +04:00
- D C O M P L E X _ T E S T _ C M A K E L I B : B O O L = $ { C O M P L E X _ T E S T _ C M A K E L I B }
2009-09-21 23:26:59 +04:00
- D C M A K E _ B U I L D _ T Y P E : S T R I N G = $ { C M A K E _ B U I L D _ T Y P E }
2007-05-11 17:02:17 +04:00
- - t e s t - c o m m a n d c o m p l e x )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig" )
2009-11-04 03:13:40 +03:00
# because of the registry write these tests depend on each other
SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig )
2007-05-11 17:02:17 +04:00
2007-06-12 01:15:00 +04:00
# This fails on VS 70
# works on Xcode and makefiles
# ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND}
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/ConvLibrary"
# "${CMake_BINARY_DIR}/Tests/ConvLibrary"
# --build-two-config
# --build-generator ${CMAKE_TEST_GENERATOR}
# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-project ConvLibrary
# --test-command bartest)
2007-05-11 17:02:17 +04:00
# ADD_TEST(complexRelativePaths ${CMAKE_CTEST_COMMAND}
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"
# "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths"
# --build-generator ${CMAKE_TEST_GENERATOR}
# --build-project complex
# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin"
# --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON
# --test-command complex)
ENDIF ( NOT COMPILER_IS_COMO )
ADD_TEST ( Example ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / E x a m p l e "
" $ { C M a k e _ B I N A R Y _ D I R } / E x a m p l e "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t H E L L O
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / E x a m p l e / D e m o "
- - t e s t - c o m m a n d h e l l o D e m o
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example" )
2007-05-11 17:02:17 +04:00
2008-11-26 22:38:43 +03:00
ADD_TEST ( Environment ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / E n v i r o n m e n t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E n v i r o n m e n t "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t E n v i r o n m e n t P r o j
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E n v i r o n m e n t "
- - f o r c e - n e w - c t e s t - p r o c e s s
2008-12-11 22:35:57 +03:00
- - t e s t - c o m m a n d $ { C M A K E _ C T E S T _ C O M M A N D } - V
2008-11-26 22:38:43 +03:00
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment" )
2008-12-04 21:27:48 +03:00
ADD_TEST ( ExternalProject ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / E x t e r n a l P r o j e c t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E x t e r n a l P r o j e c t "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t E x t e r n a l P r o j e c t T e s t
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E x t e r n a l P r o j e c t "
- - f o r c e - n e w - c t e s t - p r o c e s s
2008-12-11 22:35:57 +03:00
- - t e s t - c o m m a n d $ { C M A K E _ C T E S T _ C O M M A N D } - V
2008-12-04 21:27:48 +03:00
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject" )
2009-06-24 22:48:27 +04:00
# The ExternalProject test takes 900 seconds on some machines!
GET_TEST_PROPERTY ( ExternalProject TIMEOUT PREVIOUS_TIMEOUT )
IF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
SET_TESTS_PROPERTIES ( ExternalProject PROPERTIES TIMEOUT 1000 )
ENDIF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
2008-12-04 21:27:48 +03:00
2007-11-08 18:38:26 +03:00
# do each of the tutorial steps
FOREACH ( STP RANGE 1 7 )
2007-05-18 23:11:20 +04:00
ADD_TEST ( TutorialStep ${ STP } ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T u t o r i a l / S t e p $ { S T P } "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T u t o r i a l / S t e p $ { S T P } "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t T u t o r i a l
- - t e s t - c o m m a n d T u t o r i a l 2 5 . 0 )
ENDFOREACH ( STP )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial" )
2007-05-11 17:02:17 +04:00
2009-01-05 22:14:25 +03:00
ADD_TEST ( testing ${ CMAKE_CTEST_COMMAND } -C \${CTEST_CONFIGURATION_TYPE}
2007-05-11 17:02:17 +04:00
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t i n g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t i n g "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t T e s t i n g
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
2009-01-05 22:14:25 +03:00
- - t e s t - c o m m a n d $ { C M A K E _ C T E S T _ C O M M A N D } - C \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
2007-05-11 17:02:17 +04:00
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( wrapping ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / W r a p p i n g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t W r a p p i n g
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g / b i n "
- - t e s t - c o m m a n d w r a p p i n g
)
2007-11-02 17:46:03 +03:00
ADD_TEST ( qtwrapping ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / W r a p p i n g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t W r a p p i n g
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g / b i n "
2007-05-11 17:02:17 +04:00
- - t e s t - c o m m a n d q t w r a p p i n g
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping" )
2007-05-11 17:02:17 +04:00
ADD_TEST ( testdriver1 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g / b i n "
- - b u i l d - p r o j e c t T e s t D r i v e r T e s t
- - t e s t - c o m m a n d T e s t D r i v e r T e s t t e s t 1
)
ADD_TEST ( testdriver2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g / b i n "
- - b u i l d - p r o j e c t T e s t D r i v e r T e s t
- - t e s t - c o m m a n d T e s t D r i v e r T e s t t e s t 2
)
ADD_TEST ( testdriver3 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g / b i n "
- - b u i l d - p r o j e c t T e s t D r i v e r T e s t
- - t e s t - c o m m a n d T e s t D r i v e r T e s t s u b d i r / t e s t 3
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver" )
2007-05-11 17:02:17 +04:00
2008-02-06 22:52:12 +03:00
ADD_TEST ( Dependency ${ CMAKE_CTEST_COMMAND }
2007-05-11 17:02:17 +04:00
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / D e p e n d e n c y "
2008-02-06 22:52:12 +03:00
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / D e p e n d e n c y "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / D e p e n d e n c y / E x e c "
2007-05-11 17:02:17 +04:00
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t D e p e n d e n c y
- - t e s t - c o m m a n d e x e c
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency" )
2007-05-11 17:02:17 +04:00
2007-11-24 04:45:49 +03:00
IF ( "${CMAKE_SYSTEM_NAME}" MATCHES syllable )
# RPATH isn't supported under Syllable, so the tests don't
# find their libraries. In order to fix that LIBRARY_OUTPUT_DIR
# in the tests would have to be adjusted to ${EXECUTABLE_OUTPUT_DIR}/lib .
# For now we just require on Syllable that the user adjusts the DLL_PATH
# environment variable, so except the two tests below all other tests will succeed.
SET ( _DLL_PATH "$ENV{DLL_PATH}" )
2007-11-26 01:11:29 +03:00
IF ( NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$" )
MESSAGE ( FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \" \\@bindir\\@/.\" to the DLL_PATH environment variable " )
ENDIF ( NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$" )
IF ( NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$" )
MESSAGE ( FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \" \\@bindir\\@/../lib\" to the DLL_PATH environment variable " )
ENDIF ( NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$" )
2007-11-24 04:45:49 +03:00
ELSE ( "${CMAKE_SYSTEM_NAME}" MATCHES syllable )
ADD_TEST ( JumpWithLibOut ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J u m p "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / W i t h L i b O u t "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / W i t h L i b O u t / E x e c u t a b l e "
- - b u i l d - p r o j e c t J u m p
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - o p t i o n s
- D L I B R A R Y _ O U T P U T _ P A T H : P A T H = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / W i t h L i b O u t / L i b
- - t e s t - c o m m a n d j u m p E x e c u t a b l e
)
ADD_TEST ( JumpNoLibOut ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J u m p "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / N o L i b O u t "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / N o L i b O u t / E x e c u t a b l e "
- - b u i l d - r u n - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / N o L i b O u t / E x e c u t a b l e "
- - b u i l d - p r o j e c t J u m p
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - t e s t - c o m m a n d j u m p E x e c u t a b l e
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump" )
2007-11-24 04:45:49 +03:00
ADD_TEST ( Plugin ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / P l u g i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / P l u g i n "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t P l u g i n
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - t e s t - c o m m a n d b i n / e x a m p l e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin" )
2007-11-24 04:45:49 +03:00
2008-01-22 17:15:16 +03:00
IF ( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG )
ADD_TEST_MACRO ( RuntimePath RuntimePath )
ENDIF ( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG )
2007-11-24 04:45:49 +03:00
ENDIF ( "${CMAKE_SYSTEM_NAME}" MATCHES syllable )
2007-05-11 17:02:17 +04:00
ADD_TEST ( linkorder1 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i n k L i n e O r d e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k L i n e O r d e r "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t L i n k L i n e O r d e r
- - t e s t - c o m m a n d E x e c 1
)
ADD_TEST ( linkorder2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i n k L i n e O r d e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k L i n e O r d e r "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t L i n k L i n e O r d e r
- - t e s t - c o m m a n d E x e c 2
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder" )
2008-07-03 22:38:57 +04:00
SET_TESTS_PROPERTIES ( qtwrapping PROPERTIES DEPENDS wrapping )
SET_TESTS_PROPERTIES ( testdriver1 PROPERTIES DEPENDS qtwrapping )
SET_TESTS_PROPERTIES ( testdriver2 PROPERTIES DEPENDS testdriver1 )
SET_TESTS_PROPERTIES ( testdriver3 PROPERTIES DEPENDS testdriver2 )
SET_TESTS_PROPERTIES ( linkorder2 PROPERTIES DEPENDS linkorder1 )
SET_TESTS_PROPERTIES ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall )
2007-05-11 17:02:17 +04:00
IF ( NOT CMAKE_TEST_DIFFERENT_GENERATOR )
ADD_TEST ( kwsys ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / S o u r c e / k w s y s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / k w s y s "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t k w s y s
- - t e s t - c o m m a n d k w s y s T e s t s C x x t e s t I O S
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys" )
2007-05-11 17:02:17 +04:00
ENDIF ( NOT CMAKE_TEST_DIFFERENT_GENERATOR )
SET ( MAKE_IS_GNU )
IF ( ${ CMAKE_TEST_MAKEPROGRAM } MATCHES make )
EXEC_PROGRAM (
2008-02-01 17:36:54 +03:00
$ { C M A K E _ T E S T _ M A K E P R O G R A M } A R G S n o _ s u c h _ t a r g e t - - v e r s i o n
2007-05-11 17:02:17 +04:00
R E T U R N _ V A L U E r e s O U T P U T _ V A R I A B L E o u t
)
IF ( "${res}" EQUAL 0 )
IF ( "${out}" MATCHES "GNU" )
SET ( MAKE_IS_GNU 1 )
ENDIF ( "${out}" MATCHES "GNU" )
ENDIF ( "${res}" EQUAL 0 )
ENDIF ( ${ CMAKE_TEST_MAKEPROGRAM } MATCHES make )
# only add this test on platforms that support it
# some old versions of make simply cannot handle spaces in paths
IF ( MAKE_IS_GNU OR
" $ { C M A K E _ T E S T _ M A K E P R O G R A M } " M A T C H E S " n m a k e | g m a k e | w m a k e " O R
" $ { C M A K E _ T E S T _ G E N E R A T O R } " M A T C H E S " V i s u a l S t u d i o | X C o d e | B o r l a n d " )
ADD_TEST ( SubDirSpaces ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b D i r S p a c e s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r S p a c e s "
- - b u i l d - e x e - d i r
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r S p a c e s / E x e c u t a b l e S o u r c e s "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t S U B D I R
- - t e s t - c o m m a n d t e s t
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r S p a c e s / S h o u l d B e H e r e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r S p a c e s / t e s t f r o m s u b d i r . o b j "
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces" )
2007-05-11 17:02:17 +04:00
ENDIF ( MAKE_IS_GNU OR
" $ { C M A K E _ T E S T _ M A K E P R O G R A M } " M A T C H E S " n m a k e | g m a k e | w m a k e " O R
" $ { C M A K E _ T E S T _ G E N E R A T O R } " M A T C H E S " V i s u a l S t u d i o | X C o d e | B o r l a n d " )
IF ( WIN32 )
ADD_TEST ( SubDir ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b D i r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / E x e c u t a b l e "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t S U B D I R
- - t e s t - c o m m a n d t e s t
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / S h o u l d B e H e r e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / t e s t f r o m s u b d i r . o b j "
)
ELSE ( WIN32 )
ADD_TEST ( SubDir ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b D i r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / E x e c u t a b l e "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t S U B D I R
- - t e s t - c o m m a n d t e s t
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / S h o u l d B e H e r e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / t e s t f r o m s u b d i r . o "
)
ENDIF ( WIN32 )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir" )
2007-05-11 17:02:17 +04:00
IF ( CMAKE_TEST_MSVC )
2007-05-18 23:11:20 +04:00
ADD_TEST_MACRO ( PrecompiledHeader foo )
2009-09-30 00:39:43 +04:00
ADD_TEST_MACRO ( ModuleDefinition example_exe )
2007-05-11 17:02:17 +04:00
ENDIF ( CMAKE_TEST_MSVC )
IF ( "${CMAKE_TEST_GENERATOR}" MATCHES "Makefile" )
ADD_TEST ( MakeClean ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / M a k e C l e a n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / M a k e C l e a n "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t M a k e C l e a n
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / M a k e C l e a n "
- - t e s t - c o m m a n d c h e c k _ c l e a n
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean" )
2007-05-11 17:02:17 +04:00
ENDIF ( "${CMAKE_TEST_GENERATOR}" MATCHES "Makefile" )
IF ( ${ CMAKE_TEST_GENERATOR } MATCHES "Visual Studio" )
ADD_TEST ( VSExternalInclude ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / V S E x t e r n a l I n c l u d e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S E x t e r n a l I n c l u d e "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t V S E x t e r n a l I n c l u d e
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - t e s t - c o m m a n d V S E x t e r n a l I n c l u d e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude" )
2007-05-11 17:02:17 +04:00
ENDIF ( ${ CMAKE_TEST_GENERATOR } MATCHES "Visual Studio" )
IF ( APPLE AND CMAKE_COMPILER_IS_GNUCXX )
SET ( BundleTestInstallDir
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e T e s t / I n s t a l l D i r e c t o r y " )
ADD_TEST ( BundleTest ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u n d l e T e s t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e T e s t "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t B u n d l e T e s t
- - b u i l d - t a r g e t i n s t a l l
# --build-target package
- - b u i l d - o p t i o n s " - D C M A K E _ I N S T A L L _ P R E F I X : P A T H = $ { B u n d l e T e s t I n s t a l l D i r } "
" - D C M a k e _ S O U R C E _ D I R : P A T H = $ { C M A K E _ S O U R C E _ D I R } "
- - t e s t - c o m m a n d
2007-08-24 21:30:41 +04:00
$ { B u n d l e T e s t I n s t a l l D i r } / A p p l i c a t i o n s / S e c o n d B u n d l e E x e . a p p / C o n t e n t s / M a c O S / S e c o n d B u n d l e E x e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest" )
2007-05-11 17:02:17 +04:00
2007-05-11 18:22:20 +04:00
ADD_TEST_MACRO ( ObjC++ ObjC++ )
2007-05-11 17:02:17 +04:00
ENDIF ( APPLE AND CMAKE_COMPILER_IS_GNUCXX )
2008-07-31 00:36:22 +04:00
IF ( APPLE AND CTEST_TEST_CPACK )
ADD_TEST ( BundleGeneratorTest ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u n d l e G e n e r a t o r T e s t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e G e n e r a t o r T e s t "
- - b u i l d - t w o - c o n f i g
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
2008-07-31 18:54:55 +04:00
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - p r o j e c t B u n d l e G e n e r a t o r T e s t
2008-07-31 00:36:22 +04:00
- - b u i l d - t a r g e t p a c k a g e
- - b u i l d - o p t i o n s " - D C M A K E _ I N S T A L L _ P R E F I X : P A T H = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e G e n e r a t o r T e s t / I n s t a l l D i r e c t o r y "
)
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" )
2008-07-31 00:36:22 +04:00
ENDIF ( APPLE AND CTEST_TEST_CPACK )
2009-09-12 00:39:07 +04:00
# Make sure CTest can handle a test with no newline in output.
ADD_TEST ( CTest.NoNewline
$ { C M A K E _ C O M M A N D } - E e c h o _ a p p e n d " T h i s l i n e h a s n o n e w l i n e ! " )
2009-07-12 12:51:51 +04:00
# A simple test for ctest in script mode
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t S c r i p t M o d e / C T e s t T e s t S c r i p t M o d e . c m a k e " @ O N L Y )
2009-07-12 22:52:31 +04:00
# ADD_TEST(CTest.ScriptMode ${CMAKE_CTEST_COMMAND}
# -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake"
# )
2009-07-12 12:51:51 +04:00
2008-10-19 19:53:01 +04:00
SET ( CTEST_TEST_UPDATE 1 )
IF ( CTEST_TEST_UPDATE )
# Test CTest Update with Subversion
FIND_PACKAGE ( Subversion QUIET )
IF ( Subversion_FOUND )
GET_FILENAME_COMPONENT ( _Subversion_BIN_DIR
$ { S u b v e r s i o n _ S V N _ E X E C U T A B L E } P A T H )
FIND_PROGRAM ( Subversion_SVNADMIN_EXECUTABLE svnadmin
H I N T S $ { _ S u b v e r s i o n _ B I N _ D I R }
)
MARK_AS_ADVANCED ( Subversion_SVNADMIN_EXECUTABLE )
IF ( NOT Subversion_SVNADMIN_EXECUTABLE )
SET ( Subversion_FOUND FALSE )
ENDIF ( NOT Subversion_SVNADMIN_EXECUTABLE )
ENDIF ( Subversion_FOUND )
IF ( Subversion_FOUND )
SET ( CTestUpdateSVN_DIR "CTest UpdateSVN" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e S V N . c m a k e " @ O N L Y )
ADD_TEST ( CTest.UpdateSVN ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e S V N . c m a k e "
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}" )
ENDIF ( Subversion_FOUND )
# Test CTest Update with CVS
2009-06-23 00:26:02 +04:00
IF ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
FIND_PACKAGE ( CVS QUIET )
ELSE ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
FIND_PROGRAM ( CVS_EXECUTABLE NAMES cvs )
SET ( CVS_FOUND ${ CVS_EXECUTABLE } )
ENDIF ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
SET ( CTEST_TEST_UPDATE_CVS ${ CVS_FOUND } )
IF ( CTEST_TEST_UPDATE_CVS AND NOT UNIX )
IF ( "${CVS_EXECUTABLE}" MATCHES "cygwin" )
MESSAGE ( STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!" )
SET ( CTEST_TEST_UPDATE_CVS 0 )
ENDIF ( "${CVS_EXECUTABLE}" MATCHES "cygwin" )
ENDIF ( CTEST_TEST_UPDATE_CVS AND NOT UNIX )
2008-10-19 19:53:01 +04:00
IF ( CTEST_TEST_UPDATE_CVS )
SET ( CTestUpdateCVS_DIR "CTest UpdateCVS" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e C V S . c m a k e " @ O N L Y )
ADD_TEST ( CTest.UpdateCVS ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e C V S . c m a k e "
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}" )
2009-06-23 00:26:02 +04:00
ENDIF ( CTEST_TEST_UPDATE_CVS )
2008-10-19 19:53:01 +04:00
2009-05-15 00:13:52 +04:00
# Test CTest Update with BZR
FIND_PROGRAM ( BZR_EXECUTABLE NAMES bzr )
MARK_AS_ADVANCED ( BZR_EXECUTABLE )
2009-07-01 22:29:25 +04:00
SET ( CTEST_TEST_UPDATE_BZR 0 )
2009-05-15 00:13:52 +04:00
IF ( BZR_EXECUTABLE )
2009-07-24 23:58:23 +04:00
IF ( NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
2009-07-01 22:29:25 +04:00
SET ( CTEST_TEST_UPDATE_BZR 1 )
2009-07-24 23:58:23 +04:00
ENDIF ( NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
2009-07-01 22:29:25 +04:00
ENDIF ( BZR_EXECUTABLE )
IF ( CTEST_TEST_UPDATE_BZR )
2009-05-15 00:13:52 +04:00
# Check if xmloutput plugin is there
EXECUTE_PROCESS ( COMMAND ${ BZR_EXECUTABLE } xmlplugins RESULT_VARIABLE xmlplugres
O U T P U T _ Q U I E T E R R O R _ Q U I E T )
IF ( NOT ${ xmlplugres } )
SET ( CTestUpdateBZR_DIR "CTest UpdateBZR" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R . c m a k e " @ O N L Y )
ADD_TEST ( CTest.UpdateBZR ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R . c m a k e "
)
2009-06-25 18:51:53 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}" )
SET ( CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R _ C L o c a l e . c m a k e " @ O N L Y )
2009-05-18 18:34:35 +04:00
ADD_TEST ( CTest.UpdateBZR.CLocale ${ CMAKE_CMAKE_COMMAND }
2009-06-25 18:51:53 +04:00
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R _ C L o c a l e . c m a k e "
2009-05-18 18:34:35 +04:00
)
SET_TESTS_PROPERTIES ( CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C )
2009-05-15 00:13:52 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}" )
ENDIF ( NOT ${ xmlplugres } )
2009-07-01 22:29:25 +04:00
ENDIF ( CTEST_TEST_UPDATE_BZR )
2009-05-15 00:13:52 +04:00
2009-04-22 17:19:06 +04:00
# Test CTest Update with GIT
FIND_PROGRAM ( GIT_EXECUTABLE NAMES git )
MARK_AS_ADVANCED ( GIT_EXECUTABLE )
2009-07-01 22:29:25 +04:00
SET ( CTEST_TEST_UPDATE_GIT 0 )
2009-04-22 17:19:06 +04:00
IF ( GIT_EXECUTABLE )
2009-07-24 23:58:23 +04:00
IF ( NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
2009-07-01 22:29:25 +04:00
SET ( CTEST_TEST_UPDATE_GIT 1 )
2009-07-24 23:58:23 +04:00
ENDIF ( NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
2009-07-01 22:29:25 +04:00
ENDIF ( GIT_EXECUTABLE )
IF ( CTEST_TEST_UPDATE_GIT )
2009-04-22 17:19:06 +04:00
SET ( CTestUpdateGIT_DIR "CTest UpdateGIT" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e G I T . c m a k e " @ O N L Y )
ADD_TEST ( CTest.UpdateGIT ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e G I T . c m a k e "
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}" )
2009-07-01 22:29:25 +04:00
ENDIF ( CTEST_TEST_UPDATE_GIT )
2009-04-22 17:19:06 +04:00
2009-07-10 19:08:05 +04:00
# Test CTest Update with HG
FIND_PROGRAM ( HG_EXECUTABLE NAMES hg )
MARK_AS_ADVANCED ( HG_EXECUTABLE )
SET ( CTEST_TEST_UPDATE_HG 0 )
IF ( HG_EXECUTABLE )
2009-07-24 23:58:23 +04:00
IF ( NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
2009-07-10 19:08:05 +04:00
SET ( CTEST_TEST_UPDATE_HG 1 )
2009-07-24 23:58:23 +04:00
ENDIF ( NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
2009-07-10 19:08:05 +04:00
ENDIF ( HG_EXECUTABLE )
IF ( CTEST_TEST_UPDATE_HG )
SET ( CTestUpdateHG_DIR "CTest UpdateHG" )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e H G . c m a k e " @ O N L Y )
ADD_TEST ( CTest.UpdateHG ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e H G . c m a k e "
)
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}" )
ENDIF ( CTEST_TEST_UPDATE_HG )
2008-10-19 19:53:01 +04:00
ENDIF ( CTEST_TEST_UPDATE )
2009-09-23 19:38:37 +04:00
CONFIGURE_FILE (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o B u i l d . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o B u i l d . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTestNoBuild ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o B u i l d . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t O u t 1 . l o g "
)
SET_TESTS_PROPERTIES ( CTestTestNoBuild PROPERTIES
F A I L _ R E G U L A R _ E X P R E S S I O N " E r r o r " W I L L _ F A I L t r u e )
CONFIGURE_FILE (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o E x e . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o E x e . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTestNoExe ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o E x e . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t O u t 2 . l o g "
)
2009-09-23 22:13:33 +04:00
SET_TESTS_PROPERTIES ( CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild
2009-09-23 19:38:37 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " C o u l d n o t f i n d e x e c u t a b l e "
F A I L _ R E G U L A R _ E X P R E S S I O N " S e g F a u l t " )
CONFIGURE_FILE (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTestCrash ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t O u t p u t . l o g "
)
2009-09-24 22:14:23 +04:00
# with watcom the SEGFAULT is not found, it just fails
IF ( CMAKE_TEST_GENERATOR MATCHES "Watcom WMake" )
SET_TESTS_PROPERTIES ( CTestTestCrash PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " F a i l e d " )
ELSE ( CMAKE_TEST_GENERATOR MATCHES "Watcom WMake" )
SET_TESTS_PROPERTIES ( CTestTestCrash PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " S e g F a u l t " )
ENDIF ( CMAKE_TEST_GENERATOR MATCHES "Watcom WMake" )
2009-09-23 19:38:37 +04:00
CONFIGURE_FILE (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTestParallel ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t O u t p u t . l o g "
)
2009-09-29 23:18:46 +04:00
2009-10-20 21:35:44 +04:00
CONFIGURE_FILE (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTestSubdir ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t O u t p u t . l o g "
)
2009-11-10 18:40:24 +03:00
#make sure all 3 subdirs were added
SET_TESTS_PROPERTIES ( CTestTestSubdir PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " 0 t e s t s f a i l e d o u t o f 3 " )
2009-10-20 21:35:44 +04:00
2009-09-29 23:18:46 +04:00
CONFIGURE_FILE (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t T i m e o u t / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t T i m e o u t / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTestTimeout ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t T i m e o u t / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t T i m e o u t / t e s t O u t p u t . l o g "
2009-09-23 19:38:37 +04:00
)
2009-09-29 23:18:46 +04:00
SET_TESTS_PROPERTIES ( CTestTestTimeout PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " \ \ * \ \ * \ \ * T i m e o u t " )
2009-10-26 20:10:46 +03:00
CONFIGURE_FILE (
2009-10-28 21:11:19 +03:00
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / t e s t . c m a k e . i n "
2009-10-26 20:10:46 +03:00
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
CONFIGURE_FILE (
2009-10-28 21:11:19 +03:00
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / h e l l o . c m a k e . i n "
2009-10-26 20:10:46 +03:00
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / h e l l o . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
2009-10-29 19:46:00 +03:00
ADD_TEST ( CTestTestRunScript ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / t e s t O u t p u t . l o g "
)
2009-10-26 20:10:46 +03:00
2009-09-29 23:18:46 +04:00
ADD_TEST ( CTestTestShowOnly ${ CMAKE_CTEST_COMMAND } -N )
2009-10-26 16:44:08 +03:00
ADD_TEST ( CTestBatchTest ${ CMAKE_CTEST_COMMAND } -B )
2009-10-14 22:18:47 +04:00
# Use macro, not function so that build can still be driven by CMake 2.4.
# After 2.6 is required, this could be a function without the extra 'set'
# calls.
#
macro ( add_failed_submit_test name source build in out log regex )
# Have variables named source, build and drop_method because the
# configure_file call expects those variables to be defined.
#
set ( source "${source}" )
set ( build "${build}" )
2009-10-14 21:32:46 +04:00
configure_file ( "${in}" "${out}" @ONLY )
add_test ( ${ name } ${ CMAKE_CTEST_COMMAND } -S "${out}" -V --output-log "${log}" )
set_tests_properties ( ${ name } PROPERTIES PASS_REGULAR_EXPRESSION "${regex}" )
2009-10-14 22:18:47 +04:00
endmacro ( )
2009-10-14 21:32:46 +04:00
set ( regex "(Problems when submitting via S*CP" )
set ( regex "${regex}|Error message was: " )
2009-10-30 19:08:10 +03:00
set ( regex "${regex}([Cc]ould *n.t resolve host" )
set ( regex "${regex}|[Cc]ould *n.t connect to host" )
2009-10-14 21:32:46 +04:00
set ( regex "${regex}|libcurl was built with SSL disabled. https: not supported)" )
2009-10-16 19:47:51 +04:00
set ( regex "${regex}|Submission method .xmlrpc. not compiled into CTest" )
set ( regex "${regex}|Submission successful)" )
2009-10-14 21:32:46 +04:00
2009-10-15 20:07:14 +04:00
set ( ctest_coverage_labels_args "" )
2009-10-14 21:32:46 +04:00
foreach ( drop_method cp ftp http https scp xmlrpc )
2009-10-15 20:07:14 +04:00
# Cycle through these values each time through the loop:
if ( ctest_coverage_labels_args STREQUAL "" )
set ( ctest_coverage_labels_args "LABELS Everything" )
elseif ( ctest_coverage_labels_args STREQUAL "LABELS Everything" )
set ( ctest_coverage_labels_args "LABELS 0ArgTest" )
else ( )
set ( ctest_coverage_labels_args "" )
endif ( )
2009-10-14 21:32:46 +04:00
add_failed_submit_test ( CTestTestFailedSubmit- ${ drop_method }
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t / S m a l l A n d F a s t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l e d S u b m i t s / $ { d r o p _ m e t h o d } "
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t F a i l e d S u b m i t s / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l e d S u b m i t s / t e s t - $ { d r o p _ m e t h o d } . c m a k e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l e d S u b m i t s / t e s t - $ { d r o p _ m e t h o d } . l o g "
" $ { r e g e x } "
)
endforeach ( )
2007-05-11 17:02:17 +04:00
IF ( CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS )
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t / t e s t . c m a k e " @ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTest ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t / t e s t O u t p u t . l o g "
)
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 2 / t e s t . c m a k e " @ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTest2 ${ CMAKE_CTEST_COMMAND }
2008-12-11 22:35:57 +03:00
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 2 / t e s t . c m a k e " - V
2007-05-11 17:02:17 +04:00
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 2 / t e s t O u t p u t . l o g "
)
CONFIGURE_FILE ( "${CMake_SOURCE_DIR}/Tests/CTestTest3/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 3 / t e s t . c m a k e " @ O N L Y E S C A P E _ Q U O T E S )
ADD_TEST ( CTestTest3 ${ CMAKE_CTEST_COMMAND }
2007-09-21 00:48:06 +04:00
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 3 / t e s t . c m a k e " - V
2007-05-11 17:02:17 +04:00
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 3 / t e s t O u t p u t . l o g "
)
2009-09-18 20:16:46 +04:00
2007-05-11 17:02:17 +04:00
# these tests take a long time, make sure they have it
2008-07-03 22:38:57 +04:00
# if timeouts have not already been set
GET_TEST_PROPERTY ( CTestTest TIMEOUT PREVIOUS_TIMEOUT )
IF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
SET_TESTS_PROPERTIES ( CTestTest
P R O P E R T I E S T I M E O U T $ { C M A K E _ L O N G _ T E S T _ T I M E O U T } )
ENDIF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
GET_TEST_PROPERTY ( CTestTest2 TIMEOUT PREVIOUS_TIMEOUT )
IF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
SET_TESTS_PROPERTIES ( CTestTest2
P R O P E R T I E S T I M E O U T $ { C M A K E _ L O N G _ T E S T _ T I M E O U T } )
ENDIF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
GET_TEST_PROPERTY ( CTestTest3 TIMEOUT PREVIOUS_TIMEOUT )
IF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
SET_TESTS_PROPERTIES ( CTestTest3
P R O P E R T I E S T I M E O U T $ { C M A K E _ L O N G _ T E S T _ T I M E O U T } )
ENDIF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
2007-05-11 17:02:17 +04:00
ENDIF ( CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS )
2009-10-16 02:18:23 +04:00
IF ( CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH )
IF ( UNIX )
IF ( NOT QT4_FOUND )
FIND_PACKAGE ( Qt4 )
ENDIF ( NOT QT4_FOUND )
SET ( TRY_BUILD_KDE4 TRUE )
IF ( QT4_FOUND )
# check whether it's Qt 4.5 in a cmake 2.4. compatible way:
IF ( NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache" )
SET ( TRY_BUILD_KDE4 FALSE )
ENDIF ( NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache" )
ELSE ( QT4_FOUND )
SET ( TRY_BUILD_KDE4 FALSE )
ENDIF ( QT4_FOUND )
FIND_PACKAGE ( Perl )
IF ( NOT PERL_FOUND )
SET ( TRY_BUILD_KDE4 FALSE )
ENDIF ( NOT PERL_FOUND )
FIND_PACKAGE ( ZLIB )
IF ( NOT ZLIB_FOUND )
SET ( TRY_BUILD_KDE4 FALSE )
ENDIF ( NOT ZLIB_FOUND )
IF ( TRY_BUILD_KDE4 )
FILE ( MAKE_DIRECTORY ${ CMake_BINARY_DIR } /Tests/KDE4StableBranchTest )
SET ( TEST_KDE4_BASE_DIR ${ CMake_BINARY_DIR } /Tests/KDE4StableBranchTest )
CONFIGURE_FILE ( ${ CMake_SOURCE_DIR } /Tests/KDE4StableBranchTest/test_kde4.sh.in ${ CMake_BINARY_DIR } /Tests/KDE4StableBranchTest/test_kde4.sh @ONLY )
EXECUTE_PROCESS ( COMMAND chmod 755 ${ CMake_BINARY_DIR } /Tests/KDE4StableBranchTest/test_kde4.sh )
ADD_TEST ( KDE4StableBranchTest ${ CMake_BINARY_DIR } /Tests/KDE4StableBranchTest/test_kde4.sh )
ENDIF ( TRY_BUILD_KDE4 )
ENDIF ( UNIX )
ENDIF ( CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH )
2007-05-11 17:02:17 +04:00
IF ( "${CMAKE_TEST_GENERATOR}" MATCHES Xcode )
SET ( CMAKE_SKIP_BOOTSTRAP_TEST 1 )
ENDIF ( "${CMAKE_TEST_GENERATOR}" MATCHES Xcode )
IF ( EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt" )
# If there is CMakeLists.txt in the binary tree, assume in-source build
SET ( CMAKE_SKIP_BOOTSTRAP_TEST 1 )
ENDIF ( EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt" )
IF ( UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST )
ADD_TEST ( BootstrapTest ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
$ { C M a k e _ S O U R C E _ D I R }
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B o o t s t r a p T e s t
- - b u i l d - n o c m a k e
- - b u i l d - n o c l e a n
- - b u i l d - m a k e p r o g r a m $ { C M a k e _ S O U R C E _ D I R } / b o o t s t r a p
- - b u i l d - g e n e r a t o r " $ { C M A K E _ T E S T _ G E N E R A T O R } "
- - t e s t - c o m m a n d
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B o o t s t r a p T e s t / B o o t s t r a p . c m k / c m a k e )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest" )
2007-05-11 17:02:17 +04:00
# provide more time for the bootstrap test
2008-07-03 22:38:57 +04:00
GET_TEST_PROPERTY ( BootstrapTest TIMEOUT PREVIOUS_TIMEOUT )
IF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
SET_TESTS_PROPERTIES ( BootstrapTest
P R O P E R T I E S T I M E O U T $ { C M A K E _ L O N G _ T E S T _ T I M E O U T } )
ENDIF ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
2007-05-11 17:02:17 +04:00
ENDIF ( UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST )
# fortran does not work for IDE builds because
# CMAKE_STANDARD_LIBRARIES needs to be per language
2007-05-21 18:15:42 +04:00
IF ( CMAKE_TEST_GENERATOR MATCHES "Makefiles"
O R C M A K E _ T E S T _ G E N E R A T O R M A T C H E S " K D e v e l o p " )
2007-05-11 17:02:17 +04:00
# see if we can find a fortran compiler on the machine
# if so, add the fortran test and see if it works.
SET ( CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95
2008-11-18 17:37:06 +03:00
l f 9 5 x l f 9 5 f o r t g f o r t r a n g f o r t r a n - 4 f 9 0 p g f 9 0 x l f 9 0
2007-05-11 17:02:17 +04:00
e p c f 9 0 f 7 7 f o r t 7 7 f r t p g f 7 7 x l f f l 3 2 a f 7 7 g 7 7 )
FIND_PROGRAM ( CMAKE_Fortran_COMPILER_FULLPATH NAMES
$ { C M A K E _ F o r t r a n _ C O M P I L E R _ L I S T } )
MARK_AS_ADVANCED ( CMAKE_Fortran_COMPILER_FULLPATH )
IF ( CMAKE_Fortran_COMPILER_FULLPATH )
ADD_TEST ( Fortran ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / F o r t r a n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / F o r t r a n "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t t e s t f
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - t e s t - c o m m a n d t e s t f )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran" )
2007-05-11 17:02:17 +04:00
ENDIF ( CMAKE_Fortran_COMPILER_FULLPATH )
2007-05-21 18:15:42 +04:00
ENDIF ( CMAKE_TEST_GENERATOR MATCHES "Makefiles"
O R C M A K E _ T E S T _ G E N E R A T O R M A T C H E S " K D e v e l o p " )
2007-06-26 23:15:52 +04:00
2007-05-11 17:02:17 +04:00
IF ( NOT CMAKE_TEST_GENERATOR MATCHES "Xcode" )
INCLUDE ( FindJava )
IF ( JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW )
GET_FILENAME_COMPONENT ( JNIPATH ${ JAVA_COMPILE } PATH )
FIND_FILE ( JNI_H jni.h
" $ { J N I P A T H } / . . / i n c l u d e "
" $ { J N I P A T H } / . . / j a v a / i n c l u d e " )
IF ( JNI_H )
FILE ( READ "${JNI_H}" JNI_FILE )
IF ( "${JNI_FILE}" MATCHES "JDK1_2" )
ADD_TEST ( Java ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J a v a "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J a v a "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t h e l l o
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - t w o - c o n f i g
- - b u i l d - r u n - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J a v a / "
- - t e s t - c o m m a n d $ { J A V A _ R U N T I M E } - c l a s s p a t h h e l l o . j a r H e l l o W o r l d )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java" )
2007-05-11 17:02:17 +04:00
ENDIF ( "${JNI_FILE}" MATCHES "JDK1_2" )
ENDIF ( JNI_H )
ENDIF ( JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW )
ENDIF ( NOT CMAKE_TEST_GENERATOR MATCHES "Xcode" )
2007-06-26 23:30:02 +04:00
# add some cross compiler tests, for now only with makefile based generators
2007-06-26 23:15:52 +04:00
IF ( CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop" )
2007-06-26 23:30:02 +04:00
# if sdcc is found, build the SimpleCOnly project with sdcc
2007-06-26 23:15:52 +04:00
FIND_PROGRAM ( SDCC_EXECUTABLE sdcc )
2007-08-10 00:54:28 +04:00
MARK_AS_ADVANCED ( SDCC_EXECUTABLE )
2007-06-26 23:15:52 +04:00
IF ( SDCC_EXECUTABLE )
2007-06-26 23:30:02 +04:00
ADD_TEST ( SimpleCOnly_sdcc ${ CMAKE_CTEST_COMMAND }
2007-06-26 23:15:52 +04:00
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e C O n l y "
2007-06-26 23:30:02 +04:00
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e C O n l y _ s d c c "
2007-06-26 23:15:52 +04:00
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t S i m p l e C
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - o p t i o n s
" - D C M A K E _ S Y S T E M _ N A M E = G e n e r i c "
" - D C M A K E _ C _ C O M P I L E R = $ { S D C C _ E X E C U T A B L E } " )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" )
2007-06-26 23:15:52 +04:00
ENDIF ( SDCC_EXECUTABLE )
2007-06-26 23:30:02 +04:00
2007-08-08 17:32:44 +04:00
FIND_PROGRAM ( MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc )
FIND_PROGRAM ( MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++ )
2007-08-10 00:54:28 +04:00
MARK_AS_ADVANCED ( MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE )
2007-08-08 17:32:44 +04:00
IF ( MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE )
2007-06-26 23:30:02 +04:00
ADD_TEST ( Simple_Mingw_Linux2Win ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e _ M i n g w _ L i n u x 2 W i n "
- - b u i l d - g e n e r a t o r $ { C M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - p r o j e c t S i m p l e
- - b u i l d - m a k e p r o g r a m $ { C M A K E _ T E S T _ M A K E P R O G R A M }
- - b u i l d - o p t i o n s
" - D C M A K E _ S Y S T E M _ N A M E = W i n d o w s "
2007-08-08 17:32:44 +04:00
" - D C M A K E _ C _ C O M P I L E R = $ { M I N G W _ C C _ L I N U X 2 W I N _ E X E C U T A B L E } "
" - D C M A K E _ C X X _ C O M P I L E R = $ { M I N G W _ C X X _ L I N U X 2 W I N _ E X E C U T A B L E } " )
2008-08-19 19:43:57 +04:00
LIST ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" )
2007-08-08 17:32:44 +04:00
ENDIF ( MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE )
2007-06-26 23:30:02 +04:00
2007-06-26 23:15:52 +04:00
ENDIF ( CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop" )
2007-05-11 17:02:17 +04:00
IF ( UNIX )
STRING ( COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
P R E F I X _ I S _ F O R _ T E S T )
IF ( PREFIX_IS_FOR_TEST )
CONFIGURE_FILE (
$ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t I n s t a l l . s h . i n
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t S h e l l I n s t a l l / T e s t I n s t a l l . s h
@ O N L Y I M M E D I A T E
)
ADD_TEST ( ShellInstall /bin/sh ${ CMake_BINARY_DIR } /Tests/TestShellInstall/TestShellInstall.sh )
ENDIF ( PREFIX_IS_FOR_TEST )
ENDIF ( UNIX )
2007-08-06 22:45:12 +04:00
IF ( CMAKE_TEST_PLPLOT_DIR )
ADD_TEST ( plplot ${ CMAKE_CTEST_COMMAND } -V -S ${ CMAKE_TEST_PLPLOT_DIR } /../../EasyDashboardScripts/plplot.cmake )
2007-08-09 17:57:21 +04:00
SET_TESTS_PROPERTIES ( plplot PROPERTIES TIMEOUT 5400 )
2007-08-06 22:45:12 +04:00
ENDIF ( CMAKE_TEST_PLPLOT_DIR )
IF ( CMAKE_TEST_CHICKEN_DIR )
2007-08-07 18:13:47 +04:00
ADD_TEST ( Chicken ${ CMAKE_CTEST_COMMAND } -V -S ${ CMAKE_TEST_CHICKEN_DIR } /../../EasyDashboardScripts/Chicken.cmake )
2007-08-09 17:57:21 +04:00
SET_TESTS_PROPERTIES ( Chicken PROPERTIES TIMEOUT 5400 )
2007-08-06 22:45:12 +04:00
ENDIF ( CMAKE_TEST_CHICKEN_DIR )
2007-08-08 18:05:11 +04:00
IF ( CMAKE_TEST_KDELIBS_ALPHA_1_DIR )
ADD_TEST ( KDELibsAlpha1 ${ CMAKE_CTEST_COMMAND } -V -S ${ CMAKE_TEST_KDELIBS_ALPHA_1_DIR } /../../EasyDashboardScripts/kdelibs.cmake )
SET_TESTS_PROPERTIES ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400 )
ENDIF ( CMAKE_TEST_KDELIBS_ALPHA_1_DIR )
2008-08-19 19:43:57 +04:00
# If this is not an in-source build, provide a target to wipe out
# all the test build directories.
IF ( NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt" )
CONFIGURE_FILE ( ${ CMake_SOURCE_DIR } /Tests/test_clean.cmake.in
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / t e s t _ c l e a n . c m a k e @ O N L Y )
ADD_CUSTOM_TARGET ( test_clean
C O M M A N D $ { C M A K E _ C O M M A N D } - P $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / t e s t _ c l e a n . c m a k e
C O M M E N T " R e m o v i n g t e s t b u i l d d i r e c t o r i e s . "
)
ENDIF ( NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt" )
2009-10-07 14:33:09 +04:00
ADD_TEST ( CMakeWizardTest ${ CMAKE_CMAKE_COMMAND }
2009-10-06 21:27:13 +04:00
- D b u i l d _ d i r : S T R I N G = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / C M a k e W i z a r d T e s t
- D s o u r c e _ d i r : S T R I N G = $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / T u t o r i a l / S t e p 3
- D C M A K E _ C T E S T _ C O M M A N D : S T R I N G = $ { C M A K E _ C T E S T _ C O M M A N D }
- P $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / C M a k e W i z a r d T e s t . c m a k e )
2007-05-11 17:02:17 +04:00
ENDIF ( BUILD_TESTING )
2007-05-11 18:22:20 +04:00
2007-05-14 16:59:09 +04:00
SUBDIRS ( CMakeTests )