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
2012-08-13 21:47:32 +04:00
macro ( ADD_TEST_MACRO NAME COMMAND )
string ( REPLACE "." "/" dir "${NAME}" )
string ( REGEX REPLACE "[^.]*\\." "" proj "${NAME}" )
add_test ( ${ NAME } ${ CMAKE_CTEST_COMMAND }
2007-05-11 18:22:20 +04:00
- - b u i l d - a n d - t e s t
2009-12-17 23:14:14 +03:00
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / $ { d i r } "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / $ { d i r } "
2007-05-11 18:22:20 +04:00
- - b u i l d - t w o - c o n f i g
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2009-12-17 23:14:14 +03:00
- - b u i l d - p r o j e c t $ { p r o j }
2011-05-19 16:11:34 +04:00
$ { $ { N A M E } _ E X T R A _ O P T I O N S }
2010-09-21 18:23:09 +04:00
- - t e s t - c o m m a n d $ { C O M M A N D } $ { A R G N } )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}" )
2012-08-13 21:50:14 +04:00
endmacro ( )
2007-05-11 18:22:20 +04:00
2013-06-03 18:42:12 +04:00
include ( ${ CMAKE_CURRENT_SOURCE_DIR } /RegexEscapeString.cmake )
2012-02-27 18:00:46 +04:00
2012-08-13 21:47:32 +04:00
include ( ${ CMAKE_CURRENT_SOURCE_DIR } /CheckFortran.cmake )
2011-08-04 01:24:43 +04:00
2009-11-24 20:15:33 +03:00
# Fake a user home directory to avoid polluting the real one.
2012-08-13 21:47:32 +04:00
if ( DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME )
set ( TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome" )
file ( MAKE_DIRECTORY "${TEST_HOME}" )
file ( WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n" )
set ( TEST_HOME_ENV_CODE " # Fake a user home directory to avoid polluting the real one.
2010-10-08 23:09:24 +04:00
# But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that
# need access to the real HOME directory.
2012-08-13 21:47:32 +04:00
set ( ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
set ( ENV{HOME} \"${TEST_HOME}\")
2010-10-08 23:09:24 +04:00
" )
2012-08-13 21:47:32 +04:00
endif ( )
2009-11-24 20:15:33 +03:00
2009-12-01 17:12:07 +03:00
# Choose a default configuration for CTest tests.
2012-08-13 21:47:32 +04:00
set ( CTestTest_CONFIG Debug )
if ( NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE )
set ( CTestTest_CONFIG ${ CMAKE_BUILD_TYPE } )
endif ( )
2009-12-01 17:12:07 +03:00
2012-08-13 21:47:32 +04:00
configure_file ( ${ CMake_SOURCE_DIR } /Tests/EnforceConfig.cmake.in
2009-01-05 22:14:25 +03:00
$ { 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 )
2008-12-18 22:26:20 +03:00
2007-05-11 17:02:17 +04:00
# Testing
2012-08-13 21:47:32 +04:00
if ( BUILD_TESTING )
if ( "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ( "${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32 ) )
set ( TEST_CompileCommandOutput 1 )
endif ( )
2011-04-25 21:16:01 +04:00
2013-02-22 17:14:18 +04:00
set ( MAKE_IS_GNU )
if ( ${ CMAKE_TEST_MAKEPROGRAM } MATCHES make )
execute_process ( COMMAND ${ CMAKE_TEST_MAKEPROGRAM } no_such_target --version
R E S U L T _ V A R I A B L E r e s O U T P U T _ V A R I A B L E o u t E R R O R _ V A R I A B L E o u t )
if ( "${res}" STREQUAL "0" )
if ( "${out}" MATCHES "GNU" )
set ( MAKE_IS_GNU 1 )
endif ( )
endif ( )
endif ( )
# 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 " )
set ( MAKE_SUPPORTS_SPACES 1 )
else ( )
set ( MAKE_SUPPORTS_SPACES 0 )
endif ( )
2013-02-06 01:09:55 +04:00
set ( build_generator_args
- - 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 }
)
2013-02-06 01:10:36 +04:00
if ( CMAKE_TEST_GENERATOR_TOOLSET )
list ( APPEND build_generator_args
- - b u i l d - g e n e r a t o r - t o o l s e t $ { C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T }
)
endif ( )
2013-02-06 01:09:55 +04:00
2012-08-13 21:47:32 +04:00
add_subdirectory ( CMakeLib )
add_subdirectory ( CMakeOnly )
add_subdirectory ( RunCMake )
2009-12-08 19:44:50 +03:00
2012-08-13 21:47:32 +04:00
add_subdirectory ( FindPackageModeMakefileTest )
2011-08-12 01:27:19 +04:00
2012-09-30 20:21:18 +04:00
add_subdirectory ( CTestTestMemcheck )
2008-08-19 19:43:57 +04:00
# Collect a list of all test build directories.
2012-08-13 21:47:32 +04:00
set ( TEST_BUILD_DIRS )
2008-08-19 19:43:57 +04:00
2007-05-11 17:02:17 +04:00
# Should the long tests be run?
2012-08-13 21:47:32 +04:00
option ( CMAKE_RUN_LONG_TESTS
2007-05-11 17:02:17 +04:00
" 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 )
2012-08-13 21:47:32 +04:00
mark_as_advanced ( CMAKE_RUN_LONG_TESTS )
2008-06-17 19:39:26 +04:00
2012-08-13 21:47:32 +04:00
if ( CMAKE_RUN_LONG_TESTS )
option ( CTEST_TEST_CTEST
2011-01-03 22:41:25 +03:00
" 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 ? "
2007-05-11 17:02:17 +04:00
O F F )
2012-08-13 21:47:32 +04:00
mark_as_advanced ( CTEST_TEST_CTEST )
2012-08-13 21:50:14 +04:00
endif ( )
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 )
2012-08-13 21:50:14 +04:00
else ( )
2009-07-25 02:30:00 +04:00
find_program ( CVS_EXECUTABLE NAMES cvs )
2012-08-13 21:50:14 +04:00
endif ( )
2009-07-24 23:58:23 +04:00
2009-07-25 02:30:00 +04:00
if ( CVS_EXECUTABLE )
set ( do_cvs_tests 1 )
2012-08-13 21:50:14 +04:00
endif ( )
2009-07-25 02:30:00 +04:00
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 )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
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.
#
2012-08-13 21:47:32 +04:00
option ( CTEST_TEST_CPACK
2008-06-17 19:39:26 +04:00
" 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 )
2012-08-13 21:47:32 +04:00
mark_as_advanced ( CTEST_TEST_CPACK )
set ( CTEST_TEST_OSX_ARCH 0 )
if ( APPLE )
execute_process (
2008-06-17 19:39:26 +04:00
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
)
2012-08-13 21:47:32 +04:00
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 )
2012-08-13 21:50:14 +04:00
else ( )
2012-08-13 21:47:32 +04:00
set ( CTEST_TEST_OSX_ARCH 1 )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
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.
2012-08-13 21:47:32 +04:00
set ( CMAKE_LONG_TEST_TIMEOUT 1500 )
if ( CTEST_TEST_TIMEOUT )
set ( CMAKE_LONG_TEST_TIMEOUT ${ CTEST_TEST_TIMEOUT } )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
if ( CMAKE_LONG_TEST_TIMEOUT LESS 1500 )
set ( CMAKE_LONG_TEST_TIMEOUT 1500 )
2012-08-13 21:50:14 +04:00
endif ( )
2008-04-19 21:37:38 +04:00
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 )
2010-12-28 18:58:20 +03:00
# assume no resources building to test
2012-08-13 21:47:32 +04:00
set ( TEST_RESOURCES FALSE )
2010-12-28 18:58:20 +03:00
# for windows and cygwin assume we have resources
2012-08-13 21:47:32 +04:00
if ( WIN32 OR CYGWIN )
set ( TEST_RESOURCES TRUE )
endif ( )
2010-12-28 18:58:20 +03:00
# for borland and watcom there is no resource support
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR
2011-01-26 23:52:22 +03:00
" $ { 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 " B o r l a n d " )
2012-08-13 21:47:32 +04:00
set ( TEST_RESOURCES FALSE )
endif ( )
if ( TEST_RESOURCES )
2010-12-23 00:14:37 +03:00
ADD_TEST_MACRO ( VSResource VSResource )
2012-08-13 21:47:32 +04:00
endif ( )
2007-05-11 18:22:20 +04:00
ADD_TEST_MACRO ( Simple Simple )
ADD_TEST_MACRO ( PreOrder PreOrder )
2010-09-13 23:56:06 +04:00
ADD_TEST_MACRO ( MissingSourceFile MissingSourceFile )
2012-08-13 21:47:32 +04:00
set_tests_properties ( MissingSourceFile PROPERTIES
2011-01-15 16:16:50 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " C M a k e E r r o r a t C M a k e L i s t s . t x t : 3 \ \ ( a d d _ e x e c u t a b l e \ \ ) : [ \ r \ n ] * C a n n o t f i n d s o u r c e f i l e : [ \ r \ n ] * D o e s N o t E x i s t / M i s s i n g S o u r c e F i l e . c " )
2012-08-13 21:47:32 +04:00
if ( CMAKE_Fortran_COMPILER )
2011-08-04 01:24:43 +04:00
ADD_TEST_MACRO ( FortranOnly FortranOnly )
2012-08-13 21:47:32 +04:00
endif ( )
2011-12-10 03:04:19 +04:00
# test Visual Studio GNU Fortran mixing with cmake_add_fortran_subdirectory
# run this project if we have a working fortran compiler or
# the test is enabled with CMAKE_TEST_CMAKE_ADD_FORTRAN cache variable.
# If you enable the test, CMake should find the MinGW fortran install,
# or in some cases you might need to set the PATH so that cmake can find
# the gfortran from mingw.
2012-08-13 21:47:32 +04:00
if ( CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN )
set ( CMAKE_SKIP_VSGNUFortran FALSE )
2011-12-17 03:20:46 +04:00
# disable test for apple builds using ifort if they are building
# more than one architecture, as ifort does not support that.
2012-08-13 21:47:32 +04:00
if ( APPLE AND ( CMAKE_Fortran_COMPILER MATCHES ifort ) )
list ( LENGTH CMAKE_OSX_ARCHITECTURES len )
if ( "${len}" GREATER 1 )
message ( STATUS "Skip VSGNUFortran for ifort dual cpu mac build" )
set ( CMAKE_SKIP_VSGNUFortran TRUE )
endif ( )
endif ( )
if ( ( CMAKE_C_COMPILER MATCHES lsb )
2011-12-17 03:20:46 +04:00
AND ( CMAKE_Fortran_COMPILER MATCHES ifort ) )
2012-08-13 21:47:32 +04:00
message ( STATUS "Skip VSGNUFortran for ifort and lsb compilers" )
set ( CMAKE_SKIP_VSGNUFortran TRUE )
endif ( )
if ( NOT CMAKE_SKIP_VSGNUFortran )
2011-12-17 03:20:46 +04:00
ADD_TEST_MACRO ( VSGNUFortran ${ CMAKE_COMMAND } -P runtest.cmake )
2012-08-13 21:47:32 +04:00
endif ( )
endif ( )
2007-05-11 18:22:20 +04:00
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 )
2012-03-12 22:41:34 +04:00
ADD_TEST_MACRO ( ObjectLibrary UseCshared )
2007-05-11 18:22:20 +04:00
ADD_TEST_MACRO ( NewlineArgs NewlineArgs )
ADD_TEST_MACRO ( SetLang SetLang )
2013-07-23 01:19:55 +04:00
ADD_TEST_MACRO ( EmptyProperty EmptyProperty )
2007-05-18 23:11:20 +04:00
ADD_TEST_MACRO ( ExternalOBJ ExternalOBJ )
ADD_TEST_MACRO ( LoadCommand LoadedCommand )
2009-11-24 19:17:16 +03:00
ADD_TEST_MACRO ( LinkDirectory bin/LinkDirectory )
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 )
2010-09-30 19:01:35 +04:00
ADD_TEST_MACRO ( EmptyLibrary EmptyLibrary )
2012-08-09 11:44:15 +04:00
ADD_TEST_MACRO ( CompileDefinitions CompileDefinitions )
2013-05-16 17:15:28 +04:00
ADD_TEST_MACRO ( CompileOptions CompileOptions )
2013-01-19 14:21:14 +04:00
ADD_TEST_MACRO ( CompatibleInterface CompatibleInterface )
2013-07-12 11:14:31 +04:00
ADD_TEST_MACRO ( AliasTarget AliasTarget )
2012-11-02 18:47:40 +04:00
ADD_TEST_MACRO ( InterfaceLibrary InterfaceLibrary )
2012-08-13 21:47:32 +04:00
set_tests_properties ( EmptyLibrary PROPERTIES
2013-06-21 15:51:58 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " C M a k e E r r o r : C M a k e c a n n o t d e t e r m i n e l i n k e r l a n g u a g e f o r t a r g e t : t e s t " )
2009-11-09 19:14:21 +03:00
ADD_TEST_MACRO ( CrossCompile CrossCompile )
2012-08-13 21:47:32 +04:00
set_tests_properties ( CrossCompile PROPERTIES
2009-11-09 20:05:49 +03:00
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 " )
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_TEST_GENERATOR}" MATCHES "Make" )
2009-09-29 01:34:34 +04:00
ADD_TEST_MACRO ( Policy0002 Policy0002 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
if ( CTEST_TEST_OSX_ARCH )
2009-10-21 21:01:17 +04:00
ADD_TEST_MACRO ( Architecture Architecture )
2012-08-13 21:47:32 +04:00
set_tests_properties ( Architecture PROPERTIES
2010-05-06 22:37:55 +04:00
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 | n o t t h e a r c h i t e c t u r e b e i n g l i n k e d ) " )
2012-08-13 21:50:14 +04:00
endif ( )
2008-01-30 20:04:38 +03:00
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS ${ CMake_TEST_INSTALL_PREFIX } )
2009-12-10 18:34:36 +03:00
2012-08-13 21:47:32 +04:00
if ( NOT QT4_FOUND )
2013-10-03 21:10:31 +04:00
find_package ( Qt4 QUIET )
2012-08-13 21:50:14 +04:00
endif ( )
2011-05-27 01:16:58 +04:00
2012-08-13 21:47:32 +04:00
if ( QT4_FOUND )
2012-02-24 19:09:17 +04:00
# test whether the Qt4 which has been found works, on some machines
# which run nightly builds there were errors like "wrong file format"
# for libQtCore.so. So first check it works, and only if it does add
# the automoc test.
2012-08-13 21:47:32 +04:00
include ( CheckCXXSourceCompiles )
set ( _save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}" )
set ( _save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" )
2012-02-24 19:09:17 +04:00
2012-08-13 21:47:32 +04:00
set ( CMAKE_REQUIRED_INCLUDES ${ QT_INCLUDES } )
set ( CMAKE_REQUIRED_LIBRARIES ${ QT_QTCORE_LIBRARIES } )
2012-02-24 19:09:17 +04:00
CHECK_CXX_SOURCE_COMPILES ( "#include <QCoreApplication>\n int main() {return (qApp == 0 ? 0 : 1); }\n"
Q T 4 _ W O R K S )
2012-08-13 21:47:32 +04:00
set ( CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}" )
set ( CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}" )
endif ( )
2011-05-27 01:16:58 +04:00
2011-06-01 08:15:34 +04:00
# run test for BundleUtilities on supported platforms/compilers
2011-06-02 19:09:14 +04:00
if ( MSVC OR
2013-03-01 19:26:07 +04:00
MINGW O R
2011-05-27 01:16:58 +04:00
C M A K E _ S Y S T E M _ N A M E M A T C H E S " L i n u x " O R
C M A K E _ S Y S T E M _ N A M E M A T C H E S " D a r w i n " )
2011-06-05 03:52:45 +04:00
if ( NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake" )
2012-01-21 03:30:35 +04:00
2012-08-13 21:47:32 +04:00
add_test ( BundleUtilities ${ CMAKE_CTEST_COMMAND }
2011-05-27 01:16:58 +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 / B u n d l e U t i l i t i e s "
" $ { 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 U t i l i t i e s "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-05-27 01:16:58 +04:00
- - b u i l d - p r o j e c t B u n d l e U t i l i t i e s
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities" )
2012-01-21 03:30:35 +04:00
# run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities)
# this test also depends on the existence of the standard qtiff plugin
2012-02-29 18:55:31 +04:00
if ( QT4_WORKS AND QT_QTSQL_FOUND )
2012-08-13 21:47:32 +04:00
add_test ( Qt4Deploy ${ CMAKE_CTEST_COMMAND }
2012-01-21 03:30:35 +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 / Q t 4 D e p l o y "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / Q t 4 D e p l o y "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-01-21 03:30:35 +04:00
- - b u i l d - p r o j e c t Q t 4 D e p l o y
- - b u i l d - o p t i o n s
- 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 }
2012-02-24 19:09:17 +04:00
- D Q T _ Q M A K E _ E X E C U T A B L E : F I L E P A T H = $ { Q T _ Q M A K E _ E X E C U T A B L E }
2012-01-21 03:30:35 +04:00
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy" )
2012-01-21 03:30:35 +04:00
endif ( )
2011-06-05 03:52:45 +04:00
endif ( )
endif ( )
2011-05-27 01:16:58 +04:00
2012-08-13 21:47:32 +04:00
set ( CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly" )
set ( CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly" )
set ( CMAKE_BUILD_TEST_EXE COnly )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
2008-10-15 21:56:07 +04:00
" $ { 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 )
2012-08-13 21:47:32 +04:00
add_test ( CMakeBuildTest ${ CMAKE_CMAKE_COMMAND } -P
2008-10-15 21:56:07 +04:00
" $ { 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 " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS ${ CMAKE_BUILD_TEST_BINARY_DIR } )
2011-12-16 06:56:34 +04:00
# now do it again for a project that has two project commands
2012-08-13 21:47:32 +04:00
set ( CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject" )
set ( CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject" )
set ( CMAKE_BUILD_TEST_EXE just_silly )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
2011-12-16 06:56:34 +04:00
" $ { 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 D o u b l e P r o j e c t T e s t . c m a k e " @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CMakeDoubleProject ${ CMAKE_CMAKE_COMMAND } -P
2011-12-16 06:56:34 +04:00
" $ { 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 D o u b l e P r o j e c t T e s t . c m a k e " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS ${ CMAKE_BUILD_TEST_BINARY_DIR } )
2008-08-07 00:16:53 +04:00
2009-12-17 23:15:34 +03:00
ADD_TEST_MACRO ( Module.CheckTypeSize CheckTypeSize )
2013-01-26 01:39:57 +04:00
add_test ( Module.ExternalData ${ 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 o d u l e / E x t e r n a l D a t a "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / M o d u l e / E x t e r n a l D a t a "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2013-01-26 01:39:57 +04:00
- - b u i l d - p r o j e c t E x t e r n a l D a t a T e s t
2013-02-03 20:44:05 +04:00
- - b u i l d - n o c l e a n
2013-01-26 01:39:57 +04:00
- - f o r c e - n e w - c t e s t - p r o c e s s
2013-02-21 18:59:29 +04:00
- - b u i l d - o p t i o n s - D M A K E _ S U P P O R T S _ S P A C E S = $ { M A K E _ S U P P O R T S _ S P A C E S }
2013-01-26 01:39:57 +04: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 } - V
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Module/ExternalData" )
2011-07-13 04:13:33 +04:00
ADD_TEST_MACRO ( Module.GenerateExportHeader GenerateExportHeader )
2012-05-30 22:13:09 +04:00
if ( APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
include ( CheckCXXCompilerFlag )
check_cxx_compiler_flag ( -fPIE run_pic_test )
else ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "PGI"
O R C M A K E _ C X X _ C O M P I L E R _ I D M A T C H E S " P a t h S c a l e "
O R C M A K E _ S Y S T E M _ N A M E M A T C H E S " I R I X 6 4 "
O R C M A K E _ C X X _ C O M P I L E R _ I D M A T C H E S " I n t e l " )
set ( run_pic_test 0 )
else ( )
set ( run_pic_test 1 )
endif ( )
endif ( )
if ( run_pic_test )
ADD_TEST_MACRO ( PositionIndependentTargets PositionIndependentTargets )
endif ( )
2012-08-13 21:47:32 +04:00
add_test ( LinkFlags-prepare
2010-05-28 17:47:12 +04:00
$ { 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 }
- - 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 F l a g s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k F l a g s "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-05-28 17:47:12 +04:00
- - b u i l d - p r o j e c t L i n k F l a g s
- - b u i l d - t a r g e t L i n k F l a g s
- - b u i l d - o p t i o n s - D T E S T _ C O N F I G = \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags" )
2010-05-28 17:47:12 +04:00
2012-08-13 21:47:32 +04:00
macro ( ADD_LINK_FLAGS_TEST name depends )
add_test ( LinkFlags- ${ name }
2010-05-28 17:47:12 +04:00
$ { C M A K E _ C M A K E _ C O M M A N D } - - b u i l d " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k F l a g s "
- - t a r g e t L i n k F l a g s _ $ { n a m e } - - c o n f i g \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( LinkFlags- ${ name } PROPERTIES
2010-05-28 17:47:12 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " B A D F L A G " D E P E N D S L i n k F l a g s - $ { d e p e n d s } )
2012-08-13 21:47:32 +04:00
endmacro ( )
2010-05-28 17:47:12 +04:00
ADD_LINK_FLAGS_TEST ( lib prepare )
ADD_LINK_FLAGS_TEST ( dll lib )
2013-07-28 22:34:16 +04:00
ADD_LINK_FLAGS_TEST ( mod dll )
ADD_LINK_FLAGS_TEST ( exe mod )
2010-05-28 17:47:12 +04:00
ADD_LINK_FLAGS_TEST ( lib_config exe )
ADD_LINK_FLAGS_TEST ( dll_config lib_config )
2013-07-28 22:34:16 +04:00
ADD_LINK_FLAGS_TEST ( mod_config dll_config )
ADD_LINK_FLAGS_TEST ( exe_config mod_config )
ADD_LINK_FLAGS_TEST ( lib_flags exe_config )
ADD_LINK_FLAGS_TEST ( dll_flags lib_flags )
ADD_LINK_FLAGS_TEST ( mod_flags dll_flags )
ADD_LINK_FLAGS_TEST ( exe_flags mod_flags )
ADD_LINK_FLAGS_TEST ( lib_flags_config exe_flags )
ADD_LINK_FLAGS_TEST ( dll_flags_config lib_flags_config )
ADD_LINK_FLAGS_TEST ( mod_flags_config dll_flags_config )
ADD_LINK_FLAGS_TEST ( exe_flags_config mod_flags_config )
2010-05-28 17:47:12 +04:00
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
2011-01-03 22:41:25 +03:00
# This doesn't test whether the generated project files work (unfortunately),
2008-08-07 00:16:53 +04:00
# mainly it tests that cmake doesn't crash when generating these project files.
2012-08-13 21:47:32 +04:00
if ( ${ CMAKE_TEST_GENERATOR } MATCHES "Unix Makefiles" OR ${ CMAKE_TEST_GENERATOR } MATCHES "KDevelop" )
2008-08-07 00:16:53 +04:00
# check which generators we have
2013-02-22 17:08:12 +04:00
execute_process ( COMMAND ${ CMAKE_CMAKE_COMMAND } --help
O U T P U T _ V A R I A B L E c m a k e O u t p u t E R R O R _ V A R I A B L E c m a k e O u t p u t )
2008-08-07 00:16:53 +04:00
# check for the Eclipse generator
2012-08-13 21:47:32 +04:00
if ( "${cmakeOutput}" MATCHES Eclipse )
add_test ( Simple_EclipseGenerator ${ CMAKE_CTEST_COMMAND }
2008-08-07 00:16:53 +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 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 "
2013-02-06 01:10:36 +04:00
- - b u i l d - g e n e r a t o r - t o o l s e t " $ { C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T } "
2008-08-07 00:16:53 +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 S i m p l e
- - t e s t - c o m m a n d S i m p l e )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-08-07 00:16:53 +04:00
# check for the CodeBlocks generator
2012-08-13 21:47:32 +04:00
if ( "${cmakeOutput}" MATCHES CodeBlocks )
add_test ( Simple_CodeBlocksGenerator ${ CMAKE_CTEST_COMMAND }
2008-08-07 00:16:53 +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 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 "
2013-02-06 01:10:36 +04:00
- - b u i l d - g e n e r a t o r - t o o l s e t " $ { C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T } "
2008-08-07 00:16:53 +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 S i m p l e
- - t e s t - c o m m a n d S i m p l e )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-08-07 00:16:53 +04:00
# check for the KDevelop3 generator
2012-08-13 21:47:32 +04:00
if ( "${cmakeOutput}" MATCHES KDevelop3 )
add_test ( Simple_KDevelop3Generator ${ CMAKE_CTEST_COMMAND }
2008-08-07 00:16:53 +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 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 "
2013-02-06 01:10:36 +04:00
- - b u i l d - g e n e r a t o r - t o o l s e t " $ { C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T } "
2008-08-07 00:16:53 +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 S i m p l e
- - t e s t - c o m m a n d S i m p l e )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-08-07 00:16:53 +04:00
2012-08-13 21:50:14 +04:00
endif ( )
2008-08-07 00:16:53 +04:00
2008-01-30 20:04:38 +03:00
# test for correct sub-project generation
# not implemented in VS6 or Xcode
2012-08-13 21:47:32 +04: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
2012-08-13 21:47:32 +04:00
add_test ( SubProject ${ CMAKE_CTEST_COMMAND }
2008-01-30 20:04:38 +03: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 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2008-01-30 20:04:38 +03:00
- - 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
)
2011-11-11 09:00:49 +04:00
2012-08-13 21:47:32 +04:00
if ( ${ CMAKE_TEST_GENERATOR } MATCHES "Ninja" )
2011-11-11 09:00:49 +04:00
# The Ninja generator does not create a recursive build system. Start
# from the root directory.
2012-08-13 21:47:32 +04:00
set ( SubProject_SUBDIR )
else ( )
set ( SubProject_SUBDIR "/foo" )
endif ( )
2011-11-11 09:00:49 +04:00
2008-01-30 20:04:38 +03:00
# 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
2012-08-13 21:47:32 +04:00
add_test ( SubProject-Stage2 ${ CMAKE_CTEST_COMMAND }
2008-01-30 20:04:38 +03:00
- - b u i l d - a n d - t e s t
2011-11-11 09:00:49 +04:00
" $ { 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 $ { S u b P r o j e c t _ 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 P r o j e c t $ { S u b P r o j e c t _ S U B D I R } "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-01-03 22:41:25 +03:00
- - b u i l d - n o c m a k e
2008-01-30 20:04:38 +03:00
- - 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
2011-11-11 09:00:49 +04:00
- - 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 P r o j e c t / f o o "
2008-01-30 20:04:38 +03:00
- - t e s t - c o m m a n d f o o
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-01-30 20:04:38 +03:00
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
2012-08-13 21:47:32 +04:00
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"
2009-09-23 20:45:39 +04:00
" c d $ { _ T E S T _ D I R }
2011-01-07 21:50:36 +03:00
$ { 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 = n i g h t l y - 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 }
2010-02-25 21:20:12 +03: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 = m a s t e r - 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
" )
2012-08-13 21:47:32 +04:00
add_test ( ${ name } /bin/sh ${ _TEST_DIR } /nightly-cmake.sh )
if ( COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY )
set_tests_properties ( ${ name } PROPERTIES TIMEOUT ${ CMAKE_LONG_TEST_TIMEOUT } )
2012-08-13 21:50:14 +04:00
endif ( )
endmacro ( )
2012-08-13 21:47:32 +04:00
if ( CMAKE_BUILD_NIGHTLY_RELEASES )
2009-09-23 20:45:39 +04:00
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 )
2011-09-14 20:45:55 +04:00
ADD_NIGHTLY_BUILD_TEST ( CMakeNightlyMac64
d a s h m a c m i n i 5 _ r e l e a s e . c m a k e )
2009-09-23 20:45:39 +04:00
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 )
2012-08-13 21:50:14 +04:00
endif ( )
2007-10-10 19:06:15 +04:00
2007-05-18 23:11:20 +04:00
# add tests with more complex invocations
2012-08-13 21:47:32 +04:00
add_test ( Framework ${ CMAKE_CTEST_COMMAND }
2007-10-10 19:06:15 +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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-10-10 19:06:15 +04:00
- - 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework" )
2007-10-10 19:06:15 +04:00
2012-08-13 21:47:32 +04:00
add_test ( TargetName ${ 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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - b u i l d - p r o j e c t T a r g e t N a m e
2011-01-03 22:41:25 +03: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 } - E c o m p a r e _ f i l e s
2007-05-11 17:02:17 +04:00
$ { 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( LibName ${ 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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-01-03 22:41:25 +03:00
- - b u i l d - p r o j e c t L i b N a m e
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( CustComDepend ${ 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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-01-03 22:41:25 +03:00
- - 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
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( ArgumentExpansion ${ CMAKE_CTEST_COMMAND }
2010-10-07 20:29:43 +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 / A r g u m e n t E x p a n s i o n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / A r g u m e n t E x p a n s i o n "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-10-07 20:29:43 +04:00
- - b u i l d - p r o j e c t A r g u m e n t E x p a n s i o n
- - 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 / A r g u m e n t E x p a n s i o n / b i n "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( ArgumentExpansion PROPERTIES
2011-01-12 01:10:28 +03:00
F A I L _ R E G U L A R _ E X P R E S S I O N " U n e x p e c t e d : " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion" )
2010-10-07 20:29:43 +04:00
2012-08-13 17:49:53 +04:00
add_test ( GeneratorExpression ${ 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 / G e n e r a t o r E x p r e s s i o n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / G e n e r a t o r E x p r e s s i o n "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-08-13 17:49:53 +04:00
- - b u i l d - p r o j e c t G e n e r a t o r E x p r e s s i o n
2012-11-01 17:21:25 +04:00
- - b u i l d - o p t i o n s - D C M A K E _ B U I L D _ T Y P E = \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
2013-08-08 01:07:30 +04: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 } - V
2012-08-13 17:49:53 +04:00
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression" )
2012-08-13 21:47:32 +04:00
add_test ( CustomCommand ${ 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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand" )
2007-05-11 17:02:17 +04:00
2012-11-21 19:23:17 +04:00
ADD_TEST_MACRO ( EmptyDepends ${ CMAKE_CTEST_COMMAND } )
2012-08-13 21:47:32 +04:00
add_test ( CustomCommandWorkingDirectory ${ 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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
- - t e s t - c o m m a n d w o r k i n g
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
#add_test(SimpleExclude ${CMAKE_CTEST_COMMAND}
2007-05-11 20:17:27 +04:00
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/SimpleExclude"
# "${CMake_BINARY_DIR}/Tests/SimpleExclude"
2013-02-06 01:09:55 +04:00
# ${build_generator_args}
2007-05-11 20:17:27 +04:00
# --build-project SimpleExclude
# --build-two-config
# --test-command t4
2007-05-11 17:02:17 +04:00
#--test-command "${CMAKE_COMMAND}"
#"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
2010-07-29 18:59:27 +04:00
#-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
2007-05-11 20:17:27 +04:00
#)
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
# add_test(SameName ${CMAKE_CTEST_COMMAND}
2007-05-11 17:02:17 +04:00
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/SameName"
# "${CMake_BINARY_DIR}/Tests/SameName"
2013-02-06 01:09:55 +04:00
# ${build_generator_args}
2007-05-11 17:02:17 +04:00
# --build-project SameName
# --build-two-config
# --test-command
# "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
2012-08-13 21:47:32 +04:00
add_test ( OutOfSource ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 - 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 " )
2012-08-13 21:47:32 +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
2012-08-13 21:47:32 +04:00
add_test ( BuildDepends ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - b u i l d - p r o j e c t B u i l d D e p e n d s
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends" )
2011-01-03 22:41:25 +03:00
2012-08-13 21:47:32 +04:00
set ( SimpleInstallInstallDir
2007-05-11 17:02:17 +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 I n s t a l l / I n s t a l l D i r e c t o r y " )
2012-08-13 21:47:32 +04:00
add_test ( SimpleInstall ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 - 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall" )
add_test ( SimpleInstall-Stage2 ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 - 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 )
2012-08-13 21:47:32 +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 } )
2010-12-03 00:56:26 +03:00
set ( CTEST_RUN_CPackComponentsForAll ${ CTEST_TEST_CPACK } )
2008-06-19 19:08:08 +04:00
2012-02-19 23:50:27 +04:00
if ( CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*" )
find_program ( RPMBUILD NAMES rpmbuild )
2012-08-13 21:50:14 +04:00
endif ( )
2012-02-19 23:50:27 +04:00
# Do not try to build RPM
if ( NOT RPMBUILD )
set ( CPACK_BINARY_RPM OFF )
2012-08-13 21:50:14 +04:00
endif ( )
2012-02-19 23:50:27 +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 )
2012-08-13 21:50:14 +04:00
else ( )
2008-06-19 19:08:08 +04:00
set ( CTEST_RUN_CPackComponents OFF )
2009-01-22 18:22:30 +03:00
set ( CTEST_package_X11_TEST OFF )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2008-06-19 19:08:08 +04:00
2012-10-03 18:08:49 +04:00
# On Windows run the CPackWiXGenerator test
# if the WiX Toolset seems to be available
if ( WIN32 )
file ( TO_CMAKE_PATH "$ENV{WIX}" WIX_ROOT )
find_program ( WIX_LIGHT_EXECUTABLE light
P A T H S " $ { W I X _ R O O T } / b i n "
D O C " W i X T o o l s e t l i g h t . e x e l o c a t i o n " )
if ( WIX_LIGHT_EXECUTABLE )
add_test ( CPackWiXGenerator ${ 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 W i X G e n e r a t o 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 W i X G e n e r a t o r "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-10-03 18:08:49 +04:00
- - b u i l d - p r o j e c t C P a c k W i X 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 _ C M A K E _ C O M M A N D }
" - D C P a c k W i X G e n e r a t o r _ 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 W i X G e n e r a t o r "
- 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 W i X G e n e r a t o r / R u n C P a c k V e r i f y R e s u l t . c m a k e " )
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
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 )
2012-08-13 21:50:14 +04:00
endif ( )
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 )
2012-08-13 21:50:14 +04:00
endif ( )
2009-01-22 20:12:44 +03:00
2012-08-13 21:47:32 +04:00
add_test ( CPackComponents ${ CMAKE_CTEST_COMMAND }
2008-06-17 19:39:26 +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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2008-06-17 19:39:26 +04:00
- - 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 - 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 " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-06-17 19:39:26 +04:00
2012-08-13 21:47:32 +04:00
if ( CTEST_RUN_CPackComponentsForAll )
2012-06-28 15:49:49 +04:00
# Check whether if rpmbuild command is found
# before adding RPM tests
find_program ( RPMBUILD_EXECUTABLE NAMES rpmbuild )
if ( RPMBUILD_EXECUTABLE )
list ( APPEND ACTIVE_CPACK_GENERATORS RPM )
2012-08-13 21:50:14 +04:00
endif ( )
2012-06-28 15:49:49 +04:00
# Check whether if dpkg command is found
# before adding DEB tests
find_program ( DPKG_EXECUTABLE NAMES dpkg )
if ( DPKG_EXECUTABLE )
list ( APPEND ACTIVE_CPACK_GENERATORS DEB )
2012-08-13 21:50:14 +04:00
endif ( )
2012-06-28 15:49:49 +04:00
2012-03-30 19:07:06 +04:00
# ACTIVE_CPACK_GENERATORS variable
# now contains the list of 'active generators'
2010-12-03 00:56:26 +03:00
set ( CPackComponentsForAll_EXTRA_OPTIONS )
2011-01-30 15:11:25 +03:00
# set up list of CPack generators
list ( APPEND GENLST "ZIP" )
2011-03-28 19:11:27 +04:00
if ( APPLE )
list ( APPEND GENLST "DragNDrop" )
2012-08-13 21:50:14 +04:00
endif ( )
2012-03-30 19:07:06 +04:00
if ( NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*" )
list ( FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE )
if ( NOT ${ RPM_ACTIVE } EQUAL -1 )
list ( APPEND GENLST "RPM" )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-03-30 19:07:06 +04:00
list ( FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE )
if ( NOT ${ DEB_ACTIVE } EQUAL -1 )
list ( APPEND GENLST "DEB" )
2012-08-13 21:50:14 +04:00
endif ( )
2012-03-30 19:07:06 +04:00
2011-01-30 15:11:25 +03:00
# set up list of component packaging ways
list ( APPEND CWAYLST "default" )
list ( APPEND CWAYLST "OnePackPerGroup" )
list ( APPEND CWAYLST "IgnoreGroup" )
list ( APPEND CWAYLST "AllInOne" )
2011-01-31 19:25:29 +03:00
foreach ( CPackGen ${ GENLST } )
2011-01-30 15:11:25 +03:00
set ( CPackRun_CPackGen "-DCPackGen=${CPackGen}" )
2011-01-31 19:25:29 +03:00
foreach ( CPackComponentWay ${ CWAYLST } )
2011-01-30 15:11:25 +03:00
set ( CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}" )
2012-08-13 21:47:32 +04:00
add_test ( CPackComponentsForAll- ${ CPackGen } - ${ CPackComponentWay } ${ CMAKE_CTEST_COMMAND }
2011-01-30 15:11:25 +03: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 / C P a c k C o m p o n e n t s F o r A l l "
" $ { 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 F o r A l l / b u i l d $ { C P a c k G e n } - $ { C P a c k C o m p o n e n t W a y } "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-01-30 15:11:25 +03:00
- - 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 F o r A l l
- - b u i l d - o p t i o n s
- D C P A C K _ B I N A R Y _ $ { C P a c k G e n } : B O O L = O N
$ { C P a c k R u n _ C P a c k C o m p o n e n t W a y }
$ { C P a c k C o m p o n e n t s F o r A l l _ E X T R A _ O P T I O N S }
- - g r a p h v i z = C P a c k C o m p o n e n t s F o r A l l . d o t
- - 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 F o r A l l _ 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 F o r A l l / b u i l d $ { C P a c k G e n } - $ { C P a c k C o m p o n e n t W a y } "
" $ { C P a c k R u n _ C P a c k G e n } "
" $ { C P a c k R u n _ C P a c k C o m p o n e n t W a y } "
- 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 F o r A l l / R u n C P a c k V e r i f y R e s u l t . c m a k e " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" )
2012-08-13 21:50:14 +04:00
endforeach ( )
endforeach ( )
endif ( )
2010-12-03 00:56:26 +03: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 } )
2012-08-15 19:59:36 +04:00
endif ( )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-20 22:31:10 +04:00
2012-08-13 21:47:32 +04:00
if ( CTEST_RUN_CPackTestAllGenerators )
add_test ( CPackTestAllGenerators ${ CMAKE_CTEST_COMMAND }
2009-10-20 22:31:10 +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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2009-10-20 22:31:10 +04:00
- - 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
- - 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
- 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-20 22:31:10 +04:00
2012-08-13 21:47:32 +04:00
if ( CTEST_package_X11_TEST )
set ( X11_build_target_arg --build-target package )
2012-08-13 21:50:14 +04:00
else ( )
2012-08-13 21:47:32 +04:00
set ( X11_build_target_arg )
2012-08-13 21:50:14 +04:00
endif ( )
2009-01-21 19:54:30 +03:00
2012-08-13 21:47:32 +04: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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - b u i l d - p r o j e c t U s e X 1 1
- - 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 )
2012-08-13 21:47:32 +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 )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-22 18:14:40 +04:00
2012-08-13 21:47:32 +04:00
if ( CTEST_RUN_CMakeTestAllGenerators )
add_test ( CMakeTestAllGenerators ${ CMAKE_CMAKE_COMMAND }
2009-10-22 18:14:40 +04:00
- 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS
2009-10-22 18:14:40 +04:00
" $ { 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 " )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-22 18:14:40 +04:00
2009-10-27 19:18:41 +03:00
if ( NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines )
set ( CTEST_RUN_CMakeTestBadCommandLines ON )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-27 19:18:41 +03:00
2012-08-13 21:47:32 +04:00
if ( CTEST_RUN_CMakeTestBadCommandLines )
add_test ( CMakeTestBadCommandLines ${ CMAKE_CMAKE_COMMAND }
2009-10-27 19:18:41 +03:00
- 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS
2009-10-27 19:18:41 +03:00
" $ { 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 " )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-27 19:18:41 +03:00
2009-10-26 23:09:27 +03:00
if ( NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures )
set ( CTEST_RUN_CMakeTestMultipleConfigures ON )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-26 23:09:27 +03:00
2012-08-13 21:47:32 +04:00
if ( CTEST_RUN_CMakeTestMultipleConfigures )
add_test ( CMakeTestMultipleConfigures ${ CMAKE_CMAKE_COMMAND }
2009-10-26 23:09:27 +03:00
- 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS
2009-10-26 23:09:27 +03:00
" $ { 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 " )
2012-08-13 21:50:14 +04:00
endif ( )
2009-10-26 23:09:27 +03:00
2012-08-13 21:47:32 +04:00
add_test ( LoadedCommandOneConfig ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
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
- - t e s t - c o m m a n d L o a d e d C o m m a n d
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( complex ${ CMAKE_CTEST_COMMAND }
2012-02-04 00:54:20 +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 / 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 } "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-02-04 00:54:20 +04:00
- - b u i l d - p r o j e c t C o m p l e x
- - 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
- 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 }
- - t e s t - c o m m a n d c o m p l e x
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( complexOneConfig ${ CMAKE_CTEST_COMMAND }
2012-02-04 00:54:20 +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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-02-04 00:54:20 +04:00
- - b u i l d - p r o j e c t C o m p l e x
- - 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
- 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 }
- - t e s t - c o m m a n d c o m p l e x )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig" )
2012-02-04 00:54:20 +04:00
# because of the registry write these tests depend on each other
2012-08-13 21:47:32 +04:00
set_tests_properties ( complex PROPERTIES DEPENDS complexOneConfig )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( Example ${ 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 } / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - b u i l d - p r o j e c t H E L L O
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( Environment ${ CMAKE_CTEST_COMMAND }
2008-11-26 22:38:43 +03: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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2008-11-26 22:38:43 +03:00
- - 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 - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment" )
2008-11-26 22:38:43 +03:00
2013-03-12 02:26:38 +04:00
add_test ( QtAutomocNoQt ${ 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 / Q t A u t o m o c N o Q t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / Q t A u t o m o c N o Q t "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t Q t A u t o m o c N o Q t
- - b u i l d - o p t i o n s - D C M A K E _ B U I L D _ T Y P E = \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt" )
2013-03-16 18:52:18 +04:00
find_package ( Qt5Widgets QUIET NO_MODULE )
if ( Qt5Widgets_FOUND )
add_test ( Qt5Automoc ${ CMAKE_CTEST_COMMAND }
2012-02-24 19:09: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 / Q t A u t o m o c "
2013-03-16 18:52:18 +04:00
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / Q t 5 A u t o m o c "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-02-24 19:09:17 +04:00
- - b u i l d - p r o j e c t Q t A u t o m o c
2013-03-16 18:52:18 +04:00
- - 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 / Q t 5 A u t o m o c "
2012-02-24 19:09:17 +04:00
- - f o r c e - n e w - c t e s t - p r o c e s s
2013-03-16 18:52:18 +04:00
- - b u i l d - o p t i o n s - D Q T _ Q M A K E _ E X E C U T A B L E : F I L E P A T H = $ { Q T _ Q M A K E _ E X E C U T A B L E } - D Q T _ T E S T _ V E R S I O N = 5
2012-02-24 19:09:17 +04: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
)
2013-03-16 18:52:18 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Automoc" )
2012-08-13 21:47:32 +04:00
endif ( )
2012-12-31 12:41:09 +04:00
if ( QT4_WORKS AND QT_QTGUI_FOUND )
2013-03-16 18:52:18 +04:00
add_test ( Qt4Automoc ${ CMAKE_CTEST_COMMAND }
2012-02-24 19:09: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 / Q t A u t o m o c "
2013-03-16 18:52:18 +04:00
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / Q t 4 A u t o m o c "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-02-24 19:09:17 +04:00
- - b u i l d - p r o j e c t Q t A u t o m o c
2013-03-16 18:52:18 +04:00
- - 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 / Q t 4 A u t o m o c "
2012-02-24 19:09:17 +04:00
- - f o r c e - n e w - c t e s t - p r o c e s s
2013-03-16 18:52:18 +04:00
- - b u i l d - o p t i o n s - D Q T _ Q M A K E _ E X E C U T A B L E : F I L E P A T H = $ { Q T _ Q M A K E _ E X E C U T A B L E } - D Q T _ T E S T _ V E R S I O N = 4
2012-02-24 19:09:17 +04: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
)
2013-03-16 18:52:18 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Automoc" )
2013-03-16 21:57:38 +04:00
2012-12-31 12:41:09 +04:00
add_test ( Qt4Targets ${ 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 / Q t 4 T a r g e t s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / Q t 4 T a r g e t s "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-12-31 12:41:09 +04:00
- - b u i l d - p r o j e c t Q t 4 T a r g e t 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 / Q t 4 T a r g e t s "
- - f o r c e - n e w - c t e s t - p r o c e s s
- - b u i l d - o p t i o n s - D Q T _ Q M A K E _ E X E C U T A B L E : F I L E P A T H = $ { Q T _ Q M A K E _ E X E C U T A B L E }
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets" )
2013-05-27 19:58:57 +04:00
if ( Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0 )
add_test ( Qt4And5Automoc ${ 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 / Q t 4 A n d 5 A u t o m o c "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / Q t 4 A n d 5 A u t o m o c "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t Q t 4 A n d 5 A u t o m o c
- - 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 / Q t 4 A n d 5 A u t o m o c "
- - f o r c e - n e w - c t e s t - p r o c e s s
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc" )
endif ( )
2012-12-31 12:41:09 +04:00
endif ( )
2011-08-17 01:48:01 +04:00
2013-08-06 13:33:59 +04:00
find_package ( GTK2 QUIET )
if ( GTK2_FOUND )
add_subdirectory ( FindGTK2 )
endif ( )
2012-08-13 21:47:32 +04:00
add_test ( ExternalProject ${ CMAKE_CTEST_COMMAND }
2008-12-04 21:27:48 +03: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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2008-12-04 21:27:48 +03:00
- - 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 - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject" )
set_tests_properties ( ExternalProject PROPERTIES
2011-01-11 23:24:50 +03:00
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 } )
2008-12-04 21:27:48 +03:00
2012-11-01 19:50:58 +04:00
add_test ( ExternalProjectUpdateSetup ${ 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 U p d a t e "
" $ { 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 U p d a t e "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-11-01 19:50:58 +04:00
- - 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 U p d a t e T e s 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 / E x t e r n a l P r o j e c t U p d a t e "
- - f o r c e - n e w - c t e s t - p r o c e s s
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate" )
set_tests_properties ( ExternalProjectUpdateSetup PROPERTIES
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 } )
add_test ( NAME ExternalProjectUpdate
C O M M A N D $ { C M A K E _ C M A K E _ C O M M A N D }
2012-07-27 20:26:28 +04:00
- D E x t e r n a l P r o j e c t U p d a t 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 s / E x t e r n a l P r o j e c t U p d a t e
- D E x t e r n a l P r o j e c t U p d a t e _ 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 / E x t e r n a l P r o j e c t U p d a t e
- D C M A K E _ T E S T _ 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 }
2013-02-06 01:10:36 +04:00
- D C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T = $ { C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T }
2012-07-27 20:26:28 +04:00
- D C M A K E _ T E S T _ 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 }
- D C M A K E _ C 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 }
- P $ { 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 U p d a t e / E x t e r n a l P r o j e c t U p d a t e T e s t . c m a k e
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate" )
set_tests_properties ( ExternalProjectUpdate PROPERTIES
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 }
W O R K I N G _ D I R E C T O R Y $ { 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 U p d a t e
2012-11-01 19:50:58 +04:00
D E P E N D S E x t e r n a l P r o j e c t U p d a t e S e t u p )
2012-07-27 20:26:28 +04:00
2007-11-08 18:38:26 +03:00
# do each of the tutorial steps
2012-08-13 21:47:32 +04:00
foreach ( STP RANGE 1 7 )
add_test ( TutorialStep ${ STP } ${ CMAKE_CTEST_COMMAND }
2007-05-18 23:11:20 +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 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-18 23:11:20 +04:00
- - 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 )
2012-08-13 21:50:14 +04:00
endforeach ( )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04: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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - b u i l d - p r o j e c t T e s t i n g
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
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed" )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( wrapping ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 - 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
)
2012-08-13 21:47:32 +04:00
add_test ( qtwrapping ${ CMAKE_CTEST_COMMAND }
2007-11-02 17:46:03 +03: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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-11-02 17:46:03 +03:00
- - 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 - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
add_test ( testdriver1 ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
add_test ( testdriver2 ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
add_test ( testdriver3 ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04: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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_SYSTEM_NAME}" MATCHES syllable )
2007-11-24 04:45:49 +03:00
# 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 .
2011-01-03 22:41:25 +03:00
# For now we just require on Syllable that the user adjusts the DLL_PATH
2007-11-24 04:45:49 +03:00
# environment variable, so except the two tests below all other tests will succeed.
2012-08-13 21:47:32 +04:00
set ( _DLL_PATH "$ENV{DLL_PATH}" )
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 " )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
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 " )
2012-08-13 21:50:14 +04:00
endif ( )
2007-11-24 04:45:49 +03:00
2012-08-13 21:50:14 +04:00
else ( )
2007-11-24 04:45:49 +03:00
2012-08-13 21:47:32 +04:00
add_test ( JumpWithLibOut ${ CMAKE_CTEST_COMMAND }
2007-11-24 04:45:49 +03: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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-11-24 04:45:49 +03:00
- - 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
)
2012-08-13 21:47:32 +04:00
add_test ( JumpNoLibOut ${ CMAKE_CTEST_COMMAND }
2007-11-24 04:45:49 +03: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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-11-24 04:45:49 +03:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump" )
2007-11-24 04:45:49 +03:00
2012-08-13 21:47:32 +04:00
add_test ( Plugin ${ CMAKE_CTEST_COMMAND }
2007-11-24 04:45:49 +03: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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-11-24 04:45:49 +03:00
- - b u i l d - p r o j e c t P l u g i n
- - 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin" )
2007-11-24 04:45:49 +03:00
2012-08-13 21:47:32 +04:00
if ( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG )
2008-01-22 17:15:16 +03:00
ADD_TEST_MACRO ( RuntimePath RuntimePath )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2007-05-11 17:02:17 +04:00
2013-05-02 08:19:06 +04:00
if ( APPLE AND "${DARWIN_MAJOR_VERSION}" GREATER 9 )
add_test ( MacRuntimePath ${ 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 c R u n t i m e P a t h "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / M a c R u n t i m e P a t h "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t M a c R u n t i m e P a t h
)
endif ( )
2012-08-13 21:47:32 +04:00
add_test ( linkorder1 ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
add_test ( linkorder2 ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder" )
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
2011-03-04 02:02:53 +03:00
# Test static linking on toolchains known to support it.
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$"
2011-03-04 02:02:53 +03:00
A N D N O T APPLE A N D N O T WIN32 A N D N O T CYGWIN
A N D E X I S T S " / u s r / l i b / l i b m . a " )
2012-08-13 21:47:32 +04:00
add_test ( LinkStatic ${ CMAKE_CTEST_COMMAND }
2011-03-04 02:02:53 +03: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 / L i n k S t a t i c "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k S t a t i c "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-03-04 02:02:53 +03:00
- - b u i l d - p r o j e c t L i n k S t a t i c
- - b u i l d - o p t i o n s - D M A T H _ L I B R A R Y : F I L E P A T H = / u s r / l i b / l i b m . a
- - t e s t - c o m m a n d L i n k S t a t i c
)
2012-08-13 21:47:32 +04:00
endif ( )
2011-03-04 02:02:53 +03:00
2012-08-13 21:47:32 +04:00
if ( NOT CMAKE_TEST_DIFFERENT_GENERATOR )
add_test ( kwsys ${ 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 } / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys" )
2012-08-13 21:50:14 +04:00
endif ( )
2007-05-11 17:02:17 +04:00
2013-02-22 17:14:18 +04:00
if ( MAKE_SUPPORTS_SPACES )
2012-08-13 21:47:32 +04:00
add_test ( SubDirSpaces ${ 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 / 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 "
2011-01-03 22:41:25 +03:00
- - b u i l d - e x e - d i r
2007-05-11 17:02:17 +04:00
" $ { 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces" )
2012-08-15 19:59:36 +04:00
endif ( )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
if ( WIN32 )
add_test ( SubDir ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 "
)
2012-08-13 21:50:14 +04:00
else ( )
2012-08-13 21:47:32 +04:00
add_test ( SubDir ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 "
)
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir" )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
if ( CMAKE_TEST_MSVC )
2011-01-03 18:02:16 +03:00
ADD_TEST_MACRO ( ForceInclude foo )
2012-09-29 14:36:46 +04:00
ADD_TEST_MACRO ( PDBDirectoryAndName myexe )
2007-05-18 23:11:20 +04:00
ADD_TEST_MACRO ( PrecompiledHeader foo )
2012-08-13 21:47:32 +04:00
endif ( )
if ( CMAKE_TEST_MSVC OR
2011-02-21 21:30:10 +03:00
" $ { 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 " ( M S Y S | M i n G W ) M a k e f i l e s " )
2009-09-30 00:39:43 +04:00
ADD_TEST_MACRO ( ModuleDefinition example_exe )
2012-08-13 21:47:32 +04:00
endif ( )
2007-05-11 17:02:17 +04:00
2010-04-30 08:18:01 +04:00
ADD_TEST_MACRO ( CheckCompilerRelatedVariables CheckCompilerRelatedVariables )
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_TEST_GENERATOR}" MATCHES "Makefile" )
add_test ( MakeClean ${ 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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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 - 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
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean" )
2012-08-13 21:50:14 +04:00
endif ( )
2007-05-11 17:02:17 +04:00
2011-10-25 00:55:52 +04:00
if ( NOT DEFINED CTEST_RUN_MFC )
set ( CTEST_RUN_MFC OFF )
2011-11-03 21:21:06 +04:00
2011-10-25 00:55:52 +04:00
if ( MSVC )
set ( CTEST_RUN_MFC ON )
2011-11-02 00:27:24 +04:00
# Look for evidence that this is a VCExpress build. If so, avoid
# the MFC test by default.
string ( TOLOWER "${CMAKE_TEST_MAKEPROGRAM}" mkprog )
if ( mkprog MATCHES "vcexpress" )
message ( STATUS
" C M A K E _ T E S T _ M A K E P R O G R A M i n d i c a t e s v c e x p r e s s , a v o i d i n g M F C t e s t " )
set ( CTEST_RUN_MFC OFF )
endif ( )
# Since MSBuild might also be the "makeprogram" for a VCExpress
# build tree, use one more heuristic, too. The string representing
# the .vcproj file type contains "VCExpress" on machines where an
# express edition of VS was installed last:
if ( CTEST_RUN_MFC )
execute_process ( COMMAND cmd /c assoc .vcproj
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
O U T P U T _ V A R I A B L E o v )
if ( ov MATCHES "VCExpress" )
message ( STATUS
" . v c p r o j f i l e a s s o c i a t i o n i n d i c a t e s V C E x p r e s s , a v o i d i n g M F C t e s t " )
set ( CTEST_RUN_MFC OFF )
endif ( )
endif ( )
2011-11-03 21:21:06 +04:00
# For the Watcom WMake generator, avoid the MFC test by default.
if ( CTEST_RUN_MFC )
if ( "${CMAKE_TEST_GENERATOR}" MATCHES "WMake" )
message ( STATUS
" u s i n g t h e W a t c o m W M a k e g e n e r a t o r , a v o i d i n g M F C t e s t " )
set ( CTEST_RUN_MFC OFF )
endif ( )
endif ( )
2011-12-16 22:49:27 +04:00
# Last resort, after quick checks are done. Do a try_compile, and avoid
# the MFC test if the simplest possible MFC app cannot be compiled.
if ( CTEST_RUN_MFC AND NOT DEFINED HAVE_MFC )
configure_file (
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / M F C / t r y _ c o m p i l e / C M a k e L i s t s . t x t
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M F C / t r y _ c o m p i l e / C M a k e L i s t s . t x t
C O P Y O N L Y
)
configure_file (
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / M F C / m f c 1 / s t d a f x . c p p
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M F C / t r y _ c o m p i l e / s t d a f x . c p p
C O P Y O N L Y
)
configure_file (
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / M F C / m f c 1 / s t d a f x . h
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M F C / t r y _ c o m p i l e / s t d a f x . h
C O P Y O N L Y
)
message ( STATUS "Looking for MFC" )
try_compile ( HAVE_MFC
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M F C / t r y _ c o m p i l e / b u i l d
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / M F C / t r y _ c o m p i l e
t r y _ c o m p i l e _ m f c
O U T P U T _ V A R I A B L E H A V E _ M F C _ O U T P U T )
if ( HAVE_MFC )
message ( STATUS "Looking for MFC - found" )
set ( HAVE_MFC 1 CACHE INTERNAL "Have MFC" )
file ( APPEND
$ { C M A K E _ B I N A R Y _ D I R } $ { C M A K E _ F I L E S _ D I R E C T O R Y } / C M a k e O u t p u t . l o g
" D e t e r m i n i n g i f M F C e x i s t s p a s s e d w i t h t h e f o l l o w i n g o u t p u t : \ n "
" $ { H A V E _ M F C _ O U T P U T } \ n \ n " )
else ( )
message ( STATUS "Looking for MFC - not found" )
set ( HAVE_MFC "" CACHE INTERNAL "Have MFC" )
file ( APPEND
$ { C M A K E _ B I N A R Y _ D I R } $ { C M A K E _ F I L E S _ D I R E C T O R Y } / C M a k e E r r o r . l o g
" D e t e r m i n i n g i f M F C e x i s t s f a i l e d w i t h t h e f o l l o w i n g o u t p u t : \ n "
" $ { H A V E _ M F C _ O U T P U T } \ n \ n " )
endif ( )
endif ( )
if ( CTEST_RUN_MFC AND NOT HAVE_MFC )
message ( STATUS
" c a n n o t c o m p i l e s i m p l e s t e v e r M F C a p p , a v o i d i n g M F C t e s t " )
set ( CTEST_RUN_MFC OFF )
endif ( )
2011-10-25 00:55:52 +04:00
endif ( )
endif ( )
if ( CTEST_RUN_MFC )
add_test ( MFC ${ 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 F C "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / M F C "
- - b u i l d - t w o - c o n f i g
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-10-25 00:55:52 +04:00
- - b u i l d - p r o j e c t m f c _ d r i v e r
- - 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 } - V V )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC" )
endif ( )
2012-08-13 21:47:32 +04:00
if ( ${ CMAKE_TEST_GENERATOR } MATCHES "Visual Studio" )
if ( NOT MSVC60 )
2012-03-07 03:41:56 +04:00
ADD_TEST_MACRO ( SBCS SBCS )
2012-08-13 21:50:14 +04:00
endif ( )
2012-02-17 01:27:05 +04:00
2013-04-29 18:48:22 +04:00
if ( NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [6789]( |$)"
A N D N O T C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T )
ADD_TEST_MACRO ( VSWindowsFormsResx VSWindowsFormsResx )
endif ( )
2012-08-13 21:47:32 +04:00
add_test ( VSExternalInclude ${ 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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-05-11 17:02:17 +04:00
- - 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
- - 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude" )
2011-01-05 02:51:15 +03:00
2012-08-13 21:47:32 +04:00
add_test ( VSMidl ${ CMAKE_CTEST_COMMAND }
2011-01-05 02:51:15 +03: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 / V S M i d l "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S M i d l "
- - b u i l d - t w o - c o n f i g
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-01-05 02:51:15 +03:00
- - b u i l d - p r o j e c t V S M i d l
- - t e s t - c o m m a n d V S M i d l )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl" )
2012-10-12 17:30:17 +04:00
if ( NOT MSVC60 AND NOT CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]" )
# The test (and tested property) works with .sln files, so it's skipped when:
# * Using VS6, which doesn't use .sln files
# * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file
2012-11-13 19:52:05 +04:00
set ( _last_test "" )
2012-10-12 17:30:17 +04:00
foreach ( config ${ CMAKE_CONFIGURATION_TYPES } )
add_test ( NAME VSExcludeFromDefaultBuild- ${ config } COMMAND ${ 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 c l u d e F r o m D e f a u l t B u i l d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S E x c l u d e F r o m D e f a u l t B u i l d "
- - b u i l d - c o n f i g $ { c o n f i g }
- - b u i l d - t w o - c o n f i g
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-10-12 17:30:17 +04:00
- - b u i l d - p r o j e c t V S E x c l u d e F r o m D e f a u l t B u i l d
- - t e s t - c o m m a n d $ { C M A K E _ C O M M A N D }
- D " a c t i v e C o n f i g = $ { c o n f i g } "
- D " a l l C o n f i g s = $ { C M A K E _ C O N F I G U R A T I O N _ T Y P E S } "
- D " d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S E x c l u d e F r o m D e f a u l t B u i l d "
- P " $ { C M a k e _ S O U R C E _ D I R } / T e s t s / V S E x c l u d e F r o m D e f a u l t B u i l d / R e s u l t T e s t . c m a k e " )
2012-11-13 19:52:05 +04:00
if ( _last_test )
set_property ( TEST VSExcludeFromDefaultBuild- ${ config } PROPERTY DEPENDS ${ _last_test } )
endif ( )
set ( _last_test "VSExcludeFromDefaultBuild-${config}" )
2012-10-12 17:30:17 +04:00
endforeach ( )
2012-11-13 19:52:05 +04:00
unset ( _last_test )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild" )
2012-10-12 17:30:17 +04:00
endif ( )
2013-01-03 16:43:42 +04:00
if ( CMAKE_TEST_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])" )
if ( CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]" )
set ( MSBUILD_EXECUTABLE "${CMAKE_TEST_MAKEPROGRAM}" )
else ( )
2013-06-29 03:38:02 +04:00
if ( CMAKE_TEST_GENERATOR MATCHES "Visual Studio (12)" )
set ( _msbuild_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\${CMAKE_MATCH_1}.0;MSBuildToolsPath]" )
else ( )
set ( _FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]" )
set ( _FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]" )
set ( _msbuild_hints ${ _FDIR } / ${ _FVER } )
endif ( )
find_program ( MSBUILD_EXECUTABLE NAMES msbuild HINTS ${ _msbuild_hints } )
2013-01-03 16:43:42 +04:00
endif ( )
if ( MSBUILD_EXECUTABLE )
add_test ( NAME VSProjectInSubdir COMMAND ${ 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 P r o j e c t I n 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 / V S P r o j e c t I n S u b d i 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 M A K E _ T E S T _ G E N E R A T O R }
- - b u i l d - g e n e r a t o r - t o o l s e t " $ { C M A K E _ T E S T _ G E N E R A T O R _ T O O L S E T } "
- - b u i l d - m a k e p r o g r a m " $ { M S B U I L D _ E X E C U T A B L E } "
- - b u i l d - p r o j e c t V S P r o j e c t I n S u b d i r
- - b u i l d - t a r g e t t e s t )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir" )
endif ( )
endif ( )
2012-08-13 21:50:14 +04:00
endif ( )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
if ( APPLE )
2012-07-16 13:26:56 +04:00
if ( CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
2012-08-13 21:47:32 +04:00
set ( BundleTestInstallDir
2012-07-16 13:26:56 +04:00
" $ { 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 " )
2012-08-13 21:47:32 +04:00
add_test ( BundleTest ${ CMAKE_CTEST_COMMAND }
2012-07-16 13:26:56 +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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-07-16 13:26:56 +04:00
- - 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
$ { 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest" )
2012-07-16 13:26:56 +04:00
2012-08-13 21:47:32 +04:00
add_test ( CFBundleTest ${ CMAKE_CTEST_COMMAND }
2012-07-16 13:26:56 +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 / C F 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 / C F B u n d l e T e s t "
- - b u i l d - t w o - c o n f i g
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2012-07-16 13:26:56 +04:00
- - b u i l d - p r o j e c t C F B u n d l e T e s t
- - 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 T E S T _ C O N F I G U R A T I O N _ T Y P E = \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
2010-10-07 06:43:04 +04:00
- D d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C F B u n d l e T e s t
- D g e n = $ { C M A K E _ T E S T _ G E N E R A T O R }
- P $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C F B u n d l e T e s t / V e r i f y R e s u l t . c m a k e )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest" )
2010-10-07 06:43:04 +04:00
2012-07-16 13:26:56 +04:00
ADD_TEST_MACRO ( ObjC++ ObjC++ )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
if ( APPLE AND CTEST_TEST_CPACK )
add_test ( BundleGeneratorTest ${ CMAKE_CTEST_COMMAND }
2008-07-31 00:36:22 +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 / 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
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2008-07-31 18:54:55 +04:00
- - 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 "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-07-31 00:36:22 +04:00
2012-08-13 21:47:32 +04:00
add_test ( WarnUnusedUnusedViaSet ${ CMAKE_CTEST_COMMAND }
2010-09-16 21:52:54 +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 / V a r i a b l e U n u s e d V i a S e t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W a r n U n u s e d U n u s e d V i a S e t "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-09-16 21:52:54 +04:00
- - b u i l d - n o c l e a n
- - b u i l d - p r o j e c t W a r n U n u s e d U n u s e d V i a S e t
- - b u i l d - o p t i o n s " - - w a r n - u n u s e d - v a r s " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUnusedUnusedViaSet PROPERTIES
2010-12-08 00:46:10 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " u n u s e d v a r i a b l e \ \ ( c h a n g i n g d e f i n i t i o n \ \ ) ' U N U S E D _ V A R I A B L E ' " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUnusedUnusedViaSet PROPERTIES
2010-12-08 00:46:10 +03:00
F A I L _ R E G U L A R _ E X P R E S S I O N " u n u s e d v a r i a b l e \ \ ( u n s e t t i n g \ \ ) ' U N U S E D _ V A R I A B L E ' " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet" )
2010-09-16 21:52:54 +04:00
2012-08-13 21:47:32 +04:00
add_test ( WarnUnusedUnusedViaUnset ${ CMAKE_CTEST_COMMAND }
2010-09-16 21:51:51 +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 / V a r i a b l e U n u s e d V i a U n s e t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W a r n U n u s e d U n u s e d V i a U n s e t "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-09-16 21:51:51 +04:00
- - b u i l d - n o c l e a n
- - b u i l d - p r o j e c t W a r n U n u s e d U n u s e d V i a U n s e t
- - b u i l d - o p t i o n s " - - w a r n - u n u s e d - v a r s " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUnusedUnusedViaUnset PROPERTIES
2012-08-14 16:02:34 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " C M a k e W a r n i n g . * V a r i a b l e U n u s e d V i a U n s e t . C M a k e L i s t s . t x t : 7 \ \ ( s e t \ \ ) : " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUnusedUnusedViaUnset PROPERTIES
2012-08-14 16:02:34 +04:00
F A I L _ R E G U L A R _ E X P R E S S I O N " C M a k e W a r n i n g . * V a r i a b l e U n u s e d V i a U n s e t . C M a k e L i s t s . t x t : 5 \ \ ( s e t \ \ ) : " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset" )
2010-09-16 21:51:51 +04:00
2013-06-12 19:21:10 +04:00
if ( "${CMAKE_TEST_GENERATOR}" MATCHES "Makefile" AND NOT WIN32 )
2013-05-16 23:51:45 +04:00
# Ninja does not support ADDITIONAL_MAKE_CLEAN_FILES and therefore fails
# this test. (See #13371)
# Apparently Visual Studio does not support it either. As the MakeClean
# test above is only run with the Makefiles generator, only run this
# test with the Makefiles generator also.
add_test ( WarnUnusedCliUnused ${ 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 a r n U n u s e d C l i U n u s e d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W a r n U n u s e d C l i U n u s e d "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t W a r n U n u s e d C l i U n u s e d
- - b u i l d - o p t i o n s " - D U N U S E D _ C L I _ V A R I A B L E = U n u s e d " )
set_tests_properties ( WarnUnusedCliUnused PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " C M a k e W a r n i n g : . * M a n u a l l y - s p e c i f i e d v a r i a b l e s w e r e n o t u s e d b y t h e p r o j e c t : . * U N U S E D _ C L I _ V A R I A B L E " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" )
endif ( )
2010-09-02 19:33:57 +04:00
2012-08-13 21:47:32 +04:00
add_test ( WarnUnusedCliUsed ${ CMAKE_CTEST_COMMAND }
2010-09-02 19:33:57 +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 / V a r i a b l e U s a g e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W a r n U n u s e d C l i U s e d "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-09-02 19:33:57 +04:00
- - b u i l d - n o c l e a n
- - b u i l d - p r o j e c t W a r n U n u s e d C l i U s e d
- - b u i l d - o p t i o n s " - D U S E D _ V A R I A B L E = U s a g e p r o v e n " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUnusedCliUsed PROPERTIES
2010-09-02 19:33:57 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " U s a g e p r o v e n " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUnusedCliUsed PROPERTIES
2010-12-07 22:17:50 +03:00
F A I L _ R E G U L A R _ E X P R E S S I O N " C M a k e W a r n i n g : T h e v a r i a b l e , ' U S E D _ V A R I A B L E ' " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed" )
2010-09-02 19:33:57 +04:00
2012-08-13 21:47:32 +04:00
add_test ( WarnUninitialized ${ CMAKE_CTEST_COMMAND }
2010-09-02 19:34:13 +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 / V a r i a b l e U s a g e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W a r n U n i n i t i a l i z e d "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-09-02 19:34:13 +04:00
- - b u i l d - n o c l e a n
- - b u i l d - p r o j e c t W a r n U n i n i t i a l i z e d
- - b u i l d - o p t i o n s " - - w a r n - u n i n i t i a l i z e d " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( WarnUninitialized PROPERTIES
2010-12-08 01:00:41 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " u n i n i t i a l i z e d v a r i a b l e ' U S E D _ V A R I A B L E ' " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized" )
2010-09-02 19:34:13 +04:00
2012-08-13 21:47:32 +04:00
add_test ( TestsWorkingDirectory ${ CMAKE_CTEST_COMMAND }
2010-10-26 14:06:15 +04:00
- - b u i l d - a n d - t e s t
2010-12-17 00:50:16 +03:00
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t s 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 / T e s t s W o r k i n g D i r e c t o r y "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2010-12-17 00:50:16 +03:00
- - b u i l d - p r o j e c t T e s t s W o r k i n g D i r e c t o r y P r o j
- - 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 / T e s t s W o r k i n g D i r e c t o r y "
2010-10-26 14:06:15 +04:00
- - f o r c e - n e w - c t e s t - p r o c e s s
2011-06-10 17:29:30 +04: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 - C \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
2010-10-26 14:06:15 +04:00
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory" )
2010-10-26 14:06:15 +04:00
2009-09-12 00:39:07 +04:00
# Make sure CTest can handle a test with no newline in output.
2012-08-13 21:47:32 +04:00
add_test ( CTest.NoNewline
2010-06-10 16:24:27 +04:00
$ { C M A K E _ 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-09-12 00:39:07 +04:00
2009-07-12 12:51:51 +04:00
# A simple test for ctest in script mode
2012-08-13 21:47:32 +04:00
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
2009-07-12 12:51:51 +04: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 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 )
2012-08-13 21:47:32 +04:00
# add_test(CTest.ScriptMode ${CMAKE_CTEST_COMMAND}
2009-07-12 22:52:31 +04:00
# -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake"
# )
2009-07-12 12:51:51 +04:00
2013-03-28 18:10:13 +04:00
# A test for ctest_build() with targets in subdirectories
if ( CMAKE_TEST_GENERATOR_TOOLSET )
set ( CMAKE_TEST_GENERATOR_TOOLSET_SELECTION "-T;${CMAKE_TEST_GENERATOR_TOOLSET};" )
else ( )
set ( CMAKE_TEST_GENERATOR_TOOLSET_SELECTION )
endif ( )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.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 B u i l d C o m m a n d P r o j e c t I n S u b d i r / C T e s t B u i l d C o m m a n d P r o j e c t I n S u b d i r . c m a k e " @ O N L Y )
unset ( CMAKE_TEST_GENERATOR_TOOLSET_SELECTION )
add_test ( CTest.BuildCommand.ProjectInSubdir
$ { C M A K E _ C T E S T _ C O M M A N D } - 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 B u i l d C o m m a n d P r o j e c t I n S u b d i r / C T e s t B u i l d C o m m a n d P r o j e c t I n S u b d i r . c m a k e "
- D C M A K E _ M A K E _ P R O G R A M : F I L E P A T H = $ { C M A K E _ T E S T _ M A K E P R O G R A M } )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/Nested" )
2012-08-13 21:47:32 +04:00
set ( CTEST_TEST_UPDATE 1 )
if ( CTEST_TEST_UPDATE )
2008-10-19 19:53:01 +04:00
# Test CTest Update with Subversion
2012-08-13 21:47:32 +04:00
find_package ( Subversion QUIET )
if ( Subversion_FOUND )
get_filename_component ( _Subversion_BIN_DIR
2008-10-19 19:53:01 +04:00
$ { 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 )
2012-08-13 21:47:32 +04:00
find_program ( Subversion_SVNADMIN_EXECUTABLE svnadmin
2008-10-19 19:53:01 +04:00
H I N T S $ { _ S u b v e r s i o n _ B I N _ D I R }
)
2012-08-13 21:47:32 +04:00
mark_as_advanced ( Subversion_SVNADMIN_EXECUTABLE )
if ( NOT Subversion_SVNADMIN_EXECUTABLE )
set ( Subversion_FOUND FALSE )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
if ( Subversion_FOUND )
set ( CTestUpdateSVN_DIR "CTest UpdateSVN" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
2008-10-19 19:53:01 +04: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 U p d a t e S V N . c m a k e " @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTest.UpdateSVN ${ CMAKE_CMAKE_COMMAND }
2008-10-19 19:53:01 +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 S V N . c m a k e "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-10-19 19:53:01 +04:00
# Test CTest Update with CVS
2012-08-13 21:47:32 +04:00
if ( EXISTS ${ CMAKE_ROOT } /Modules/FindCVS.cmake )
find_package ( CVS QUIET )
2012-08-13 21:50:14 +04:00
else ( )
2012-08-13 21:47:32 +04:00
find_program ( CVS_EXECUTABLE NAMES cvs )
set ( CVS_FOUND ${ CVS_EXECUTABLE } )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
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 )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
if ( CTEST_TEST_UPDATE_CVS )
set ( CTestUpdateCVS_DIR "CTest UpdateCVS" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
2008-10-19 19:53:01 +04: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 U p d a t e C V S . c m a k e " @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTest.UpdateCVS ${ CMAKE_CMAKE_COMMAND }
2008-10-19 19:53:01 +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 C V S . c m a k e "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}" )
2012-08-13 21:50:14 +04:00
endif ( )
2008-10-19 19:53:01 +04:00
2009-05-15 00:13:52 +04:00
# Test CTest Update with BZR
2012-08-13 21:47:32 +04:00
find_program ( BZR_EXECUTABLE NAMES bzr )
mark_as_advanced ( BZR_EXECUTABLE )
set ( CTEST_TEST_UPDATE_BZR 0 )
if ( BZR_EXECUTABLE )
if ( NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
set ( CTEST_TEST_UPDATE_BZR 1 )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
if ( CTEST_TEST_UPDATE_BZR )
2009-05-15 00:13:52 +04:00
# Check if xmloutput plugin is there
2012-08-13 21:47:32 +04:00
execute_process ( COMMAND ${ BZR_EXECUTABLE } xmlplugins RESULT_VARIABLE xmlplugres
2009-05-15 00:13:52 +04:00
O U T P U T _ Q U I E T E R R O R _ Q U I E T )
2012-08-13 21:47:32 +04:00
if ( NOT ${ xmlplugres } )
set ( CTestUpdateBZR_DIR "CTest UpdateBZR" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
2009-05-15 00:13:52 +04: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 U p d a t e B Z R . c m a k e " @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTest.UpdateBZR ${ CMAKE_CMAKE_COMMAND }
2009-05-15 00:13:52 +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 m a k e "
)
2012-08-13 21:47:32 +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"
2009-06-25 18:51:53 +04: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 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 )
2012-08-13 21:47:32 +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
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}" )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2009-05-15 00:13:52 +04:00
2009-04-22 17:19:06 +04:00
# Test CTest Update with GIT
2012-08-13 21:47:32 +04:00
find_program ( GIT_EXECUTABLE NAMES git )
mark_as_advanced ( GIT_EXECUTABLE )
set ( CTEST_TEST_UPDATE_GIT 0 )
if ( GIT_EXECUTABLE )
if ( NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
set ( CTEST_TEST_UPDATE_GIT 1 )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
if ( CTEST_TEST_UPDATE_GIT )
set ( CTestUpdateGIT_DIR "CTest UpdateGIT" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
2009-04-22 17:19:06 +04: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 U p d a t e G I T . c m a k e " @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTest.UpdateGIT ${ CMAKE_CMAKE_COMMAND }
2009-04-22 17:19:06 +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 G I T . c m a k e "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}" )
2012-08-13 21:50:14 +04:00
endif ( )
2009-04-22 17:19:06 +04:00
2009-07-10 19:08:05 +04:00
# Test CTest Update with HG
2012-08-13 21:47:32 +04:00
find_program ( HG_EXECUTABLE NAMES hg )
mark_as_advanced ( HG_EXECUTABLE )
set ( CTEST_TEST_UPDATE_HG 0 )
if ( HG_EXECUTABLE )
if ( NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX )
set ( CTEST_TEST_UPDATE_HG 1 )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
if ( CTEST_TEST_UPDATE_HG )
set ( CTestUpdateHG_DIR "CTest UpdateHG" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
2009-07-10 19:08:05 +04: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 U p d a t e H G . c m a k e " @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTest.UpdateHG ${ CMAKE_CMAKE_COMMAND }
2009-07-10 19:08:05 +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 H G . c m a k e "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}" )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2008-10-19 19:53:01 +04:00
2012-08-13 21:47:32 +04:00
configure_file (
2009-09-23 19:38:37 +04: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 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestNoBuild ${ CMAKE_CTEST_COMMAND }
2009-09-23 19:38:37 +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 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 "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestNoBuild PROPERTIES
2009-09-23 19:38:37 +04:00
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 )
2009-12-04 20:09:01 +03:00
2012-08-13 21:47:32 +04:00
configure_file (
2009-09-23 19:38:37 +04: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 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestNoExe ${ CMAKE_CTEST_COMMAND }
2009-09-23 19:38:37 +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 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 "
)
2012-08-13 21:47:32 +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 " )
2012-08-13 21:47:32 +04:00
configure_file (
2011-02-18 20:11:51 +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 U p l o a d / 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 U p l o a d / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestUpload ${ CMAKE_CTEST_COMMAND }
2011-02-18 20:11:51 +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 U p l o a d / 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 U p l o a d / t e s t O u t . l o g "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestUpload PROPERTIES
2011-02-18 20:11:51 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " U p l o a d \ \ . x m l " )
2009-12-04 20:09:01 +03:00
2012-08-13 21:47:32 +04:00
configure_file (
2011-10-27 06:48:36 +04: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 C o n f i g F i l e I n B u i l d D i r / t e s t 1 . 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 o n f i g F i l e I n B u i l d D i r 1 / t e s t 1 . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestConfigFileInBuildDir1 ${ CMAKE_CTEST_COMMAND }
2011-10-27 06:48:36 +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 C o n f i g F i l e I n B u i l d D i r 1 / t e s t 1 . 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 o n f i g F i l e I n B u i l d D i r 1 / t e s t O u t 1 . l o g "
)
2012-02-27 18:00:46 +04:00
REGEX_ESCAPE_STRING ( CTEST_TEST_ESCAPED_SOURCE_DIR "${CMake_SOURCE_DIR}" )
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
2011-10-27 06:48:36 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N
2012-02-27 18:00:46 +04:00
" R e a d i n g c t e s t c o n f i g u r a t i o n f i l e : $ { C T E S T _ T E S T _ E S C A P E D _ S O U R C E _ D I R } . T e s t s . C T e s t T e s t C o n f i g F i l e I n B u i l d D i r . C T e s t C o n f i g . c m a k e " )
2011-10-27 06:48:36 +04:00
2012-08-13 21:47:32 +04:00
configure_file (
2011-10-27 06:48:36 +04: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 C o n f i g F i l e I n B u i l d D i r / t e s t 2 . 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 o n f i g F i l e I n B u i l d D i r 2 / t e s t 2 . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
2012-08-13 21:47:32 +04:00
configure_file (
2011-10-27 06:48:36 +04: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 C o n f i g F i l e I n B u i l d D i r / C T e s t C o n f i g . 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 C o n f i g F i l e I n B u i l d D i r 2 / C T e s t C o n f i g . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S C O P Y O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestConfigFileInBuildDir2 ${ CMAKE_CTEST_COMMAND }
2011-10-27 06:48:36 +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 C o n f i g F i l e I n B u i l d D i r 2 / t e s t 2 . 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 o n f i g F i l e I n B u i l d D i r 2 / t e s t O u t 2 . l o g "
)
2012-02-27 18:00:46 +04:00
REGEX_ESCAPE_STRING ( CTEST_TEST_ESCAPED_BINARY_DIR "${CMake_BINARY_DIR}" )
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
2011-10-27 06:48:36 +04:00
R E Q U I R E D _ F I L E 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 o n f i g F i l e I n B u i l d D i r 2 / C T e s t C o n f i g . c m a k e
P A S S _ R E G U L A R _ E X P R E S S I O N
2012-02-27 18:00:46 +04:00
" R e a d i n g c t e s t c o n f i g u r a t i o n f i l e : $ { C T E S T _ T E S T _ E S C A P E D _ B I N A R Y _ D I R } . T e s t s . C T e s t T e s t C o n f i g F i l e I n B u i l d D i r 2 . C T e s t C o n f i g . c m a k e " )
2011-10-27 06:48:36 +04:00
2012-05-01 21:35:07 +04:00
# test coverage for mumps
# create a MumpsCoverage dir in the binary tree under Testing to
# avoid the .NoDartCoverage files in the cmake testing tree
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / M u m p s C o v e r a g e / D a r t C o n f i g u r a t i o n . t c l . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C o v e r a g e / D a r t C o n f i g u r a t i o n . t c l " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / M u m p s C o v e r a g e / g t m _ c o v e r a g e . m c o v . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C o v e r a g e / g t m _ c o v e r a g e . m c o v " )
file ( COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
D E S T I N A T I O N " $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C o v e r a g e " )
2012-05-02 19:51:38 +04:00
add_test ( NAME CTestGTMCoverage
C O M M A N D c m a k e - E c h d i r
$ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C o v e r a g e
$ < T A R G E T _ F I L E : c t e s t > - T C o v e r a g e - - d e b u g )
2012-05-01 21:35:07 +04:00
set_tests_properties ( CTestGTMCoverage PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N
2012-05-04 19:41:15 +04:00
" P r o c e s s f i l e . * X I N D E X . m . * T o t a l L O C : . * 1 2 7 . * P e r c e n t a g e C o v e r a g e : 8 5 . 8 3 . * "
E N V I R O N M E N T C O V F I L E = )
2012-05-02 01:00:43 +04:00
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / M u m p s C o v e r a g e / D a r t C o n f i g u r a t i o n . c a c h e . t c l . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C a c h e C o v e r a g e / D a r t C o n f i g u r a t i o n . t c l " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / M u m p s C o v e r a g e / c a c h e _ c o v e r a g e . c m c o v . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C a c h e C o v e r a g e / c a c h e _ c o v e r a g e . c m c o v " )
file ( COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
D E S T I N A T I O N " $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C a c h e C o v e r a g e " )
2012-05-02 19:51:38 +04:00
add_test ( NAME CTestCacheCoverage
C O M M A N D c m a k e - E c h d i r
$ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / M u m p s C a c h e C o v e r a g e
$ < T A R G E T _ F I L E : c t e s t > - T C o v e r a g e - - d e b u g )
2012-05-02 01:00:43 +04:00
set_tests_properties ( CTestCacheCoverage PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N
2012-05-04 19:41:15 +04:00
" P r o c e s s f i l e . * X I N D E X . m . * T o t a l L O C : . * 1 2 5 . * P e r c e n t a g e C o v e r a g e : 8 5 . 6 0 . * "
E N V I R O N M E N T C O V F I L E = )
2013-09-27 18:42:39 +04:00
# Adding a test case for Python Coverage
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / P y t h o n C o v e r a g e / c o v e r a g e . x m l . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / P y t h o n C o v e r a g e / c o v e r a g e . x m l " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / P y t h o n C o v e r a g e / D a r t C o n f i g u r a t i o n . t c l . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / P y t h o n C o v e r a g e / D a r t C o n f i g u r a t i o n . t c l " )
file ( COPY "${CMake_SOURCE_DIR}/Tests/PythonCoverage/coveragetest"
D E S T I N A T I O N " $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / P y t h o n C o v e r a g e " )
add_test ( NAME CTestPythonCoverage
C O M M A N D c m a k e - E c h d i r
$ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / P y t h o n C o v e r a g e
$ < T A R G E T _ F I L E : c t e s t > - T C o v e r a g e - - d e b u g )
set_tests_properties ( CTestPythonCoverage PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N
" P r o c e s s f i l e . * f o o . p y . * T o t a l L O C : . * 1 3 . * P e r c e n t a g e C o v e r a g e : 8 4 . 6 2 . * "
E N V I R O N M E N T C O V F I L E = )
2013-10-11 02:02:24 +04:00
function ( add_config_tests cfg )
2009-12-04 20:09:01 +03:00
set ( base "${CMake_BINARY_DIR}/Tests/CTestConfig" )
# Test -S script with a -C config arg to ctest:
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 C o n f i g / s c r i p t . c m a k e . i n "
" $ { b a s e } / $ { c f g } - s c r i p t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestConfig.Script. ${ cfg } ${ CMAKE_CTEST_COMMAND }
- C $ { c f g }
- S " $ { b a s e } / $ { c f g } - s c r i p t . c m a k e " - V V
- - o u t p u t - l o g " $ { b a s e } / $ { c f g } - s c r i p t . l o g "
)
# Test -D dashboard with a -C config arg to ctest.
# (Actual commands inside a cmake -P script because we need to be able to set
# the working directory reliably...)
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 C o n f i g / d a s h b o a r d . c m a k e . i n "
" $ { b a s e } / $ { c f g } - d a s h b o a r d . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestConfig.Dashboard. ${ cfg } ${ CMAKE_CMAKE_COMMAND }
- P " $ { b a s e } / $ { c f g } - d a s h b o a r d . c m a k e " - V V
)
2013-10-11 02:02:24 +04:00
endfunction ( )
2009-12-04 20:09:01 +03:00
add_config_tests ( Debug )
add_config_tests ( MinSizeRel )
add_config_tests ( Release )
add_config_tests ( RelWithDebInfo )
2012-06-25 16:25:51 +04:00
# Test -S script with some -D variable definition args to ctest:
add_test ( CTestConfig.ScriptWithArgs ${ CMAKE_CTEST_COMMAND }
- C " R e l e a s e "
- D a r g 1 = t h i s
- D a r g 2 = t h a t
- D " a r g 3 = t h e o t h e r "
" - D a r g 4 = t h i s i s t h e f o u r t h "
- D a r g 5 = t h e _ f i f t h
- D a r g 6 : S T R I N G = v a l u e - w i t h - t y p e
- S " $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t C o n f i g / S c r i p t W i t h A r g s . c m a k e " - V 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 C o n f i g / S c r i p t W i t h A r g s . l o g "
)
2011-10-07 04:41:37 +04:00
ADD_TEST_MACRO ( CMakeCommands.target_link_libraries target_link_libraries )
2013-01-02 02:20:04 +04:00
ADD_TEST_MACRO ( CMakeCommands.target_include_directories target_include_directories )
2013-01-08 03:34:41 +04:00
ADD_TEST_MACRO ( CMakeCommands.target_compile_definitions target_compile_definitions )
2013-05-16 17:20:16 +04:00
ADD_TEST_MACRO ( CMakeCommands.target_compile_options target_compile_options )
2011-10-07 04:41:37 +04:00
2012-08-13 21:47:32 +04:00
configure_file (
2009-09-23 19:38:37 +04: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 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestCrash ${ CMAKE_CTEST_COMMAND }
2009-09-23 19:38:37 +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 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
2012-08-13 21:47:32 +04:00
if ( CMAKE_TEST_GENERATOR MATCHES "Watcom WMake" )
set_tests_properties ( CTestTestCrash PROPERTIES
2009-09-24 22:14:23 +04:00
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 " )
2012-08-13 21:50:14 +04:00
else ( )
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestCrash PROPERTIES
2011-09-06 20:06:36 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " ( I l l e g a l | S e g F a u l t ) " )
2012-08-13 21:50:14 +04:00
endif ( )
2011-01-03 22:41:25 +03:00
2012-08-13 21:47:32 +04:00
configure_file (
2009-12-07 17:34:05 +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 B a d E x e / 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 B a d E x e / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestBadExe ${ CMAKE_CTEST_COMMAND }
2009-12-07 17:34:05 +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 B a d E x e / 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 B a d E x e / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
set ( CTestTestBadExe_REGEX "BAD_COMMAND" )
2010-02-26 21:45:23 +03:00
# some cygwin can not be made to produce a BAD_COMMAND error
2009-12-18 17:24:49 +03:00
# the best we can get from it is a failed test
2012-08-13 21:47:32 +04:00
if ( CYGWIN )
set ( CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND" )
endif ( )
set_tests_properties ( CTestTestBadExe PROPERTIES
2009-12-18 17:24:49 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " $ { C T e s t T e s t B a d E x e _ R E G E X } " )
2012-08-13 21:47:32 +04:00
configure_file (
2009-09-23 19:38:37 +04: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 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestParallel ${ CMAKE_CTEST_COMMAND }
2009-09-23 19:38:37 +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 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 "
)
2010-03-03 18:32:03 +03:00
2013-08-07 18:41:06 +04:00
if ( NOT BORLAND )
set ( CTestLimitDashJ_EXTRA_OPTIONS --force-new-ctest-process )
add_test_macro ( CTestLimitDashJ ${ CMAKE_CTEST_COMMAND } -j 4
- - o u t p u t - o n - f a i l u r e - C " \ $ { C T e s t T e s t _ C O N F I G } " )
endif ( )
Add CTestLimitDashJ test (#12904)
Add a test that verifies that when ctest -j 4 is called, at most, 4 tests
are executed at any one time.
The test works by running the same script as each of 100 tests. And then setting
up test properties for DEPENDS, RUN_SERIAL, PROCESSORS and COST in order to get
the tests to run in a semi-deterministic ordering, even in parallel. The script
writes a file, sleeps for a bit, and then deletes the file. In the meantime, it
counts files that currently exist, and emits output that triggers a test failure
if the count of files is ever greater than 4.
Prior to the commit that fixed bug #12904, this would result in a failed test
because the output of some of the tests would indicate that more than 4 tests
were running simultaneously.
Now that this issue is resolved, this test will help guarantee that it stays
resolved moving forward.
2012-12-27 00:22:59 +04:00
2012-08-13 21:47:32 +04:00
add_test ( CTestTestPrintLabels ${ CMAKE_CTEST_COMMAND } --print-labels )
set_tests_properties ( CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2" )
set_tests_properties ( CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION
2010-08-31 18:41:23 +04:00
" A l l L a b e l s : . * L a b e l 1 . * L a b e l 2 " )
2012-08-13 21:47:32 +04:00
configure_file (
2010-03-03 18:32:03 +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 e s o u r c e L o c k / 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 R e s o u r c e L o c k / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestResourceLock ${ CMAKE_CTEST_COMMAND }
2010-03-03 18:32:03 +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 R e s o u r c e L o c k / 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 e s o u r c e L o c k / o u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
configure_file (
2010-02-04 00:32:26 +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 S c h e d u l e 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 c h e d u l e 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestScheduler ${ CMAKE_CTEST_COMMAND }
2010-02-04 00:32:26 +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 S c h e d u l e 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 c h e d u l e r / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestScheduler PROPERTIES
2011-01-03 19:25:46 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " S t a r t 1 . * S t a r t 2 . * S t a r t 3 . * S t a r t 4 . * S t a r t 4 . * S t a r t 3 . * S t a r t 2 . * S t a r t 1 "
R E S O U R C E _ L O C K " C o s t D a t a " )
2012-08-13 21:47:32 +04:00
configure_file (
2011-01-03 19:25:46 +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 C o s t S e r i a 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 C o s t S e r i a 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestCostSerial ${ CMAKE_CTEST_COMMAND }
2011-01-03 19:25:46 +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 C o s t S e r i a 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 C o s t S e r i a l / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestCostSerial PROPERTIES
2011-01-03 19:25:46 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " S t a r t 2 . * S t a r t 3 . * S t a r t 1 . * S t a r t 2 . * S t a r t 3 . * S t a r t 1 "
R E S O U R C E _ L O C K " C o s t D a t a " )
2010-03-16 22:33:55 +03:00
2012-08-13 21:47:32 +04:00
configure_file (
2010-03-16 22:33:55 +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 S t o p T i m e / 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 t o p T i m e / 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 )
2012-08-13 21:47:32 +04:00
configure_file (
2010-03-16 22:33:55 +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 S t o p T i m e / G e t D a t e . 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 S t o p T i m e / G e t D a t e . c m a k e "
C O P Y O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestStopTime ${ CMAKE_CTEST_COMMAND }
2010-03-16 22:33:55 +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 S t o p T i m e / 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 t o p T i m e / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestStopTime PROPERTIES
2010-03-16 22:33:55 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " T h e s t o p t i m e h a s b e e n p a s s e d " )
2012-08-13 21:47:32 +04:00
configure_file (
2009-10-20 21:35:44 +04: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 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestSubdir ${ CMAKE_CTEST_COMMAND }
2009-10-20 21:35:44 +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 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
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestSubdir PROPERTIES
2009-11-10 18:40:24 +03:00
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 " )
2011-01-03 22:41:25 +03:00
2012-08-13 21:47:32 +04:00
configure_file (
2009-09-29 23:18:46 +04: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 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestTimeout ${ CMAKE_CTEST_COMMAND }
2009-12-01 17:12:07 +03:00
- C " \ $ { C T e s t T e s t _ C O N F I G } "
2009-09-29 23:18:46 +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 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
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestTimeout PROPERTIES
2009-12-01 00:31:28 +03:00
P A S S _ R E G U L A R _ E X P R E S S I O N " T e s t T i m e o u t * \ \ . + * \ \ * \ \ * \ \ * T i m e o u t . * C h e c k C h i l d * \ \ . + * P a s s e d " )
2010-06-30 18:39:17 +04:00
2013-10-11 02:02:24 +04:00
add_test (
N A M E C T e s t T e s t R e r u n F a i l e d
C O M M A N D $ { C M A K E _ C T E S T _ C O M M A N D } - - r e r u n - f a i l e d )
set_tests_properties ( CTestTestRerunFailed PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " 1 / 1 T e s t #1: TestTimeout" DEPENDS CTestTestTimeout
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 T e s t T e s t T i m e o u t )
2013-09-24 22:20:38 +04:00
2012-08-13 21:47:32 +04:00
configure_file (
2011-01-03 22:41:25 +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 Z e r o 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 Z e r o 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestZeroTimeout ${ CMAKE_CTEST_COMMAND }
2011-01-03 22:41:25 +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 Z e r o 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 Z e r o T i m e o u t / t e s t O u t p u t . l o g " )
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestZeroTimeout PROPERTIES
2011-01-03 22:41:25 +03:00
F A I L _ R E G U L A R _ E X P R E S S I O N " \ \ * \ \ * \ \ * T i m e o u t " )
2012-08-13 21:47:32 +04:00
configure_file (
2010-06-30 18:39:17 +04: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 D e p e n d 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 D e p e n d s / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestDepends ${ CMAKE_CTEST_COMMAND }
2010-06-30 18:39:17 +04:00
- C " \ $ { C T e s t T e s t _ C O N F I G } "
- 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 D e p e n d s / 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 D e p e n d s / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
configure_file (
2010-06-30 18:39:17 +04: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 C y c l e / 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 y c l e / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestCycle ${ CMAKE_CTEST_COMMAND }
2010-06-30 18:39:17 +04:00
- C " \ $ { C T e s t T e s t _ C O N F I G } "
- 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 y c l e / 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 y c l e / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestCycle PROPERTIES
2010-06-30 18:39:17 +04:00
P A S S _ R E G U L A R _ E X P R E S S I O N " a c y c l e e x i s t s i n t h e t e s t d e p e n d e n c y g r a p h " )
2012-08-13 21:47:32 +04: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 )
2012-08-13 21:47:32 +04: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 / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestRunScript ${ CMAKE_CTEST_COMMAND }
2009-10-29 19:46:00 +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 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-12-04 20:09:01 +03:00
2012-08-13 21:47:32 +04:00
add_test ( CTestTestShowOnly ${ CMAKE_CTEST_COMMAND } -N )
2009-12-04 20:09:01 +03:00
2012-08-13 21:47:32 +04:00
add_test ( CTestBatchTest ${ CMAKE_CTEST_COMMAND } -B )
2009-12-04 20:09:01 +03:00
2013-03-06 03:14:58 +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 d S e t S i z e / 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 d S e t S i z e / 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 ( CTestTestFdSetSize ${ 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 d S e t S i z e / t e s t . c m a k e " - j 2 0 - V - - t i m e o u t 1 2 0
- - 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 d S e t S i z e / t e s t O u t p u t . l o g "
)
2013-10-11 02:02:24 +04:00
function ( add_failed_submit_test name source build in out log regex )
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}" )
2013-10-11 02:02:24 +04:00
endfunction ( )
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" )
2010-07-13 01:48:33 +04:00
set ( regex "${regex}|Empty reply from server" )
2009-12-15 06:43:40 +03:00
set ( regex "${regex}|The requested URL returned error" )
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" )
2010-07-29 19:39:29 +04:00
set ( regex "${regex}|Submission problem" )
2009-10-16 19:47:51 +04:00
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 ( )
2012-08-13 21:47:32 +04:00
if ( CMAKE_TESTS_CDASH_SERVER )
set ( regex "^([^:]+)://([^/]+)(/.*)$" )
2010-03-08 20:14:47 +03:00
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}" )
set ( protocol "${CMAKE_MATCH_1}" )
set ( server "${CMAKE_MATCH_2}" )
set ( path "${CMAKE_MATCH_3}" )
2012-08-13 21:50:14 +04:00
else ( )
2012-08-13 21:47:32 +04:00
set ( protocol "http" )
set ( server "www.cdash.org" )
set ( path "/CDash" )
message ( "warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex..." )
message ( " ...using default url='${protocol}://${server}${path}' for CTestTest[23]" )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2010-03-08 20:14:47 +03:00
2012-08-13 21:47:32 +04:00
if ( CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
2007-05-11 17:02:17 +04: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 / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTest ${ CMAKE_CTEST_COMMAND }
2007-05-11 17:02:17 +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 / 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 "
)
2010-03-08 20:14:47 +03:00
2012-08-13 21:47:32 +04:00
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in"
2007-05-11 17:02:17 +04: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 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 )
2012-08-13 21:47:32 +04:00
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 "
)
2010-03-08 20:14:47 +03:00
2012-08-13 21:47:32 +04:00
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in"
2010-06-10 20:25:49 +04: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 C h e c k s u m / 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 )
2012-08-13 21:47:32 +04:00
add_test ( CTestTestChecksum ${ CMAKE_CTEST_COMMAND }
2010-06-10 20:25:49 +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 C h e c k s u m / 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 h e c k s u m / t e s t O u t p u t . l o g "
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION
2010-06-10 20:25:49 +04:00
" S u b m i s s i o n f a i l e d : C h e c k s u m f a i l e d f o r f i l e " )
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
2012-08-13 21:47:32 +04:00
get_test_property ( CTestTest TIMEOUT PREVIOUS_TIMEOUT )
if ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
set_tests_properties ( CTestTest
2008-07-03 22:38:57 +04:00
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 } )
2012-08-13 21:50:14 +04:00
endif ( )
2008-07-03 22:38:57 +04:00
2012-08-13 21:47:32 +04:00
get_test_property ( CTestTest2 TIMEOUT PREVIOUS_TIMEOUT )
if ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
set_tests_properties ( CTestTest2
2008-07-03 22:38:57 +04:00
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 } )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2010-03-08 20:14:47 +03:00
2012-08-13 21:47:32 +04:00
if ( "${CMAKE_TEST_GENERATOR}" MATCHES Xcode )
set ( CMAKE_SKIP_BOOTSTRAP_TEST 1 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
if ( EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt" )
2007-05-11 17:02:17 +04:00
# If there is CMakeLists.txt in the binary tree, assume in-source build
2012-08-13 21:47:32 +04:00
set ( CMAKE_SKIP_BOOTSTRAP_TEST 1 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
set ( bootstrap "" )
if ( CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST )
if ( UNIX )
set ( bootstrap ${ CMake_SOURCE_DIR } /bootstrap )
elseif ( MSYS )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /bootstrap.bat.in
2010-06-11 22:03:53 +04:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / b o o t s t r a p . b a t @ O N L Y )
2012-08-13 21:47:32 +04:00
set ( bootstrap ${ CMAKE_CURRENT_BINARY_DIR } /bootstrap.bat )
endif ( )
endif ( )
if ( bootstrap )
add_test ( BootstrapTest ${ 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 }
$ { 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
2010-06-11 22:03:53 +04:00
- - b u i l d - m a k e p r o g r a m $ { b o o t s t r a p }
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 } "
2011-01-03 22:41:25 +03:00
- - t e s t - c o m m a n d
2007-05-11 17:02:17 +04:00
$ { 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest" )
2010-02-11 19:58:04 +03:00
# Make this test run early during parallel execution
2012-08-13 21:47:32 +04:00
set_tests_properties ( BootstrapTest PROPERTIES COST 5000 )
2007-05-11 17:02:17 +04:00
# provide more time for the bootstrap test
2012-08-13 21:47:32 +04:00
get_test_property ( BootstrapTest TIMEOUT PREVIOUS_TIMEOUT )
if ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
set_tests_properties ( BootstrapTest
2009-11-23 18:22:09 +03:00
P R O P E R T I E S T I M E O U T 5 4 0 0 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
endif ( )
2007-05-11 17:02:17 +04:00
2012-08-13 21:47:32 +04:00
if ( CMAKE_Fortran_COMPILER )
add_test ( Fortran ${ CMAKE_CTEST_COMMAND }
2011-09-10 01:11:57 +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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-09-10 01:11:57 +04:00
- - b u i l d - p r o j e c t t e s t f
- - 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran" )
2011-09-10 01:11:57 +04:00
# FortranCInterface tests.
2012-08-13 21:47:32 +04:00
if ( UNIX )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /FortranC/Flags.cmake.in
2011-09-10 01:11:57 +04:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / F o r t r a n C / F l a g s . c m a k e @ O N L Y )
2012-08-13 21:47:32 +04:00
add_test ( FortranC.Flags ${ CMAKE_CMAKE_COMMAND } -P
2011-09-10 01:11:57 +04:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / F o r t r a n C / F l a g s . c m a k e )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags" )
else ( )
add_test ( FortranC ${ CMAKE_CTEST_COMMAND }
2007-05-11 17:02:17 +04:00
- - b u i l d - a n d - t e s t
2011-09-10 01:11:57 +04:00
" $ { 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 "
" $ { 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 C "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-09-10 01:11:57 +04:00
- - b u i l d - p r o j e c t F o r t r a n C
2007-05-11 17:02:17 +04:00
- - b u i l d - t w o - c o n f i g
2011-09-10 01:11:57 +04:00
- - t e s t - c o m m a n d C M a k e F i l e s / F o r t r a n C I n t e r f a c e / F o r t r a n C I n t e r f a c e )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC" )
endif ( )
endif ( )
2007-06-26 23:15:52 +04:00
2011-03-21 14:44:27 +03:00
find_package ( Java COMPONENTS Development QUIET )
2012-08-13 21:47:32 +04:00
if ( Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW
2011-03-18 21:18:11 +03:00
A N D N O T " $ { 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 " X c o d e " )
2012-08-13 21:47:32 +04:00
get_filename_component ( JNIPATH ${ JAVA_COMPILE } PATH )
find_file ( JNI_H jni.h
2011-03-18 20:46:57 +03:00
" $ { 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 " )
2012-08-13 21:47:32 +04:00
if ( JNI_H AND EXISTS "${JNI_H}" ) # in case jni.h is a broken symlink
file ( READ "${JNI_H}" JNI_FILE )
if ( "${JNI_FILE}" MATCHES "JDK1_2" )
add_test ( Java ${ CMAKE_CTEST_COMMAND }
2011-03-18 20:46:57 +03: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 / 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-03-18 20:46:57 +03:00
- - b u i l d - p r o j e c t h e l l o
- - 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 )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java" )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
endif ( )
endif ( )
2007-05-11 17:02:17 +04:00
2007-06-26 23:30:02 +04:00
# add some cross compiler tests, for now only with makefile based generators
2012-08-13 21:47:32 +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
2012-08-13 21:47:32 +04:00
find_program ( SDCC_EXECUTABLE sdcc )
mark_as_advanced ( SDCC_EXECUTABLE )
if ( SDCC_EXECUTABLE )
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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-06-26 23:15:52 +04:00
- - b u i l d - p r o j e c t S i m p l e C
- - 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 } " )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" )
2012-08-13 21:50:14 +04:00
endif ( )
2011-01-03 22:41:25 +03:00
2011-01-14 18:22:15 +03:00
# If a Linux -> MinGW cross compiler is found then try it
2012-08-13 21:47:32 +04:00
find_program ( MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc )
find_program ( MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++ )
find_program ( MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres )
mark_as_advanced ( MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE )
if ( MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE )
add_test ( Simple_Mingw_Linux2Win ${ CMAKE_CTEST_COMMAND }
2007-06-26 23:30:02 +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 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 "
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2007-06-26 23:30:02 +04:00
- - b u i l d - p r o j e c t S i m p l e
- - 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 } "
2011-01-14 18:22:15 +03:00
" - 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 } "
" - D C M A K E _ R C _ C O M P I L E R = $ { M I N G W _ R C _ L I N U X 2 W I N _ E X E C U T A B L E } "
)
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" )
endif ( )
2012-08-13 21:50:14 +04:00
endif ( )
2007-06-26 23:15:52 +04:00
2012-08-13 21:47:32 +04:00
if ( UNIX )
string ( COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
2007-05-11 17:02:17 +04:00
P R E F I X _ I S _ F O R _ T E S T )
2012-08-13 21:47:32 +04:00
if ( PREFIX_IS_FOR_TEST )
configure_file (
2007-05-11 17:02:17 +04:00
$ { 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
)
2012-08-13 21:47:32 +04:00
add_test ( ShellInstall /bin/sh ${ CMake_BINARY_DIR } /Tests/TestShellInstall/TestShellInstall.sh )
2012-08-13 21:50:14 +04:00
endif ( )
endif ( )
2012-08-13 21:47:32 +04:00
if ( CMAKE_TEST_PROJECT_CSE_DIR )
set ( script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake" )
if ( NOT EXISTS "${script}" )
set ( script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake" )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
if ( NOT EXISTS "${script}" )
message ( "warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found..." )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
add_test ( BuildCSE ${ CMAKE_CTEST_COMMAND } -V -S "${script}" )
set_tests_properties ( BuildCSE PROPERTIES TIMEOUT 5400 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
if ( CMAKE_TEST_PLPLOT_DIR )
add_test ( plplot ${ CMAKE_CTEST_COMMAND } -V -S ${ CMAKE_TEST_PLPLOT_DIR } /../../EasyDashboardScripts/plplot.cmake )
set_tests_properties ( plplot PROPERTIES TIMEOUT 5400 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +04:00
if ( CMAKE_TEST_CHICKEN_DIR )
add_test ( Chicken ${ CMAKE_CTEST_COMMAND } -V -S ${ CMAKE_TEST_CHICKEN_DIR } /../../EasyDashboardScripts/Chicken.cmake )
set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400 )
2012-08-13 21:50:14 +04:00
endif ( )
2012-08-13 21:47:32 +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 )
2012-08-13 21:50:14 +04:00
endif ( )
2007-08-08 18:05:11 +04:00
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.
2012-08-13 21:47:32 +04:00
if ( NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt" )
configure_file ( ${ CMake_SOURCE_DIR } /Tests/test_clean.cmake.in
2008-08-19 19:43:57 +04:00
$ { 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 )
2012-08-13 21:47:32 +04:00
add_custom_target ( test_clean
2008-08-19 19:43:57 +04:00
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 . "
)
2012-08-13 21:50:14 +04:00
endif ( )
2008-08-19 19:43:57 +04:00
2012-08-13 21:47:32 +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 )
2010-09-21 18:23:09 +04:00
# If the cache variable CMAKE_CONTRACT_PROJECTS is set
# then the dashboard will run a contract with CMake test of that
# name. For example CMAKE_CONTRACT_PROJECTS = vtk542 would run
# the vtk542 contract test.
2010-09-21 23:08:13 +04:00
# For each Contract test, the project should provide a directory
# with at least one CMakeLists.txt file that uses ExternalProject
# to download and configure the project. The directory should also
# contain a RunTest.cmake file that has a single set of the format:
2012-08-13 21:47:32 +04:00
# set(project_RUN_TEST testToRun)
2010-09-21 23:08:13 +04:00
# The testToRun should be a test executable that can be run to
# smoke test the build.
2012-08-13 21:47:32 +04:00
foreach ( project ${ CMAKE_CONTRACT_PROJECTS } )
include ( Contracts/ ${ project } /RunTest.cmake )
2010-09-21 18:23:09 +04:00
ADD_TEST_MACRO ( Contracts. ${ project }
2010-09-21 23:08:13 +04:00
$ { $ { p r o j e c t } _ R U N _ T E S T } )
2010-10-22 22:31:36 +04:00
# Contract test timeout in seconds.
# Default to 6 hours.
2012-08-13 21:47:32 +04:00
if ( DEFINED ${ project } _TEST_TIMEOUT )
set ( timeout ${ ${project } _TEST_TIMEOUT} )
elseif ( CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT )
set ( timeout ${ CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT } )
else ( )
set ( timeout 21600 )
endif ( )
set_tests_properties ( Contracts. ${ project } PROPERTIES TIMEOUT ${ timeout } )
endforeach ( )
if ( TEST_CompileCommandOutput )
set ( CompileCommandOutput_EXTRA_OPTIONS
2013-02-22 17:14:18 +04:00
- - b u i l d - o p t i o n s - D M A K E _ S U P P O R T S _ S P A C E S = $ { M A K E _ S U P P O R T S _ S P A C E S } )
2011-04-25 21:16:01 +04:00
ADD_TEST_MACRO ( CompileCommandOutput
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e L i b / r u n c o m p i l e c o m m a n d s " )
2012-08-13 21:47:32 +04:00
endif ( )
2011-06-02 18:28:10 +04:00
2012-08-13 21:47:32 +04:00
add_test ( IncludeDirectories ${ CMAKE_CTEST_COMMAND }
2011-06-02 18:28:10 +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 / I n c l u d e D i r e c t o r i e s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / I n c l u d e D i r e c t o r i e s "
- - b u i l d - t w o - c o n f i g
2013-02-06 01:09:55 +04:00
$ { b u i l d _ g e n e r a t o r _ a r g s }
2011-06-02 18:28:10 +04:00
- - b u i l d - p r o j e c t I n c l u d e D i r e c t o r i e s
- - t e s t - c o m m a n d I n c l u d e D i r e c t o r i e s )
2012-08-13 21:47:32 +04:00
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories" )
2011-06-02 18:28:10 +04:00
2013-06-04 18:25:47 +04:00
add_test ( InterfaceLinkLibraries ${ 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 / I n t e r f a c e L i n k L i b r a r i e s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / I n t e r f a c e L i n k L i b r a r i e s "
- - 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 _ a r g s }
- - b u i l d - p r o j e c t I n t e r f a c e L i n k L i b r a r i e s
- - t e s t - c o m m a n d I n t e r f a c e L i n k L i b r a r i e s )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries" )
2012-08-13 21:47:32 +04:00
if ( CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE )
2011-08-04 05:37:01 +04:00
# The "make StyleCheck" command line as a test. If the test fails, look
# for lines like "Error #0 (624) Line length exceed 88 (max=79)" in the
# output to find where the style errors are...
2012-08-13 21:47:32 +04:00
add_test ( KWStyle ${ KWSTYLE_EXECUTABLE }
2011-08-04 05:37:01 +04:00
- x m l $ { C M a k e _ B I N A R Y _ D I R } / C M a k e . k w s . x m l
- o $ { C M a k e _ S O U R C E _ D I R } / U t i l i t i e s / K W S t y l e / C M a k e O v e r w r i t e . t x t
- v
- D $ { C M a k e _ B I N A R Y _ D I R } / C M a k e K W S F i l e s . t x t
)
2012-08-13 21:47:32 +04:00
set_tests_properties ( KWStyle PROPERTIES
2011-08-04 05:37:01 +04:00
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 } / U t i l i t i e s / K W S t y l e )
2012-08-13 21:47:32 +04:00
endif ( )
2007-05-11 18:22:20 +04:00
2013-03-13 22:09:43 +04:00
add_subdirectory ( CMakeTests )
endif ( )