# a macro for tests that have a simple format where the name matches the
# directory and project
macro ( ADD_TEST_MACRO NAME )
if ( ${ ARGC } GREATER 1 )
set ( _test_command --test-command ${ ARGN } )
endif ( )
string ( REPLACE "." "/" dir "${NAME}" )
string ( REGEX REPLACE "[^.]*\\." "" proj "${NAME}" )
add_test ( NAME "${NAME}" 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 / $ { 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 } "
- - 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 $ { p r o j }
$ { $ { N A M E } _ C T E S T _ O P T I O N S }
- - b u i l d - o p t i o n s
$ { $ { N A M E } _ B U I L D _ O P T I O N S }
$ { _ t e s t _ c o m m a n d } )
unset ( _test_command )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}" )
endmacro ( )
include ( ${ CMAKE_CURRENT_SOURCE_DIR } /CheckFortran.cmake )
include ( ${ CMAKE_CURRENT_SOURCE_DIR } /CheckSwift.cmake )
# Fake a user home directory to avoid polluting the real one.
if ( NOT CTEST_NO_TEST_HOME AND ( NOT WIN32 OR DEFINED ENV{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.
# But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that
# need access to the real HOME directory.
if ( DEFINED ENV{HOME} AND NOT DEFINED ENV{CTEST_REAL_HOME} )
set ( ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
endif ( )
set ( ENV{HOME} \"${TEST_HOME}\")
" )
endif ( )
# Suppress generator deprecation warnings in test suite.
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 9 2008" )
set ( TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS9} OFF)" )
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11 2012" )
set ( TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS11} OFF)" )
else ( )
set ( TEST_WARN_VS_CODE "" )
endif ( )
# 3.9 or later provides a definitive answer to whether we are multi-config
# through a global property. Prior to 3.9, CMAKE_CONFIGURATION_TYPES being set
# is assumed to mean multi-config, but developers might modify it so it is
# technically not as reliable.
if ( NOT CMAKE_VERSION VERSION_LESS 3.9 )
get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG )
elseif ( CMAKE_CONFIGURATION_TYPES )
set ( _isMultiConfig True )
else ( )
set ( _isMultiConfig False )
endif ( )
# Choose a default configuration for CTest tests.
set ( CTestTest_CONFIG Debug )
if ( NOT _isMultiConfig AND CMAKE_BUILD_TYPE )
set ( CTestTest_CONFIG ${ CMAKE_BUILD_TYPE } )
endif ( )
configure_file ( ${ CMake_SOURCE_DIR } /Tests/EnforceConfig.cmake.in
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E n f o r c e C o n f i g . c m a k e @ O N L Y )
# Testing
if ( BUILD_TESTING )
set ( CMake_TEST_DEVENV "" )
if ( CMAKE_VS_DEVENV_COMMAND )
set ( CMake_TEST_DEVENV "${CMAKE_VS_DEVENV_COMMAND}" )
elseif ( CMAKE_GENERATOR MATCHES "Visual Studio 9 " AND
N O T C M A K E _ M A K E _ P R O G R A M M A T C H E S " [ m M ] [ s S ] [ b B ] [ u U ] [ i I ] [ l L ] [ d D ] \ \ . [ e E ] [ x X ] [ e E ] " )
set ( CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}" )
endif ( )
if ( CMAKE_GENERATOR MATCHES "Visual Studio|Xcode" )
set ( CMake_TEST_EXPLICIT_MAKE_PROGRAM "" )
else ( )
set ( CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}" )
endif ( )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
if ( "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles" OR ( "${CMAKE_GENERATOR}" MATCHES Ninja AND NOT WIN32 ) )
set ( TEST_CompileCommandOutput 1 )
endif ( )
endif ( )
set ( MAKE_IS_GNU )
if ( CMAKE_MAKE_PROGRAM MATCHES make )
execute_process ( COMMAND ${ CMAKE_MAKE_PROGRAM } 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 _ 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 _ 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 | N i n j a " )
set ( MAKE_SUPPORTS_SPACES 1 )
else ( )
set ( MAKE_SUPPORTS_SPACES 0 )
endif ( )
# assume no resources building to test
set ( CMake_TEST_RESOURCES FALSE )
# for windows and cygwin assume we have resources
if ( WIN32 OR CYGWIN )
set ( CMake_TEST_RESOURCES TRUE )
endif ( )
# for borland and watcom there is no resource support
if ( WATCOM OR BORLAND )
set ( CMake_TEST_RESOURCES FALSE )
endif ( )
set ( build_generator_args
- - b u i l d - g e n e r a t o r $ { C M A K E _ G E N E R A T O R }
)
if ( CMAKE_GENERATOR_PLATFORM )
list ( APPEND build_generator_args
- - b u i l d - g e n e r a t o r - p l a t f o r m $ { C M A K E _ G E N E R A T O R _ P L A T F O R M }
)
endif ( )
if ( CMAKE_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 _ G E N E R A T O R _ T O O L S E T }
)
endif ( )
if ( CMake_TEST_EXPLICIT_MAKE_PROGRAM )
list ( APPEND build_generator_args
- - 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 _ E X P L I C I T _ M A K E _ P R O G R A M }
)
endif ( )
# Look for git to use for tests.
find_program ( GIT_EXECUTABLE NAMES git )
# Look for rpmbuild to use for tests.
# The tool does not work with spaces in the path.
if ( NOT CMAKE_CURRENT_BINARY_DIR MATCHES " " )
find_program ( RPMBUILD_EXECUTABLE NAMES rpmbuild )
else ( )
set ( RPMBUILD_EXECUTABLE "RPMBUILD_EXECUTABLE-NOTFOUND" )
endif ( )
if ( RPMBUILD_EXECUTABLE )
set ( CPACK_BINARY_RPM ON )
else ( )
set ( CPACK_BINARY_RPM OFF )
endif ( )
# Look for dpkg to use for tests.
find_program ( DPKG_EXECUTABLE NAMES dpkg )
if ( DPKG_EXECUTABLE )
set ( CPACK_BINARY_DEB ON )
else ( )
set ( CPACK_BINARY_DEB OFF )
endif ( )
# Look for NuGet to use for tests.
find_program ( NUGET_EXECUTABLE NAMES NuGet nuget )
if ( NUGET_EXECUTABLE )
set ( CPACK_BINARY_NUGET ON )
else ( )
set ( CPACK_BINARY_NUGET OFF )
endif ( )
if ( WIN32 )
# Macro to search for available Windows CE SDKs in the windows Registry
macro ( select_wince_sdk selected_reg selected_sdk )
if ( CMAKE_HOST_WIN32 )
execute_process ( COMMAND reg QUERY "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs"
O U T P U T _ V A R I A B L E s d k _ r e g
E R R O R _ V A R I A B L E m y _ e r r )
string ( REGEX REPLACE "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows CE Tools\\\\SDKs\\\\" ";" sdk_list "${sdk_reg}" )
list ( LENGTH sdk_list sdk_list_len )
if ( ${ sdk_list_len } GREATER 1 )
list ( GET sdk_list 1 _sdk ) # The first entry is always empty due to the regex replace above
string ( STRIP ${ _sdk } _sdk ) # Make sure there is no newline in the SDK name
endif ( )
# Build a key to be used by get_filename_component that is pointing to the SDK directory
set ( _reg "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs\\${_sdk}]" )
# Set return values
set ( ${ selected_reg } ${ _reg } )
set ( ${ selected_sdk } ${ _sdk } )
endif ( CMAKE_HOST_WIN32 )
endmacro ( select_wince_sdk )
set ( reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]" )
set ( reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]" )
set ( reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]" )
set ( reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]" )
set ( reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" )
set ( reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]" )
set ( reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]" )
set ( reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]" )
set ( reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]" )
select_wince_sdk ( reg_wince wince_sdk )
set ( reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]" )
set ( reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]" )
foreach ( reg IN ITEMS vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm )
get_filename_component ( r "${reg_${reg}}" ABSOLUTE )
if ( IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry" )
set ( ${ reg } 1 )
else ( )
set ( ${ reg } 0 )
endif ( )
endforeach ( )
if ( CMAKE_HOST_WIN32 AND COMMAND cmake_host_system_information )
set ( info_vs15 "VS_15_DIR" )
set ( info_vs16 "VS_16_DIR" )
set ( info_vs17 "VS_17_DIR" )
set ( vs_versions )
if ( WIN32 )
if ( NOT CMAKE_VERSION VERSION_LESS 3.21.20210624 )
set ( vs_versions vs15 vs16 vs17 )
elseif ( NOT CMAKE_VERSION VERSION_LESS 3.14 )
set ( vs_versions vs15 vs16 )
elseif ( NOT CMAKE_VERSION VERSION_LESS 3.8 )
set ( vs_versions vs15 )
endif ( )
endif ( )
foreach ( info IN LISTS vs_versions )
cmake_host_system_information ( RESULT found QUERY "${info_${info}}" )
if ( found )
set ( ${ info } 1 )
else ( )
set ( ${ info } 0 )
endif ( )
endforeach ( )
endif ( )
endif ( )
if ( CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT DEFINED CMake_TEST_APPLE_SILICON )
execute_process ( COMMAND sysctl -q hw.optional.arm64
O U T P U T _ V A R I A B L E _ s y s c t l _ s t d o u t
E R R O R _ V A R I A B L E _ s y s c t l _ s t d e r r
R E S U L T _ V A R I A B L E _ s y s c t l _ r e s u l t
)
if ( _sysctl_result EQUAL 0 AND _sysctl_stdout MATCHES "hw.optional.arm64: 1" )
set ( CMake_TEST_APPLE_SILICON 1 )
else ( )
set ( CMake_TEST_APPLE_SILICON 0 )
endif ( )
unset ( _sysctl_result )
unset ( _sysctl_stderr )
unset ( _sysctl_stdout )
endif ( )
#---------------------------------------------------------------------------
# Add tests below here.
if ( NOT DEFINED CMake_TEST_Qt6 )
set ( CMake_TEST_Qt6 1 )
endif ( )
if ( CMake_TEST_Qt6 )
find_package ( Qt6 COMPONENTS Core Widgets QUIET NO_MODULE )
endif ( )
if ( NOT DEFINED CMake_TEST_Qt5 )
set ( CMake_TEST_Qt5 1 )
endif ( )
if ( CMake_TEST_Qt5 )
find_package ( Qt5Widgets QUIET NO_MODULE )
endif ( )
# Collect a list of all test build directories.
set ( TEST_BUILD_DIRS )
# Should the long tests be run?
option ( CMAKE_RUN_LONG_TESTS
" S h o u l d t h e l o n g t e s t s b e run ( such as Bootstrap ) . " O N )
mark_as_advanced ( CMAKE_RUN_LONG_TESTS )
if ( CMAKE_RUN_LONG_TESTS )
option ( CTEST_TEST_CTEST
" S h o u l d t h e t e s t s t h a t r u n a f u l l s u b c t e s t p r o c e s s b e r u n ? "
O F F )
mark_as_advanced ( CTEST_TEST_CTEST )
endif ( )
option ( CTEST_TEST_CPACK
" S h o u l d t h e t e s t s t h a t u s e ' - - b u i l d - t a r g e t p a c k a g e ' b e r u n ? "
O N )
mark_as_advanced ( CTEST_TEST_CPACK )
set ( CTEST_TEST_OSX_ARCH 0 )
set ( CMake_TEST_XCODE_VERSION 0 )
if ( APPLE )
set ( CTEST_TEST_OSX_ARCH 1 )
if ( XCODE_VERSION )
set ( CMake_TEST_XCODE_VERSION "${XCODE_VERSION}" )
else ( )
execute_process (
C O M M A N D x c o d e b u i l d - v e r s i o n
O U T P U T _ V A R I A B L E _ v e r s i o n E R R O R _ V A R I A B L E _ v e r s i o n _ e r r
)
if ( _version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)" )
set ( CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}" )
endif ( )
endif ( )
if ( NOT CMake_TEST_XCODE_VERSION VERSION_LESS 10 )
# Since Xcode 10 we do not have two supported architectures for the host.
set ( CTEST_TEST_OSX_ARCH 0 )
endif ( )
if ( CMAKE_OSX_SYSROOT )
execute_process (
C O M M A N D x c o d e b u i l d - s d k $ { C M A K E _ O S X _ S Y S R O O T } - v e r s i o n P r o d u c t N a m e
O U T P U T _ V A R I A B L E _ s t d o u t
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
E R R O R _ V A R I A B L E _ s t d e r r
R E S U L T _ V A R I A B L E _ f a i l e d
)
if ( NOT _failed )
set ( CMAKE_OSX_SDKPRODUCT "${_stdout}" )
endif ( )
execute_process (
C O M M A N D x c o d e b u i l d - s d k $ { C M A K E _ O S X _ S Y S R O O T } - v e r s i o n S D K V e r s i o n
O U T P U T _ V A R I A B L E _ s t d o u t
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
E R R O R _ V A R I A B L E _ s t d e r r
R E S U L T _ V A R I A B L E _ f a i l e d
)
if ( NOT _failed )
set ( CMAKE_OSX_SDKVERSION "${_stdout}" )
endif ( )
endif ( )
endif ( )
if ( CMake_TEST_XCODE_VERSION AND CMAKE_OSX_SDKVERSION AND CMAKE_OSX_SDKPRODUCT )
if ( ( NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1 ) AND
( ( N O T C M A K E _ O S X _ S D K P R O D U C T S T R E Q U A L " M a c O S X " ) O R
( N O T C M A K E _ O S X _ S D K V E R S I O N V E R S I O N _ L E S S 1 0 . 1 0 ) ) )
if ( CMAKE_GENERATOR STREQUAL "Xcode" )
set ( CMake_TEST_XCODE_SWIFT 1 )
endif ( )
endif ( )
endif ( )
if ( NOT DEFINED CMake_TEST_Swift )
if ( CMAKE_Swift_COMPILER OR CMake_TEST_XCODE_SWIFT )
set ( CMake_TEST_Swift 1 )
endif ( )
endif ( )
if ( NOT DEFINED CMake_TEST_OBJC )
if ( APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU" )
set ( CMake_TEST_OBJC 1 )
endif ( )
endif ( )
# Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
# whichever is greater.
set ( CMAKE_LONG_TEST_TIMEOUT 1500 )
if ( CTEST_TEST_TIMEOUT )
set ( CMAKE_LONG_TEST_TIMEOUT ${ CTEST_TEST_TIMEOUT } )
endif ( )
if ( CMAKE_LONG_TEST_TIMEOUT LESS 1500 )
set ( CMAKE_LONG_TEST_TIMEOUT 1500 )
endif ( )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
add_subdirectory ( CMakeLib )
endif ( )
add_subdirectory ( CMakeOnly )
add_subdirectory ( RunCMake )
add_subdirectory ( FindPackageModeMakefileTest )
add_test ( NAME CMake.Copyright
C O M M A N D $ { C M A K E _ C M A K E _ 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 C o p y r i g h t . c m a k e )
# add a bunch of standard build-and-test style tests
ADD_TEST_MACRO ( CommandLineTest CommandLineTest )
ADD_TEST_MACRO ( FindPackageTest FindPackageTest )
ADD_TEST_MACRO ( StringFileTest StringFileTest )
ADD_TEST_MACRO ( TryCompile TryCompile )
ADD_TEST_MACRO ( SystemInformation SystemInformation )
ADD_TEST_MACRO ( MathTest MathTest )
ADD_TEST_MACRO ( CompileFeatures CompileFeatures )
ADD_TEST_MACRO ( CMakeCommands.target_compile_features )
if ( CMake_TEST_RESOURCES )
ADD_TEST_MACRO ( VSResource VSResource )
if ( CMAKE_GENERATOR MATCHES "Ninja" )
add_test_macro ( VSResourceNinjaForceRSP VSResourceNinjaForceRSP )
endif ( )
endif ( )
if ( _isMultiConfig )
set ( MSManifest_CTEST_OPTIONS -C $< CONFIGURATION > )
endif ( )
ADD_TEST_MACRO ( MSManifest ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
ADD_TEST_MACRO ( Simple Simple )
ADD_TEST_MACRO ( PreOrder PreOrder )
ADD_TEST_MACRO ( MissingSourceFile MissingSourceFile )
set_tests_properties ( MissingSourceFile 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 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 " )
if ( CMake_TEST_Swift )
ADD_TEST_MACRO ( SwiftOnly SwiftOnly )
if ( CMake_TEST_XCODE_SWIFT )
ADD_TEST_MACRO ( SwiftMix SwiftMix )
endif ( )
if ( CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1 )
ADD_TEST_MACRO ( SwiftMixLib Swifty )
endif ( )
endif ( )
if ( CMAKE_Fortran_COMPILER )
ADD_TEST_MACRO ( FortranOnly FortranOnly )
endif ( )
# 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.
if ( CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN )
set ( CMAKE_SKIP_VSGNUFortran FALSE )
# disable test for apple builds using ifort if they are building
# more than one architecture, as ifort does not support that.
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_Fortran_COMPILER_ID STREQUAL IntelLLVM )
message ( STATUS "Skip VSGNUFortran for ifx until DLLEXPORT support is implemented" )
set ( CMAKE_SKIP_VSGNUFortran TRUE )
endif ( )
if ( ( CMAKE_C_COMPILER MATCHES lsb )
AND ( CMAKE_Fortran_COMPILER MATCHES ifort ) )
message ( STATUS "Skip VSGNUFortran for ifort and lsb compilers" )
set ( CMAKE_SKIP_VSGNUFortran TRUE )
endif ( )
if ( NOT CMAKE_SKIP_VSGNUFortran )
ADD_TEST_MACRO ( VSGNUFortran ${ CMAKE_CMAKE_COMMAND } -P runtest.cmake )
endif ( )
endif ( )
if ( CMake_TEST_OBJC )
add_subdirectory ( ObjC )
add_subdirectory ( ObjCXX )
endif ( )
if ( ${ CMAKE_GENERATOR } MATCHES "Visual Studio ([^9]|[9][0-9])" )
ADD_TEST_MACRO ( CSharpOnly CSharpOnly )
if ( NOT CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64" )
ADD_TEST_MACRO ( CSharpLinkToCxx CSharpLinkToCxx )
ADD_TEST_MACRO ( CSharpLinkFromCxx CSharpLinkFromCxx )
endif ( )
ADD_TEST_MACRO ( CSharpWin32GenEx CSharpWin32GenEx )
set_tests_properties ( CSharpWin32GenEx PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " T a r g e t \ " C S h a r p W i n 3 2 G e n E x \ " h a s a g e n e r a t o r e x p r e s s i o n i n i t s \ n W I N 3 2 _ E X E C U T A B L E p r o p e r t y \ \ . T h i s i s n o t s u p p o r t e d o n m a n a g e d e x e c u t a b l e s \ \ . "
)
endif ( )
ADD_TEST_MACRO ( COnly COnly )
ADD_TEST_MACRO ( CxxOnly CxxOnly )
ADD_TEST_MACRO ( CxxSubdirC CxxSubdirC )
ADD_TEST_MACRO ( OutDir runtime/OutDir )
ADD_TEST_MACRO ( OutName exe.OutName.exe )
ADD_TEST_MACRO ( ObjectLibrary UseCshared )
ADD_TEST_MACRO ( NewlineArgs NewlineArgs )
ADD_TEST_MACRO ( SetLang SetLangX )
ADD_TEST_MACRO ( EmptyProperty EmptyProperty )
ADD_TEST_MACRO ( ExternalOBJ ExternalOBJ )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
ADD_TEST_MACRO ( LoadCommand LoadedCommand )
endif ( )
ADD_TEST_MACRO ( LinkDirectory bin/LinkDirectory )
ADD_TEST_MACRO ( LinkLanguage LinkLanguage )
ADD_TEST_MACRO ( LinkLine LinkLine )
ADD_TEST_MACRO ( MacroTest miniMacroTest )
ADD_TEST_MACRO ( FunctionTest miniFunctionTest )
ADD_TEST_MACRO ( ReturnTest ReturnTest )
ADD_TEST_MACRO ( Properties Properties )
ADD_TEST_MACRO ( Assembler HelloAsm )
ADD_TEST_MACRO ( SourceGroups SourceGroups )
ADD_TEST_MACRO ( Preprocess Preprocess )
set ( ExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH= ${ CMake_TEST_EXPLICIT_MAKE_PROGRAM }
- D C M a k e _ T E S T _ C U D A : B O O L = $ { C M a k e _ T E S T _ C U D A }
- D C M a k e _ I N S T A L L _ N A M E _ T O O L _ B U G : B O O L = $ { C M a k e _ I N S T A L L _ N A M E _ T O O L _ B U G }
)
ADD_TEST_MACRO ( ExportImport ExportImport )
set_property ( TEST ExportImport APPEND
P R O P E R T Y L A B E L S " C U D A " )
ADD_TEST_MACRO ( Unset Unset )
ADD_TEST_MACRO ( PolicyScope PolicyScope )
ADD_TEST_MACRO ( EmptyLibrary EmptyLibrary )
ADD_TEST_MACRO ( CompileDefinitions CompileDefinitions )
if ( CMAKE_Fortran_COMPILER )
set ( CompileOptions_BUILD_OPTIONS -DTEST_FORTRAN=1 )
endif ( )
if ( _isMultiConfig )
set ( CompileOptions_CTEST_OPTIONS --build-config $< CONFIGURATION > )
else ( )
set ( CompileOptions_BUILD_OPTIONS -DCMAKE_BUILD_TYPE= $< CONFIGURATION > )
endif ( )
ADD_TEST_MACRO ( CompileOptions CompileOptions )
ADD_TEST_MACRO ( CompatibleInterface CompatibleInterface )
ADD_TEST_MACRO ( AliasTarget AliasTarget )
ADD_TEST_MACRO ( StagingPrefix StagingPrefix )
ADD_TEST_MACRO ( ImportedSameName ImportedSameName )
ADD_TEST_MACRO ( InterfaceLibrary InterfaceLibrary )
if ( NOT CMAKE_GENERATOR STREQUAL "Xcode" )
if ( _isMultiConfig )
set ( ConfigSources_CTEST_OPTIONS --build-config $< CONFIGURATION > )
else ( )
set ( ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE= $< CONFIGURATION > )
endif ( )
ADD_TEST_MACRO ( ConfigSources ConfigSources )
endif ( )
ADD_TEST_MACRO ( SourcesProperty SourcesProperty )
ADD_TEST_MACRO ( SourceFileProperty SourceFileProperty )
if ( NOT CMAKE_GENERATOR STREQUAL "Xcode" )
ADD_TEST_MACRO ( SourceFileIncludeDirProperty SourceFileIncludeDirProperty )
endif ( )
if ( CMAKE_CXX_COMPILER_ID STREQUAL "LCC" OR ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
A N D N O T C M A K E _ C X X _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S 4 . 7 ) )
set ( runCxxDialectTest 1 )
endif ( )
if ( CMAKE_CXX_COMPILER_ID STREQUAL Clang
A N D N O T C M A K E _ C X X _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S 3 . 4 A N D N O T " x $ { C M A K E _ C X X _ S I M U L A T E _ I D } " S T R E Q U A L " x M S V C " )
if ( NOT APPLE OR POLICY CMP0025 )
set ( runCxxDialectTest 1 )
endif ( )
endif ( )
if ( runCxxDialectTest )
ADD_TEST_MACRO ( CxxDialect CxxDialect )
endif ( )
set_tests_properties ( EmptyLibrary 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 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 " )
ADD_TEST_MACRO ( CrossCompile CrossCompile )
set_tests_properties ( CrossCompile PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " t r y _ r u n . . i n v o k e d i n c r o s s - c o m p i l i n g m o d e " )
if ( "${CMAKE_GENERATOR}" MATCHES "Make" )
ADD_TEST_MACRO ( Policy0002 Policy0002 )
endif ( )
if ( CTEST_TEST_OSX_ARCH )
ADD_TEST_MACRO ( Architecture Architecture )
set_tests_properties ( Architecture PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " ( f i l e i s n o t o f r e q u i r e d a r c h i t e c t u r e | d o e s n o t m a t c h c p u t y p e | 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 | b u t a t t e m p t i n g t o l i n k w i t h f i l e b u i l t f o r ) " )
endif ( )
list ( APPEND TEST_BUILD_DIRS ${ CMake_TEST_INSTALL_PREFIX } )
if ( NOT DEFINED CMake_TEST_Qt4 )
set ( CMake_TEST_Qt4 1 )
endif ( )
if ( CMake_TEST_Qt4 AND NOT QT4_FOUND )
find_package ( Qt4 QUIET )
endif ( )
if ( CMake_TEST_Qt4 AND QT4_FOUND )
# 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.
include ( CheckCXXSourceCompiles )
set ( _save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}" )
set ( _save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" )
set ( CMAKE_REQUIRED_INCLUDES ${ QT_INCLUDES } )
set ( CMAKE_REQUIRED_LIBRARIES ${ QT_QTCORE_LIBRARIES } )
CHECK_CXX_SOURCE_COMPILES ( "#include <QCoreApplication>\n int main() {return (qApp == 0 ? 0 : 1); }\n"
Q T 4 _ W O R K S )
set ( CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}" )
set ( CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}" )
endif ( )
# run test for BundleUtilities on supported platforms/compilers
if ( MSVC OR
MINGW O R
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 " )
if ( NOT "${CMAKE_GENERATOR}" STREQUAL "Watcom WMake" )
add_test ( BundleUtilities ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u n d l e 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 "
$ { 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 B u n d l e U t i l i t i e s
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities" )
# run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities)
# this test also depends on the existence of the standard qtiff plugin
if ( QT4_WORKS AND QT_QTSQL_FOUND )
add_test ( Qt4Deploy ${ 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 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 "
$ { 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 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 }
- 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 }
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy" )
endif ( )
endif ( )
endif ( )
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"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e B u i l d T e s t . c m a k e " @ O N L Y )
add_test ( CMakeBuildTest ${ CMAKE_CMAKE_COMMAND } -P
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e B u i l d T e s t . c m a k e " )
list ( APPEND TEST_BUILD_DIRS ${ CMAKE_BUILD_TEST_BINARY_DIR } )
# now do it again for a project that has two project commands
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"
" $ { 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 )
add_test ( CMakeDoubleProject ${ CMAKE_CMAKE_COMMAND } -P
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e B u i l d D o u b l e P r o j e c t T e s t . c m a k e " )
list ( APPEND TEST_BUILD_DIRS ${ CMAKE_BUILD_TEST_BINARY_DIR } )
ADD_TEST_MACRO ( Module.CheckTypeSize CheckTypeSize )
set ( Module.CheckIPOSupported-C_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_C= ${ CMake_TEST_IPO_WORKS_C } )
ADD_TEST_MACRO ( Module.CheckIPOSupported-C CheckIPOSupported-C )
set ( Module.CheckIPOSupported-CXX_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_CXX= ${ CMake_TEST_IPO_WORKS_CXX } )
ADD_TEST_MACRO ( Module.CheckIPOSupported-CXX CheckIPOSupported-CXX )
if ( CMake_TEST_CUDA )
ADD_TEST_MACRO ( Module.CheckIPOSupported-CUDA CheckIPOSupported-CUDA )
set_property ( TEST Module.CheckIPOSupported-CUDA APPEND PROPERTY LABELS "CUDA" )
endif ( )
if ( CMAKE_Fortran_COMPILER )
set ( Module.CheckIPOSupported-Fortran_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_Fortran= ${ CMake_TEST_IPO_WORKS_Fortran } )
ADD_TEST_MACRO ( Module.CheckIPOSupported-Fortran CheckIPOSupported-Fortran )
endif ( )
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 "
$ { 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 E x t e r n a l D a t a T e s t
- - b u i l d - n o c l e a n
- - 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 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 }
- - 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" )
ADD_TEST_MACRO ( Module.FindDependency FindDependency )
ADD_TEST_MACRO ( Module.WriteCompilerDetectionHeader WriteCompilerDetectionHeader )
if ( APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC" )
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 _ 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 ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "LCC" OR
( ( 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 " G N U " ) A N D
( N O T " $ { C M A K E _ C X X _ C O M P I L E R _ V E R S I O N } " V E R S I O N _ L E S S 4 . 2 ) A N D
( 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 " ) ) )
include ( CheckCXXCompilerFlag )
check_cxx_compiler_flag (
- f v i s i b i l i t y - i n l i n e s - h i d d e n r u n _ i n l i n e s _ h i d d e n _ t e s t )
endif ( )
if ( run_inlines_hidden_test )
add_test ( Visibility ${ 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 i s i b i l i t y "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V i s i b i l i t y "
$ { 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 V i s i b i l i t y
)
list ( APPEND TEST_BUILD_DIRS
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V i s i b i l i t y "
)
endif ( )
add_test ( LinkFlags-prepare
$ { 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 "
$ { 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 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 }
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags" )
macro ( ADD_LINK_FLAGS_TEST name depends )
add_test ( LinkFlags- ${ name }
$ { 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 }
)
set_tests_properties ( LinkFlags- ${ name } PROPERTIES
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 } )
endmacro ( )
ADD_LINK_FLAGS_TEST ( lib prepare )
ADD_LINK_FLAGS_TEST ( dll lib )
ADD_LINK_FLAGS_TEST ( mod dll )
ADD_LINK_FLAGS_TEST ( exe mod )
ADD_LINK_FLAGS_TEST ( lib_config exe )
ADD_LINK_FLAGS_TEST ( dll_config lib_config )
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 )
# test for correct sub-project generation
# not implemented in Xcode or Ninja
if ( NOT CMAKE_GENERATOR MATCHES "Xcode|Ninja" )
# run cmake and configure all of SubProject
# but only build the independent executable car
add_test ( SubProject ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b P r o j e c t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b P r o j e c t "
- - b u i l d - p r o j e c t S u b P r o j e c t
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - t a r g e t c a r
- - t e s t - c o m m a n d c a r
)
# For stage 2, do not run cmake again.
# Then build the foo sub project which should build
# the bar library which should be referenced because
# foo links to the static library bar, but bar is not
# directly in the foo sub project
if ( CMake_TEST_EXPLICIT_MAKE_PROGRAM )
set ( SubProject-Stage2_BUILD_MAKEPROGRAM
- - 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 _ E X P L I C I T _ M A K E _ P R O G R A M }
)
endif ( )
add_test ( SubProject-Stage2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b P r o j e c t / f o o "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b P r o j e c t / f o o "
- - b u i l d - g e n e r a t o r $ { C M A K E _ G E N E R A T O R }
- - b u i l d - g e n e r a t o r - p l a t f o r m " $ { C M A K E _ G E N E R A T O R _ P L A T F O R M } "
- - 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 _ G E N E R A T O R _ T O O L S E T } "
$ { S u b P r o j e c t - S t a g e 2 _ B U I L D _ M A K E P R O G R A M }
- - b u i l d - n o c m a k e
- - b u i l d - p r o j e c t f o o
- - b u i l d - t a r g e t f o o
- - 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 "
- - t e s t - c o m m a n d f o o
)
set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject" )
endif ( )
# add tests with more complex invocations
add_test ( Framework ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / F r a m e w o r k "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / F r a m e w o r k "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 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 }
" - 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework" )
add_test ( TargetName ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T a r g e t N a m e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T a r g e t N a m e "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t T a r g e t N a m e
- - t e s t - c o m m a n d $ { C M A K E _ C M A K E _ C O M M A N D } - E c o m p a r e _ f i l e s
$ { C M a k e _ S O U R C E _ D I R } / T e s t s / T a r g e t N a m e / s c r i p t s / h e l l o _ w o r l d
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T a r g e t N a m e / s c r i p t s / h e l l o _ w o r l d )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName" )
add_test ( LibName ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i b N a m e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i b N a m e "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t L i b N a m e
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i b N a m e / l i b "
- - 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 }
- - t e s t - c o m m a n d f o o b a r
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName" )
add_test ( CustComDepend ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C u s t C o m D e p e n d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t C o m D e p e n d "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t C u s t C o m D e p e n d
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t C o m D e p e n d / b i n "
- - t e s t - c o m m a n d f o o b a r . c
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend" )
add_test ( ArgumentExpansion ${ 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 / 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 "
$ { 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 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 "
)
set_tests_properties ( ArgumentExpansion PROPERTIES
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 : " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion" )
add_test ( GeneratorExpression
$ { 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 / 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 "
$ { 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 G e n e r a t o r E x p r e s s i o 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 = \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P 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 } - 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/GeneratorExpression" )
add_test ( CustomCommand ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C u s t o m C o m m a n d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t o m C o m m a n d "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 "
- - b u i l d - o p t i o n s
- - t e s t - c o m m a n d C u s t o m C o m m a n d
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand" )
ADD_TEST_MACRO ( CustomCommandByproducts CustomCommandByproducts )
ADD_TEST_MACRO ( CommandLength CommandLength )
ADD_TEST_MACRO ( EmptyDepends ${ CMAKE_CTEST_COMMAND } )
add_test ( CustomCommandWorkingDirectory ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C u s t o m C o m m a n d W o r k i n g D i r e c t o r y "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C u s t o m C o m m a n d W o r k i n g D i r e c t o r y "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory" )
add_test ( OutOfSource ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / O u t O f S o u r c e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / O u t O f S o u r c e "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 " )
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" )
add_test ( BuildDepends ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u i l d D e p e n d s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u i l d D e p e n d s "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t B u i l d D e p e n d s
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends" )
set ( MissingInstallInstallDir
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / M i s s i n g I n s t a l l / I n s t a l l D i r e c t o r y " )
add_test ( MissingInstall ${ 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 i s s i n g 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 / M i s s i n g I n s t a l l "
$ { 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 T e s t M i s s i n g 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 = $ { M i s s i n g I n s t a l l I n s t a l l D i r } " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MissingInstall" )
# By default, run the CPackComponents test if the CTEST_TEST_CPACK
# option is ON:
#
set ( CTEST_RUN_CPackComponents ${ CTEST_TEST_CPACK } )
set ( CTEST_package_X11_TEST ${ CTEST_TEST_CPACK } )
set ( CTEST_RUN_CPackComponentsForAll ${ CTEST_TEST_CPACK } )
set ( CTEST_RUN_CPackComponentsPrefix ${ CTEST_TEST_CPACK } )
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 "
)
# But on Windows, only run the CPackComponents test if the NSIS
# installer builder is available:
#
if ( WIN32 )
if ( NSIS_MAKENSIS_EXECUTABLE )
set ( CTEST_RUN_CPackComponents ON )
else ( )
set ( CTEST_RUN_CPackComponents OFF )
set ( CTEST_package_X11_TEST OFF )
endif ( )
endif ( )
# 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 }
- 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 / 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 "
$ { 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 C P a c k W i X G e n e r a t o r
- - b u i l d - o p t i o n 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 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 "
" - D n o _ v e r i f y : B O O L = $ { C M a k e _ T E S T _ W I X _ N O _ V E R I F Y } "
" - D 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 } "
- 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 " )
set_property ( TEST CPackWiXGenerator PROPERTY
A T T A C H E D _ F I L E S _ O N _ F A I 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 W i X G e n e r a t o r / _ C P a c k _ P a c k a g e s / w i n 3 2 / W I X / w i x . l o g " )
endif ( )
endif ( )
# On Windows run the CPackInnoSetupGenerator test
if ( WIN32 AND CMake_TEST_CPACK_INNOSETUP )
add_test ( CPackInnoSetupGenerator ${ CMAKE_CTEST_COMMAND }
- 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 / C P a c k I n n o S e t u p 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 I n n o S e t u p G e n e r a t o r "
$ { 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 C P a c k I n n o S e t u p G e n e r a t o r
- - b u i l d - o p t i o n 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 C P a c k I n n o S e t u p 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 I n n o S e t u p G e n e r a t o r "
" - D 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 } "
- 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 I n n o S e t u p 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 " )
set_property ( TEST CPackInnoSetupGenerator PROPERTY
A T T A C H E D _ F I L E S _ O N _ F A I 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 I n n o S e t u p G e n e r a t o r / _ C P a c k _ P a c k a g e s / w i n 3 2 / I N N O S E T U P / I S C C O u t p u t . l o g " )
set_property ( TEST CPackInnoSetupGenerator PROPERTY
A T T A C H 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 P a c k I n n o S e t u p G e n e r a t o r / _ C P a c k _ P a c k a g e s / w i n 3 2 / I N N O S E T U P / I S S c r i p t . i s s " )
endif ( )
# On Windows run the CPackNSISGenerator test
# if the nsis is available
if ( WIN32 AND NSIS_MAKENSIS_EXECUTABLE )
add_test ( CPackNSISGenerator ${ CMAKE_CTEST_COMMAND }
- 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 / C P a c k N S I S 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 N S I S G e n e r a t o r "
$ { 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 C P a c k N S I S G e n e r a t o r
- - b u i l d - o p t i o n 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 C P a c k N S I S 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 N S I S G e n e r a t o r "
" - D 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 } "
- 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 N S I S 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 " )
set_property ( TEST CPackNSISGenerator PROPERTY
A T T A C H E D _ F I L E S _ O N _ F A I 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 N S I S G e n e r a t o r / _ C P a c k _ P a c k a g e s / w i n 3 2 / N S I S / N S I S O u t p u t . l o g " )
endif ( )
if ( CTEST_TEST_CPACK )
add_test ( CPackUseDefaultVersion ${ 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 U s e D e f a u l t V e r s i o n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k U s e D e f a u l t V e r s i o n "
$ { 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 C P a c k U s e D e f a u l t V e r s i o n
- - 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
$ { C P a c k U s e D e f a u l t V e r s i o n _ B U I L D _ O P T I O N S } )
set_tests_properties ( CPackUseDefaultVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=0\\.1\\.1" )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseDefaultVersion" )
add_test ( CPackUseProjectVersion ${ 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 U s e P r o j e c t V e r s i o n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k U s e P r o j e c t V e r s i o n "
$ { 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 C P a c k U s e P r o j e c t V e r s i o n
- - 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
$ { C P a c k U s e P r o j e c t V e r s i o n _ B U I L D _ O P T I O N S } )
set_tests_properties ( CPackUseProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=1\\.2\\.3" )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseProjectVersion" )
add_test ( CPackUseShortProjectVersion ${ 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 U s e S h o r t P r o j e c t V e r s i o n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k U s e S h o r t P r o j e c t V e r s i o n "
$ { 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 C P a c k U s e S h o r t P r o j e c t V e r s i o n
- - 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
$ { C P a c k U s e P r o j e c t V e r s i o n _ B U I L D _ O P T I O N S } )
set_tests_properties ( CPackUseShortProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=2" )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseShortProjectVersion" )
endif ( )
if ( CTEST_RUN_CPackComponents )
set ( CPackComponents_BUILD_OPTIONS )
if ( APPLE )
set ( CPackComponents_BUILD_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON )
if ( CMake_TEST_XCODE_VERSION VERSION_GREATER "4.6" )
set ( CPackComponents_BUILD_OPTIONS ${ CPackComponents_BUILD_OPTIONS }
- D C P A C K _ B I N A R Y _ P R O D U C T B U I L D : B O O L = O N )
endif ( )
endif ( )
if ( NSIS_MAKENSIS_EXECUTABLE )
execute_process ( COMMAND ${ NSIS_MAKENSIS_EXECUTABLE } "-VERSION" ERROR_QUIET OUTPUT_QUIET RESULT_VARIABLE NSIS_OK )
if ( "${NSIS_OK}" STREQUAL "0" )
set ( CPackComponents_BUILD_OPTIONS ${ CPackComponents_BUILD_OPTIONS }
- D C P A C K _ B I N A R Y _ N S I S : B O O L = O N )
endif ( )
endif ( )
add_test ( CPackComponents ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k C o m p o n e n t s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k C o m p o n e n t s "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
- - 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 }
$ { C P a c k C o m p o n e n t s _ B U I L D _ 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 . 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 _ 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 " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents" )
endif ( )
if ( CTEST_RUN_CPackComponentsForAll )
# Check whether if rpmbuild command is found
# before adding RPM tests
if ( CPACK_BINARY_RPM )
list ( APPEND ACTIVE_CPACK_GENERATORS RPM )
endif ( )
# Check whether if dpkg command is found
# before adding DEB tests
if ( CPACK_BINARY_DEB )
list ( APPEND ACTIVE_CPACK_GENERATORS DEB )
endif ( )
# Check whether if NuGet command is found
# before adding NuGet tests
if ( CPACK_BINARY_NUGET )
list ( APPEND ACTIVE_CPACK_GENERATORS NUGET )
set ( CPACK_GENERATOR_STRING_NUGET NuGet )
endif ( )
# ACTIVE_CPACK_GENERATORS variable
# now contains the list of 'active generators'
set ( CPackComponentsForAll_BUILD_OPTIONS )
# set up list of CPack generators
list ( APPEND ACTIVE_CPACK_GENERATORS "ZIP" )
if ( APPLE )
list ( APPEND ACTIVE_CPACK_GENERATORS "DragNDrop" )
if ( CMake_TEST_XCODE_VERSION VERSION_GREATER "4.6" )
list ( APPEND ACTIVE_CPACK_GENERATORS "productbuild" )
endif ( )
endif ( )
# set up list of component packaging ways
list ( APPEND CWAYLST "default" )
list ( APPEND CWAYLST "OnePackPerGroup" )
list ( APPEND CWAYLST "IgnoreGroup" )
list ( APPEND CWAYLST "AllInOne" )
foreach ( CPackGen IN LISTS ACTIVE_CPACK_GENERATORS )
if ( NOT DEFINED CPACK_GENERATOR_STRING_ ${ CPackGen } )
set ( CPACK_GENERATOR_STRING_ ${ CPackGen } ${ CPackGen } )
endif ( )
set ( CPackRun_CPackGen "-DCPackGen=${CPACK_GENERATOR_STRING_${CPackGen}}" )
foreach ( CPackComponentWay IN LISTS CWAYLST )
set ( CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}" )
add_test ( CPackComponentsForAll- ${ CPackGen } - ${ CPackComponentWay }
$ { 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 / 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 } "
$ { 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 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 _ G E N E R A T O R : S T R I N G = $ { C P A C K _ G E N E R A T O R _ S T R I N G _ $ { C P a c k G e n } }
- 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 _ B U I L D _ 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 " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" )
endforeach ( )
endforeach ( )
# debian specific
if ( DPKG_EXECUTABLE )
unset ( CPackRun_CPackDEBConfiguration_ALL_CONFIGS )
set ( DEB_TEST_NAMES "CPackComponentsDEB" )
set ( DEB_CONFIGURATIONS_TO_TEST "components-lintian-dpkgdeb-checks"
" c o m p o n e n t s - d e s c r i p t i o n 1 "
" c o m p o n e n t s - d e s c r i p t i o n 2 "
" c o m p o n e n t s - s o u r c e "
" c o m p o n e n t s - s h l i b d e p s 1 "
" c o m p o n e n t s - d e p e n d 1 "
" c o m p r e s s i o n " )
# Run additional tests if dpkg-shlibdeps is available (and is new enough version)
find_program ( SHLIBDEPS_EXECUTABLE NAMES dpkg-shlibdeps )
if ( SHLIBDEPS_EXECUTABLE )
# Check version of the dpkg-shlibdeps tool
execute_process ( COMMAND ${ CMAKE_COMMAND } -E env LC_ALL=C ${ SHLIBDEPS_EXECUTABLE } --version
O U T P U T _ V A R I A B L E _ T M P _ V E R S I O N
E R R O R _ Q U I E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
if ( _TMP_VERSION MATCHES "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)" )
set ( SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}" )
else ( )
unset ( SHLIBDEPS_EXECUTABLE_VERSION )
endif ( )
if ( NOT SHLIBDEPS_EXECUTABLE_VERSION VERSION_LESS 1.19 OR
( N O T S H L I B D E P S _ E X E C U T A B L E _ V E R S I O N V E R S I O N _ L E S S 1 . 1 7 A N D N O T C M A K E _ B I N A R Y _ D I R M A T C H E S " . * [ ] . * " ) )
list ( APPEND DEB_CONFIGURATIONS_TO_TEST "shlibdeps-with-private-lib-failure"
" s h l i b d e p s - w i t h - p r i v a t e - l i b - s u c c e s s " )
endif ( )
# Check if distro has symbols or shlibs data
file ( GLOB SHLIBS_FILES_EXIST "/var/lib/dpkg/info/*.shlibs" "/var/lib/dpkg/info/*.symbols" )
if ( SHLIBS_FILES_EXIST )
list ( APPEND DEB_CONFIGURATIONS_TO_TEST "components-depend2" )
endif ( )
endif ( )
set ( CPackGen "DEB" )
set ( CPackRun_CPackGen "-DCPackGen=${CPackGen}" )
foreach ( CPackDEBConfiguration IN LISTS DEB_CONFIGURATIONS_TO_TEST )
set ( CPackRun_CPackDEBConfiguration "-DCPackDEBConfiguration=${CPackDEBConfiguration}" )
add_test ( NAME ${ DEB_TEST_NAMES } - ${ CPackDEBConfiguration } COMMAND
$ { C M A K E _ C T E S T _ C O M M A N D } - C $ < C O N F I G >
- - 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 B _ T E S T _ N A M E S } "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / $ { D E B _ T E S T _ N A M E S } / b u i l d $ { C P a c k G e n } - $ { C P a c k D E B C o n f i g u r a t i o n } "
$ { 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 C P a c k C o m p o n e n t s D E B
- - b u i l d - o p t i o n s
- D C P A C K _ G E N E R A T O R : S T R I N G = $ { C P a c k G e n }
- 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 D E B C o n f i g u r a t i o n }
$ { C P a c k R u n _ C P a c k D E B C o n f i g u r a t i o n _ A L L _ C O N F I G S }
- - g r a p h v i z = $ { D E B _ T E S T _ N A M E S } . 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 $ { D E B _ T E S T _ N A M E S } _ 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 / $ { D E B _ T E S T _ N A M E S } "
" - D $ { D E B _ T E S T _ N A M E 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 / $ { D E B _ T E S T _ N A M E S } / b u i l d $ { C P a c k G e n } - $ { C P a c k D E B C o n f i g u r a t i o n } "
" $ { 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 D E B C o n f i g u r a t i o n } "
" - D C O N F I G = $ < C O N F I G > "
- P " $ { C M a k e _ S O U R C E _ D I R } / T e s t s / $ { D E B _ T E S T _ N A M E S } / R u n C P a c k V e r i f y R e s u l t - $ { C P a c k D E B C o n f i g u r a t i o n } . c m a k e " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}" )
endforeach ( )
endif ( )
endif ( )
# By default, turn this test off (because it takes a long time...)
#
if ( NOT DEFINED CTEST_RUN_CPackTestAllGenerators )
set ( CTEST_RUN_CPackTestAllGenerators OFF )
# ...but: if it appears to be a coverage dashboard, or long tests are
# on, then set it to the generic CTEST_TEST_CPACK setting.
#
if ( CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR
N O T " $ E N V { C O V F I L E } " S T R E Q U A L " " O R
C M A K E _ R U N _ L O N G _ T E S T S )
set ( CTEST_RUN_CPackTestAllGenerators ${ CTEST_TEST_CPACK } )
endif ( )
endif ( )
if ( CTEST_RUN_CPackTestAllGenerators )
add_test ( CPackTestAllGenerators ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k T e s t A l l G e n e r a t o r s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C P a c k T e s t A l l G e n e r a t o r s "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" )
endif ( )
if ( CTEST_RUN_CPackComponentsPrefix )
set ( CPackComponents_BUILD_OPTIONS )
if ( APPLE )
set ( CPackComponents_BUILD_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON )
if ( CMake_TEST_XCODE_VERSION VERSION_GREATER "4.6" )
set ( CPackComponents_BUILD_OPTIONS ${ CPackComponents_BUILD_OPTIONS }
- D C P A C K _ B I N A R Y _ P R O D U C T B U I L D : B O O L = O N )
endif ( )
endif ( )
if ( NOT NSIS_MAKENSIS_EXECUTABLE )
set ( CPackComponents_BUILD_OPTIONS ${ CPackComponents_BUILD_OPTIONS }
- D C P A C K _ B I N A R Y _ N S I S : B O O L = O F F )
endif ( )
add_test ( CPackComponentsPrefix ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C P a c k C o m p o n e n t s P r e f i x "
" $ { 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 r e f i x "
$ { 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 C P a c k C o m p o n e n t s P r e f i x
- - 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
- - 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 }
- D C P A C K _ B I N A R Y _ Z I P : B O O L = O N
$ { C P a c k C o m p o n e n t s _ B U I L D _ O P T I O N S }
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsPrefix" )
endif ( )
if ( CTEST_package_X11_TEST )
set ( X11_build_target_arg --build-target package )
else ( )
set ( X11_build_target_arg )
endif ( )
add_test ( X11 ${ 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 / X 1 1 "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / X 1 1 "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
$ { X 1 1 _ b u i l d _ t a r g e t _ a r g }
- - t e s t - c o m m a n d U s e X 1 1 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11" )
if ( NOT DEFINED CTEST_RUN_CMakeTestAllGenerators )
set ( CTEST_RUN_CMakeTestAllGenerators ON )
endif ( )
if ( CTEST_RUN_CMakeTestAllGenerators )
add_test ( CMakeTestAllGenerators ${ CMAKE_CMAKE_COMMAND }
- D d i r = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t A l l G e n e r a t o r s
- D C M a k e _ S O U R C E _ D I R = $ { C M a k e _ S O U R C E _ D I R }
- P $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C M a k e T e s t A l l G e n e r a t o r s / R u n C M a k e . c m a k e
)
list ( APPEND TEST_BUILD_DIRS
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C M a k e T e s t A l l G e n e r a t o r s " )
# This test runs a lot of processes. Do not make them compete
# for resources with other tests.
set_property ( TEST CMakeTestAllGenerators PROPERTY RUN_SERIAL 1 )
endif ( )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
add_test ( LoadedCommandOneConfig ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L o a d C o m m a n d O n e C o n f i g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L o a d C o m m a n d O n e C o n f i g "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t L o a d C o m m a n d
- - t e s t - c o m m a n d L o a d e d C o m m a n d
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" )
endif ( )
add_test ( complex ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C o m p l e x "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C o m p l e x "
- - b u i l d - t w o - c o n f i g
- - b u i l d - c o n f i g - s a m p l e " $ { C M A K E _ C T E S T _ C O M M A N D } "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 "
- 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex" )
add_test ( complexOneConfig ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C o m p l e x O n e C o n f i g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C o m p l e x O n e C o n f i g "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 "
- 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig" )
# because of the registry write these tests depend on each other
set_tests_properties ( complex PROPERTIES DEPENDS complexOneConfig )
add_test ( Environment ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / E n v i r o n m e n t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E n v i r o n m e n t "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
- - 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/Environment" )
set_property ( TEST Environment APPEND
P R O P E R T Y E N V I R O N M E N T
" S E T _ F R O M _ A M B I E N T _ u n s e t = b a s e "
" S E T _ F R O M _ A M B I E N T _ r e p l a c e = b a s e "
" S E T _ F R O M _ A M B I E N T _ s t r i n g = b a s e "
" S E T _ F R O M _ A M B I E N T _ p a t h = b a s e "
" S E T _ F R O M _ A M B I E N T _ l i s t = b a s e " )
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" )
if ( CMake_TEST_Qt6 AND Qt6Widgets_FOUND )
add_subdirectory ( Qt6Autogen )
endif ( )
if ( CMake_TEST_Qt5 AND Qt5Widgets_FOUND )
add_subdirectory ( Qt5Autogen )
endif ( )
if ( QT4_WORKS AND QT_QTGUI_FOUND )
add_subdirectory ( Qt4Autogen )
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 "
$ { 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 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" )
if ( Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0 )
add_test ( Qt4And5AutomocForward ${ 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 F o r w a r 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 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 w a r d "
- - 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/Qt4And5AutomocForward" )
add_test ( Qt4And5AutomocReverse ${ 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 R e v e r s e "
$ { 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 R e v e r s e "
- - 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 _ R E V E R S E _ F I N D _ O R D E R = 1
- - 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/Qt4And5AutomocReverse" )
endif ( )
endif ( )
# test for Find modules, simple cases
foreach (
_ m o d
I N I T E M S
A L S A
B L A S
B o o s t
B Z i p 2
C u p s
C U R L
D e v I L
D o x y g e n
E n v M o d u l e s
E X P A T
F o n t c o n f i g
F r e e t y p e
G D A L
G I F
G i t
G L E W
G L U T
G n u T L S
G S L
G T K 2
H D F 5
I c o n v
I C U
I m a g e M a g i c k
I n t l
J a s p e r
J N I
J P E G
J s o n C p p
L A P A C K
L i b A r c h i v e
L i b i n p u t
L i b L Z M A
L i b R H a s h
L i b U V
L i b X m l 2
L i b X s l t
L T T n g U S T
M P I
O D B C
O p e n A C C
O p e n A L
O p e n C L
O p e n G L
O p e n M P
O p e n S P
O p e n S S L
P a t c h
P N G
P o s t g r e S Q L
P r o t o b u f
S D L
S Q L i t e 3
T I F F
V u l k a n
w x W i d g e t s
X 1 1
X a l a n C
X e r c e s C
)
if ( CMake_TEST_Find ${ _mod } )
add_subdirectory ( Find ${ _mod } )
endif ( )
endforeach ( )
if ( CMake_TEST_CUDA )
add_subdirectory ( Cuda )
add_subdirectory ( CudaOnly )
endif ( )
if ( CMake_TEST_HIP )
add_subdirectory ( HIP )
endif ( )
if ( CMake_TEST_ISPC )
add_subdirectory ( ISPC )
endif ( )
if ( CMake_TEST_FindGTest )
add_subdirectory ( FindGTest )
add_subdirectory ( GoogleTest )
endif ( )
if ( CMake_TEST_FindPython OR CMake_TEST_FindPython_SABIModule OR CMake_TEST_FindPython_NumPy
O R C M a k e _ T E S T _ F i n d P y t h o n _ C o n d a O R C M a k e _ T E S T _ F i n d P y t h o n _ I r o n P y t h o n O R C M a k e _ T E S T _ F i n d P y t h o n _ P y P y )
if ( CMake_TEST_FindPython AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin" )
set ( CMake_TEST_FindPython_SABIModule TRUE )
endif ( )
add_subdirectory ( FindPython )
endif ( )
if ( CMake_TEST_UseSWIG )
add_subdirectory ( UseSWIG )
endif ( )
if ( CMake_TEST_FindRuby )
add_subdirectory ( FindRuby )
endif ( )
add_subdirectory ( FindThreads )
# Matlab module
# CMake_TEST_FindMatlab: indicates to look for Matlab (from PATH for Linux)
# CMake_TEST_FindMatlab_ROOT_DIR: indicates an optional root directory for Matlab, allows to select a version.
# CMake_TEST_FindMatlab_MCR: indicates the MCR is installed
# CMake_TEST_FindMatlab_MCR_ROOT_DIR: indicates an optional root directory for the MCR, required on Linux
if ( CMake_TEST_FindMatlab OR CMake_TEST_FindMatlab_ROOT_DIR OR
C M a k e _ T E S T _ F i n d M a t l a b _ M C R O R C M a k e _ T E S T _ F i n d M a t l a b _ M C R _ R O O T _ D I R )
set ( FindMatlab_additional_test_options )
if ( CMake_TEST_FindMatlab_MCR OR CMake_TEST_FindMatlab_MCR_ROOT_DIR )
set ( FindMatlab_additional_test_options -DIS_MCR=TRUE )
endif ( )
if ( CMake_TEST_FindMatlab_ROOT_DIR )
set ( FindMatlab_additional_test_options ${ FindMatlab_additional_test_options } "-DMatlab_ROOT_DIR=${CMake_TEST_FindMatlab_ROOT_DIR}" )
endif ( )
if ( CMake_TEST_FindMatlab_MCR_ROOT_DIR )
set ( FindMatlab_additional_test_options ${ FindMatlab_additional_test_options } "-DMCR_ROOT:FILEPATH=${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" )
endif ( )
set ( FindMatlab.basic_checks_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.basic_checks ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.basic_checks APPEND PROPERTY LABELS "Matlab" )
set ( FindMatlab.versions_checks_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.versions_checks ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.versions_checks APPEND PROPERTY LABELS "Matlab" )
set ( FindMatlab.components_checks_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.components_checks ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.components_checks APPEND PROPERTY LABELS "Matlab" )
set ( FindMatlab.failure_reports_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.failure_reports ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.failure_reports APPEND PROPERTY LABELS "Matlab" )
set ( FindMatlab.r2018a_check_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.r2018a_check ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.r2018a_check APPEND PROPERTY LABELS "Matlab" )
set ( FindMatlab.targets_checks_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.targets_checks ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.targets_checks APPEND PROPERTY LABELS "Matlab" )
set ( FindMatlab.no_implicit_link_checks_BUILD_OPTIONS ${ FindMatlab_additional_test_options } )
ADD_TEST_MACRO ( FindMatlab.no_implicit_link_checks ${ CMAKE_CTEST_COMMAND } -V -C $< CONFIGURATION > )
set_property ( TEST FindMatlab.no_implicit_link_checks APPEND PROPERTY LABELS "Matlab" )
endif ( )
set ( ExternalProject_BUILD_OPTIONS "" )
foreach ( vcs IN ITEMS CVS SVN GIT HG )
if ( DEFINED CMake_TEST_ExternalProject_ ${ vcs } )
list ( APPEND ExternalProject_BUILD_OPTIONS -DEP_TEST_ ${ vcs } = ${ CMake_TEST_ExternalProject_${vcs } } )
endif ( )
endforeach ( )
add_test ( ExternalProject ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / E x t e r n a l P r o j e c t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / E x t e r n a l P r o j e c t "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
- - b u i l d - o p t i o n s $ { E x t e r n a l P r o j e c t _ B U I L D _ O P T I O N 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/ExternalProject" )
set_tests_properties ( ExternalProject PROPERTIES
E N V I R O N M E N T G I T _ A L L O W _ P R O T O C O L = f i l e
R U N _ S E R I A L 1
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 ExternalProjectSubdir
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 O N F I G U R A T I O N >
- - 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 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 / E x t e r n a l P r o j e c t S u b d i r "
$ { 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 E x t e r n a l P r o j e c t S u b d i r
- - f o r c e - n e w - c t e s t - p r o c e s s
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir" )
add_test ( NAME ExternalProjectSourceSubdir
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 O N F I G U R A T I O N >
- - 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 S o u r c e 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 / E x t e r n a l P r o j e c t S o u r c e S u b d i r "
$ { 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 E x t e r n a l P r o j e c t S o u r c e S u b d i r
- - f o r c e - n e w - c t e s t - p r o c e s s
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir" )
add_test ( NAME ExternalProjectSourceSubdirNotCMake
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 O N F I G U R A T I O N >
- - 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 S o u r c e S u b d i r N o t C M a k 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 S o u r c e S u b d i r N o t C M a k e "
$ { 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 E x t e r n a l P r o j e c t S o u r c e S u b d i r N o t C M a k e
- - f o r c e - n e w - c t e s t - p r o c e s s
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdirNotCMake" )
add_test ( ExternalProjectLocal ${ 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 L o c a l "
" $ { 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 L o c a l "
$ { 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 E x t e r n a l P r o j e c t L o c a l 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 L o c a l "
- - 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/ExternalProjectLocal" )
set_tests_properties ( ExternalProjectLocal PROPERTIES
R U N _ S E R I A L 1
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 ( 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 "
$ { 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 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
R U N _ S E R I A L 1
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 }
- 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 _ G E N E R A T O R = $ { C M A K E _ G E N E R A T O R }
- D C M A K E _ G E N E R A T O R _ P L A T F O R M = $ { C M A K E _ G E N E R A T O R _ P L A T F O R M }
- D C M A K E _ G E N E R A T O R _ T O O L S E T = $ { C M A K E _ G E N E R A T O R _ T O O L S E T }
- 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
R U N _ S E R I A L 1
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
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
)
execute_process (
C O M M A N D $ { C M A K E _ C O M M A N D }
" - E " c r e a t e _ s y m l i n k
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C M a k e L i s t s . t x t " # random source file that exists
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / t r y _ t o _ c r e a t e _ s y m l i n k " # random target file in existing directory
R E S U L T _ V A R I A B L E _ s y m l i n k _ r e s u l t
O U T P U T _ V A R I A B L E _ s y m l i n k _ s t d o u t
E R R O R _ V A R I A B L E _ s y m l i n k _ s t d e r r
)
if ( _symlink_result EQUAL 0 )
file ( REMOVE "${CMake_BINARY_DIR}/Tests/try_to_create_symlink" )
function ( add_installmode_test _mode )
set ( ENV{CMAKE_INSTALL_MODE} _mode )
set ( _maybe_InstallMode_CTEST_OPTIONS )
set ( _maybe_BUILD_OPTIONS )
if ( _isMultiConfig )
set ( _maybe_CTEST_OPTIONS -C $< CONFIGURATION > )
else ( )
set ( _maybe_BUILD_OPTIONS "-DCMAKE_BUILD_TYPE=$<CONFIGURATION>" )
endif ( )
add_test (
N A M E " I n s t a l l M o d e - $ { _ m o d e } "
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 $ { _ m a y b e _ C T E S T _ O P T I O N S }
- - 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 s t a l l M o d e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / I n s t a l l M o d e - $ { _ m o d e } "
$ { 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 s u p e r p r 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 } / T e s t s / I n s t a l l M o d e - $ { _ m o d e } "
- - 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
$ { _ m a y b 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 / I n s t a l l M o d e - $ { _ m o d e } / i n s t a l l "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InstallMode-${_mode}" )
unset ( ENV{CMAKE_INSTALL_MODE} )
endfunction ( )
add_installmode_test ( COPY )
add_installmode_test ( REL_SYMLINK )
add_installmode_test ( REL_SYMLINK_OR_COPY )
add_installmode_test ( ABS_SYMLINK )
add_installmode_test ( ABS_SYMLINK_OR_COPY )
add_installmode_test ( SYMLINK )
add_installmode_test ( SYMLINK_OR_COPY )
endif ( )
# do each of the tutorial steps
function ( add_tutorial_test step_name use_mymath tutorial_arg pass_regex )
set ( tutorial_test_name Tutorial ${ step_name } )
set ( tutorial_build_dir "${CMake_BINARY_DIR}/Tests/Tutorial/${step_name}" )
if ( use_mymath )
set ( tutorial_build_options "" )
else ( )
set ( tutorial_test_name ${ tutorial_test_name } _MYMATH )
set ( tutorial_build_dir "${tutorial_build_dir}_MYMATH" )
set ( tutorial_build_options -DUSE_MYMATH:BOOL=OFF )
endif ( )
add_test ( ${ tutorial_test_name } ${ CMAKE_CTEST_COMMAND }
- C " R e l e a s 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 } / H e l p / g u i d e / t u t o r i a l / $ { s t e p _ n a m e } "
$ { t u t o r i a l _ b u i l d _ d i r } _ B u i l 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 T u t o r i a l
- - b u i l d - o p t i o n s $ { t u t o r i a l _ b u i l d _ o p t i o n s }
- - t e s t - c o m m a n d T u t o r i a l $ { t u t o r i a l _ a r g } )
set_tests_properties ( ${ tutorial_test_name } PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N $ { p a s s _ r e g e x } )
list ( APPEND TEST_BUILD_DIRS "${tutorial_build_dir}_Build" )
endfunction ( )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
foreach ( STP RANGE 2 12 )
if ( STP EQUAL 8 )
set ( pass_regex ".*using log and exp" )
else ( )
set ( pass_regex "The square root of 25 is 5" )
endif ( )
add_tutorial_test ( Step ${ STP } TRUE 25 ${ pass_regex } )
endforeach ( )
set ( pass_regex "The square root of 25 is 5" )
add_tutorial_test ( Complete TRUE 25 ${ pass_regex } )
foreach ( STP RANGE 3 12 )
add_tutorial_test ( Step ${ STP } FALSE 25 ${ pass_regex } )
endforeach ( )
add_tutorial_test ( Complete FALSE 25 ${ pass_regex } )
endif ( )
function ( add_importexport_test export_name import_name )
set ( install_dir
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / I m p o r t E x p o r t / I n s t a l l $ { e x p o r t _ n a m e } " )
set ( export_build_dir "${CMake_BINARY_DIR}/Tests/ImportExport/${export_name}Build" )
set ( export_test_name "Guide.ImportExport.${export_name}" )
add_test ( ${ export_test_name } ${ CMAKE_CTEST_COMMAND }
- C " R e l e a s 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 } / H e l p / g u i d e / i m p o r t i n g - e x p o r t i n g / $ { e x p o r t _ n a m e } "
" $ { e x p o r t _ b u i l d _ d i r } "
$ { 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 $ { e x p o r t _ n a m e }
- - b u i l d - t a r g e t i n s t a l l
- - 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 = $ { i n s t a l l _ d i r } " )
list ( APPEND TEST_BUILD_DIRS "${export_build_dir}" )
set ( import_build_dir "${CMake_BINARY_DIR}/Tests/ImportExport/${import_name}Build" )
set ( import_test_name "Guide.ImportExport.${import_name}" )
add_test ( ${ import_test_name } ${ CMAKE_CTEST_COMMAND }
- C " R e l e a s 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 } / H e l p / g u i d e / i m p o r t i n g - e x p o r t i n g / $ { i m p o r t _ n a m e } "
" $ { i m p o r t _ b u i l d _ d i r } "
$ { 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 m p o r t _ n a m e }
- - b u i l d - o p t i o n s
" - D C M A K E _ P R E F I X _ P A T H : P A T H = $ { i n s t a l l _ d i r } " )
set_tests_properties ( ${ import_test_name } PROPERTIES DEPENDS ${ export_test_name } )
list ( APPEND TEST_BUILD_DIRS "${import_build_dir}" )
endfunction ( )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
add_importexport_test ( "MyExe" "Importing" )
add_importexport_test ( "MathFunctions" "Downstream" )
add_importexport_test ( "MathFunctionsComponents" "DownstreamComponents" )
endif ( )
add_test ( testing ${ CMAKE_CTEST_COMMAND } -C \${CTEST_CONFIGURATION_TYPE}
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t i n g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t i n g "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t T e s t i n g
- - 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 }
)
set_tests_properties ( testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed" )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing" )
add_test ( wrapping ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / W r a p p i n g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
)
add_test ( qtwrapping ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / W r a p p i n g "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / W r a p p i n g "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 q t w r a p p i n g
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping" )
add_test ( testdriver1 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r 1 "
$ { b u i l d _ g e n e r a t o r _ a r g 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 / 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver1" )
add_test ( testdriver2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r 2 "
$ { b u i l d _ g e n e r a t o r _ a r g 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 / 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver2" )
add_test ( testdriver3 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r 3 "
$ { b u i l d _ g e n e r a t o r _ a r g 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 / 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver3" )
add_test ( testdriver4 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r 4 "
$ { b u i l d _ g e n e r a t o r _ a r g 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 / 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 - A t e s t 2
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver4" )
add_test ( testdriver5 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / T e s t D r i v e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / T e s t D r i v e r 5 "
$ { b u i l d _ g e n e r a t o r _ a r g 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 / 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 - A t e s t 2
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver5" )
set_tests_properties ( testdriver5 PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N
" T A P v e r s i o n 1 3 \ n 1 \ \ . \ \ . 3 . + o k 1 t e s t 1 # [0-9]+\\.[0-9]+.*All tests finished."
)
add_test ( Dependency ${ 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 / D e p e n d e n c y "
" $ { 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 "
$ { 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 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency" )
if ( CMAKE_SYSTEM_NAME MATCHES syllable )
# RPATH isn't supported under Syllable, so the tests don't
# find their libraries. In order to fix that LIBRARY_OUTPUT_DIR
# in the tests would have to be adjusted to ${EXECUTABLE_OUTPUT_DIR}/lib .
# For now we just require on Syllable that the user adjusts the DLL_PATH
# environment variable, so except the two tests below all other tests will succeed.
set ( _DLL_PATH "$ENV{DLL_PATH}" )
if ( NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$" )
message ( FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \" \\@bindir\\@/.\" to the DLL_PATH environment variable " )
endif ( )
if ( NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$" )
message ( FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \" \\@bindir\\@/../lib\" to the DLL_PATH environment variable " )
endif ( )
else ( )
add_test ( JumpWithLibOut ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J u m p "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / W i t h L i b O u t "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / W i t h L i b O u t / E x e c u t a b l e "
- - b u i l d - p r o j e c t J u m p
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - o p t i o n s
- D L I B R A R Y _ O U T P U T _ P A T H : P A T H = $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / W i t h L i b O u t / L i b
- - t e s t - c o m m a n d j u m p E x e c u t a b l e
)
add_test ( JumpNoLibOut ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J u m p "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / N o L i b O u t "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / N o L i b O u t / E x e c u t a b l e "
- - b u i l d - r u n - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J u m p / N o L i b O u t / E x e c u t a b l e "
- - b u i l d - p r o j e c t J u m p
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump" )
add_test ( Plugin ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / P l u g i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / P l u g i n "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin" )
if ( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG )
ADD_TEST_MACRO ( RuntimePath RuntimePath )
endif ( )
endif ( )
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
- - b u i l d - o p t i o n s
- D C M a k e _ T E S T _ N E S T E D _ 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 _ E X P L I C I T _ M A K E _ P R O G R A M }
)
endif ( )
if ( CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5 )
if ( NOT CMake_TEST_XCTest_DEPLOYMENT_TARGET )
execute_process (
C O M M A N D s w _ v e r s - p r o d u c t V e r s i o n
O U T P U T _ V A R I A B L E O S X _ V E R S I O N
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
if ( OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)" )
set ( CMake_TEST_XCTest_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}" )
endif ( )
endif ( )
if ( CMake_TEST_XCTest_DEPLOYMENT_TARGET )
set ( XCTest_CTEST_OPTIONS --build-config $< CONFIGURATION > )
set ( XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET= ${ CMake_TEST_XCTest_DEPLOYMENT_TARGET } -DCMAKE_OSX_SYSROOT=macosx )
ADD_TEST_MACRO ( XCTest ${ CMAKE_CTEST_COMMAND } -C $< CONFIGURATION > -V )
endif ( )
endif ( )
add_test ( linkorder1 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i n k L i n e O r d e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k L i n e O r d e r "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t L i n k L i n e O r d e r
- - t e s t - c o m m a n d E x e c 1
)
add_test ( linkorder2 ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i n k L i n e O r d e r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / L i n k L i n e O r d e r "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
)
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 )
# Test static linking on toolchains known to support it.
if ( ( CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC" )
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 " )
add_test ( LinkStatic ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / L i n k 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 "
$ { 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 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
)
endif ( )
if ( MAKE_SUPPORTS_SPACES AND NOT CMAKE_GENERATOR STREQUAL "Xcode" AND NOT CMAKE_GENERATOR STREQUAL "Watcom WMake" )
add_test ( SubDirSpaces ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b D i r S p a c e s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r S p a c e s "
- - b u i l d - e x e - d i r
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r S p a c e s / E x e c u t a b l e S o u r c e s "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces" )
endif ( )
if ( WIN32 )
add_test ( SubDir ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b D i r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / E x e c u t a b l e "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t S U B D I R
- - t e s t - c o m m a n d t e s t
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / S h o u l d B e H e r e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / t e s t f r o m s u b d i r . o b j "
)
else ( )
add_test ( SubDir ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S u b D i r "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r "
- - b u i l d - e x e - d i r " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / E x e c u t a b l e "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - b u i l d - p r o j e c t S U B D I R
- - t e s t - c o m m a n d t e s t
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / S h o u l d B e H e r e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S u b D i r / t e s t f r o m s u b d i r . o "
)
endif ( )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir" )
if ( MSVC OR ( CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_SIMULATE_ID STREQUAL "MSVC" ) )
ADD_TEST_MACRO ( PDBDirectoryAndName myexe )
if ( NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU" )
ADD_TEST_MACRO ( ForceInclude foo )
endif ( )
if ( NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM" )
ADD_TEST_MACRO ( PrecompiledHeader foo )
endif ( )
set ( MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_CUDA= ${ CMake_TEST_CUDA } )
if ( CMAKE_Fortran_COMPILER )
list ( APPEND MSVCDebugInformationFormat_BUILD_OPTIONS -DCMake_TEST_Fortran=1 )
endif ( )
ADD_TEST_MACRO ( MSVCDebugInformationFormat )
set_property ( TEST MSVCDebugInformationFormat APPEND
P R O P E R T Y L A B E L S " C U D A " )
set ( MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA= ${ CMake_TEST_CUDA } )
ADD_TEST_MACRO ( MSVCRuntimeLibrary )
set_property ( TEST MSVCRuntimeLibrary APPEND
P R O P E R T Y L A B E L S " C U D A " )
if ( CMAKE_Fortran_COMPILER )
ADD_TEST_MACRO ( MSVCRuntimeLibrary.Fortran )
endif ( )
endif ( )
if ( MSVC OR
" $ { C M A K E _ 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 " )
ADD_TEST_MACRO ( ModuleDefinition example_exe )
endif ( )
if ( CMAKE_C_COMPILER_ID MATCHES "Watcom" AND WIN32 )
ADD_TEST_MACRO ( WatcomRuntimeLibrary )
endif ( )
ADD_TEST_MACRO ( CheckCompilerRelatedVariables CheckCompilerRelatedVariables )
if ( "${CMAKE_GENERATOR}" MATCHES "Makefile" OR
" $ { C M A K E _ G E N E R A T O R } " M A T C H E S " ^ N i n j a $ " )
add_test ( MakeClean ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / M a k e C l e a n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / M a k e C l e a n "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean" )
endif ( )
if ( CMake_TEST_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
$ { 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 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 ( )
if ( MSVC AND NOT MSVC_VERSION LESS 1700
AND ( CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64" )
)
ADD_TEST_MACRO ( VSMARMASM VSMARMASM )
endif ( )
if ( MSVC AND NOT MSVC_VERSION LESS 1310
AND ( NOT CMAKE_GENERATOR MATCHES "Visual Studio 9 "
O R C M A K E _ S I Z E O F _ V O I D _ P E Q U A L 4 )
AND ( NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64" )
)
ADD_TEST_MACRO ( VSMASM VSMASM )
endif ( )
if ( ${ CMAKE_GENERATOR } MATCHES "Visual Studio" )
if ( NOT MSVC60 )
ADD_TEST_MACRO ( SBCS SBCS )
endif ( )
if ( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio 9 "
A N D N O T C M A K E _ G E N E R A T O R _ T O O L S E T S T R E Q U A L " v 9 0 "
A N D N O T C M A K E _ V S _ P L A T F O R M _ N A M E S T R E Q U A L " A R M 6 4 " )
ADD_TEST_MACRO ( VSWindowsFormsResx VSWindowsFormsResx )
ADD_TEST_MACRO ( VSManagedCustomCommand )
endif ( )
add_test ( VSExternalInclude ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / V S E x t e r n a l I n c l u d e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S E x t e r n a l I n c l u d e "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude" )
add_test ( VSMidl ${ 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 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
$ { 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 V S M i d l
- - t e s t - c o m m a n d V S M i d l )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl" )
if ( CMake_TEST_DEVENV )
# The test (and tested property) works with .sln files, so it's skipped when:
# * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file
set ( _last_test "" )
foreach ( config IN LISTS 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
- - b u i l d - g e n e r a t o r $ { C M A K E _ 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 _ D E V E N V }
- - b u i l d - g e n e r a t o r - p l a t f o r m " $ { C M A K E _ G E N E R A T O R _ P L A T F O R M } "
- - 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 _ G E N E R A T O R _ T O O L S E T } "
- - 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
- - b u i l d - t a r g e t i n s t a l l
- - 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 " )
if ( _last_test )
set_property ( TEST VSExcludeFromDefaultBuild- ${ config } PROPERTY DEPENDS ${ _last_test } )
endif ( )
set ( _last_test "VSExcludeFromDefaultBuild-${config}" )
endforeach ( )
unset ( _last_test )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild" )
endif ( )
if ( CMAKE_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])" )
# This is Visual Studio 10 or above, so the default build tool is MSBuild.
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 _ G E N E R A T O R }
- - b u i l d - g e n e r a t o r - p l a t f o r m " $ { C M A K E _ G E N E R A T O R _ P L A T F O R M } "
- - 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 _ G E N E R A T O R _ T O O L S E T } "
- - 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 ( )
get_filename_component ( ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME )
if ( WIN32 AND ntver VERSION_GREATER 6.1 ) # Windows >= 8.0
macro ( add_test_VSWinStorePhone name generator systemName systemVersion architecture )
add_test ( NAME VSWinStorePhone. ${ name } 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 W i n S t o r e P h o n e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S W i n S t o r e P h o n e / $ { n a m e } "
- - b u i l d - g e n e r a t o r " $ { g e n e r a t o r } "
- - b u i l d - g e n e r a t o r - p l a t f o r m " $ { a r c h i t e c t u r e } "
- - b u i l d - p r o j e c t V S W i n S t o r e P h o n e
- - b u i l d - c o n f i g $ < C O N F I G U R A T I O N >
- - 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 = $ { s y s t e m N a m e }
- D C M A K E _ S Y S T E M _ V E R S I O N = $ { s y s t e m V e r s i o n }
- - 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 A P P _ P A C K A G E _ D I R = " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S W i n S t o r e P h o n e / $ { n a m e } "
- P " $ { C M a k e _ S O U R C E _ D I R } / T e s t s / V S W i n S t o r e P h o n e / V e r i f y A p p P a c k a g e . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}" )
endmacro ( )
if ( vs11 AND ws80 )
add_test_VSWinStorePhone ( vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0 Win32 )
add_test_VSWinStorePhone ( vs11-store80-ARM "Visual Studio 11 2012" WindowsStore 8.0 ARM )
add_test_VSWinStorePhone ( vs11-store80-X64 "Visual Studio 11 2012" WindowsStore 8.0 x64 )
endif ( )
if ( vs12 AND ws81 )
add_test_VSWinStorePhone ( vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1 Win32 )
add_test_VSWinStorePhone ( vs12-store81-ARM "Visual Studio 12 2013" WindowsStore 8.1 ARM )
add_test_VSWinStorePhone ( vs12-store81-X64 "Visual Studio 12 2013" WindowsStore 8.1 x64 )
add_test ( NAME VSXaml 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 X a m l "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S X a m l "
- - b u i l d - g e n e r a t o r " V i s u a l S t u d i o 1 2 2 0 1 3 "
- - b u i l d - p r o j e c t V S X a m l
- - b u i l d - c o n f i g $ < C O N F I G U R A T I O N >
- - 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 S t o r e
- D C M A K E _ S Y S T E M _ V E R S I O N = 8 . 1
)
endif ( )
if ( CMake_TEST_VSWinStorePhone_VS_2017 AND ws10_0 )
add_test_VSWinStorePhone ( vs15-store10_0-X86 "Visual Studio 15 2017" WindowsStore 10.0 Win32 )
add_test_VSWinStorePhone ( vs15-store10_0-ARM "Visual Studio 15 2017" WindowsStore 10.0 ARM )
add_test_VSWinStorePhone ( vs15-store10_0-X64 "Visual Studio 15 2017" WindowsStore 10.0 x64 )
add_test_VSWinStorePhone ( vs15-store10_0-ARM64 "Visual Studio 15 2017" WindowsStore 10.0 ARM64 )
endif ( )
if ( vs14 AND ws10_0 )
add_test_VSWinStorePhone ( vs14-store10_0-X86 "Visual Studio 14 2015" WindowsStore 10.0 Win32 )
add_test_VSWinStorePhone ( vs14-store10_0-ARM "Visual Studio 14 2015" WindowsStore 10.0 ARM )
add_test_VSWinStorePhone ( vs14-store10_0-X64 "Visual Studio 14 2015" WindowsStore 10.0 x64 )
endif ( )
if ( vs11 AND wp80 )
add_test_VSWinStorePhone ( vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0 Win32 )
add_test_VSWinStorePhone ( vs11-phone80-ARM "Visual Studio 11 2012" WindowsPhone 8.0 ARM )
endif ( )
if ( vs12 AND wp81 )
add_test_VSWinStorePhone ( vs12-phone81-X86 "Visual Studio 12 2013" WindowsPhone 8.1 Win32 )
add_test_VSWinStorePhone ( vs12-phone81-ARM "Visual Studio 12 2013" WindowsPhone 8.1 ARM )
endif ( )
endif ( )
if ( WIN32 AND wince )
macro ( add_test_VSWinCE name generator systemName systemVersion generatorPlatform )
# TODO: Fix the tutorial to make it work in cross compile
# currently the MakeTable is build for target and can not be used on the host
# This happens in part 5 so we build only through part 4 of the tutorial.
foreach ( STP RANGE 2 4 )
add_test ( NAME "TutorialStep${STP}.${name}" 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 } / H e l p / g u i d e / 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 } _ $ { n a m e } "
- - b u i l d - g e n e r a t o r " $ { g e n e r a t o r } "
- - b u i l d - p r o j e c t T u t o r i a l
- - b u i l d - c o n f i g $ < C O N F I G U R A T I O N >
- - 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 = $ { s y s t e m N a m e }
- D C M A K E _ S Y S T E M _ V E R S I O N = $ { s y s t e m V e r s i o n }
- D C M A K E _ G E N E R A T O R _ P L A T F O R M = $ { g e n e r a t o r P l a t f o r m } )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}_${name}" )
endforeach ( )
endmacro ( )
if ( vs11 )
add_test_VSWinCE ( vs11-ce80-ARM "Visual Studio 11 2012" WindowsCE 8.0 ${ wince_sdk } )
endif ( )
if ( vs12 )
add_test_VSWinCE ( vs12-ce80-ARM "Visual Studio 12 2013" WindowsCE 8.0 ${ wince_sdk } )
endif ( )
endif ( )
if ( CMAKE_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])" AND nasm )
ADD_TEST_MACRO ( VSNASM VSNASM )
endif ( )
if ( CMake_TEST_GreenHillsMULTI )
macro ( add_test_GhsMulti test_name test_dir bin_sub_dir build_opts )
separate_arguments ( _ghs_build_opts UNIX_COMMAND ${ build_opts } )
separate_arguments ( _ghs_toolset_extra UNIX_COMMAND ${ ghs_toolset_extra } )
if ( ${ ARGC } GREATER 4 )
set ( _ghs_test_command --test-command ${ ARGN } )
endif ( )
if ( ghs_config_name STREQUAL "__default__" )
set ( _ghs_test_name "${test_name}" )
else ( )
set ( _ghs_test_name "${ghs_config_name}.${test_name}" )
endif ( )
add_test ( NAME GhsMulti. ${ _ghs_test_name }
C O M M A N D $ { C M A K E _ C T E S T _ C O M M A N D }
- - 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 h s M u l t i / $ { t e s t _ d i r } "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / G h s M u l t i / $ { g h s _ c o n f i g _ n a m e } / $ { t e s t _ d i r } / $ { b i n _ s u b _ d i r } "
- - b u i l d - g e n e r a t o r " G r e e n H i l l s M U L T I "
- - b u i l d - p r o j e c t t e s t
- - b u i l d - c o n f i g $ < C O N F I G U R A T I O N >
- - 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 $ { g h s _ t a r g e t _ a r c h } $ { g h s _ t o o l s e t _ n a m e } $ { g h s _ t o o l s e t _ r o o t } $ { g h s _ t a r g e t _ p l a t f o r m }
$ { g h s _ o s _ r o o t } $ { g h s _ o s _ d i r } $ { g h s _ b s p _ n a m e } $ { _ g h s _ b u i l d _ o p t s } $ { _ g h s _ t o o l s e t _ e x t r a }
$ { _ g h s _ t e s t _ c o m m a n d }
)
unset ( _ghs_build_opts )
unset ( _ghs_toolset_extra )
unset ( _ghs_test_command )
unset ( _ghs_test_name )
endmacro ( )
macro ( add_test_GhsMulti_rename_install test_name )
add_test_GhsMulti ( ${ test_name } GhsMultiRenameInstall ${ test_name }
" - D C M A K E _ I N S T A L L _ P R E F I X = . - D R U N _ T E S T = $ { t e s t _ n a m e } " $ { C M A K E _ C M A K E _ C O M M A N D } - - b u i l d . - - t a r g e t I N S T A L L )
endmacro ( )
#unset ghs config variables
unset ( ghs_config_name )
unset ( ghs_target_arch )
unset ( ghs_toolset_root )
unset ( ghs_toolset_name )
unset ( ghs_os_root )
unset ( ghs_os_dir )
unset ( ghs_target_platform )
unset ( ghs_bsp_name )
unset ( ghs_toolset_extra )
if ( NOT CMake_TEST_GreenHillsMULTI_config )
#if list of config settings not defined then just run once as default
set ( CMake_TEST_GreenHillsMULTI_config "__default__" )
endif ( )
foreach ( ghs_file IN LISTS CMake_TEST_GreenHillsMULTI_config )
# source GHS tools config file
if ( NOT ghs_file STREQUAL "__default__" )
if ( IS_ABSOLUTE ${ ghs_file } )
include ( ${ ghs_file } )
else ( )
include ( ${ CMAKE_BINARY_DIR } / ${ ghs_file } )
endif ( )
endif ( )
if ( NOT ghs_config_name )
set ( ghs_config_name "__default__" )
endif ( )
# test integrity build
if ( NOT ghs_skip_integrity AND ( NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity" ) )
add_test_GhsMulti ( integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "" )
add_test_GhsMulti ( integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "" )
add_test_GhsMulti ( integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "" )
endif ( )
add_test_GhsMulti ( duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "" )
add_test_GhsMulti_rename_install ( SINGLE_EXEC )
add_test_GhsMulti_rename_install ( SINGLE_EXEC_RENAMED )
add_test_GhsMulti_rename_install ( EXEC_AND_LIB )
add_test_GhsMulti ( multiple_source_groups GhsMultiSrcGroups Default "" )
add_test_GhsMulti ( multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON" )
add_test_GhsMulti ( multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DCMAKE_GHS_NO_SOURCE_GROUP_FILE=ON" )
add_test_GhsMulti ( unsupported_targets GhsMultiUnsupportedTargets "" "" )
add_test_GhsMulti ( object_library GhsMultiObjectLibrary "" "" )
add_test_GhsMulti ( exclude GhsMultiExclude "" ""
$ { C M A K E _ C M A K E _ 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 / G h s M u l t i / G h s M u l t i E x c l u d e / v e r i f y . c m a k e )
add_test_GhsMulti ( interface GhsMultiInterface "" "" )
add_test_GhsMulti ( transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS" )
add_test_GhsMulti ( flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS" )
add_test_GhsMulti ( sub_link_test GhsMultiLinkTestSub "" "" )
add_test_GhsMulti ( multiple_projects GhsMultiMultipleProjects "" ""
$ { C M A K E _ C M A K E _ 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 / G h s M u l t i / G h s M u l t i M u l t i p l e P r o j e c t s / v e r i f y . c m a k e )
add_test_GhsMulti ( compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\" \"")
add_test_GhsMulti ( compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG" )
add_test_GhsMulti ( try_compile_copy GhsMultiCopyFile "" "" )
add_test_GhsMulti ( ghs_platform GhsMultiPlatform "" "" )
add_test_GhsMulti ( custom_target GhsMultiCustomTarget "" "" )
add_test_GhsMulti ( dep_order GhsMultiDepOrder "" "" )
add_test_GhsMulti ( external_project GhsMultiExternalProject "" "" )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}" )
#unset ghs config variables
unset ( ghs_config_name )
unset ( ghs_target_arch )
unset ( ghs_toolset_root )
unset ( ghs_toolset_name )
unset ( ghs_os_root )
unset ( ghs_os_dir )
unset ( ghs_target_platform )
unset ( ghs_bsp_name )
unset ( ghs_toolset_extra )
endforeach ( )
endif ( )
macro ( add_test_VSAndroid name generator platform )
add_test ( NAME "VSAndroid.${name}.${platform}" 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 A n d r o i d "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / V S A n d r o i d / $ { n a m e } / $ { p l a t f o r m } "
- - b u i l d - g e n e r a t o r " $ { g e n e r a t o r } "
- - b u i l d - p r o j e c t V S A n d r o i d
- - b u i l d - c o n f i g $ < C O N F I G U R A T I O N >
- - 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 = A n d r o i d " - A $ { p l a t f o r m } "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}" )
endmacro ( )
if ( tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " " )
if ( vs11 )
add_test_VSAndroid ( vs11 "Visual Studio 11 2012" "Tegra-Android" )
endif ( )
if ( vs12 )
add_test_VSAndroid ( vs12 "Visual Studio 12 2013" "Tegra-Android" )
endif ( )
if ( vs14 )
add_test_VSAndroid ( vs14 "Visual Studio 14 2015" "Tegra-Android" )
endif ( )
endif ( )
if ( vs14 AND CMake_TEST_ANDROID_VS14 )
add_test_VSAndroid ( vs14 "Visual Studio 14 2015" "ARM" )
endif ( )
if ( vs15 AND CMake_TEST_ANDROID_VS15 )
add_test_VSAndroid ( vs15 "Visual Studio 15 2017" "ARM" )
endif ( )
if ( vs16 AND CMake_TEST_ANDROID_VS16 )
add_test_VSAndroid ( vs16 "Visual Studio 16 2019" "ARM" )
endif ( )
if ( vs17 AND CMake_TEST_ANDROID_VS17 )
add_test_VSAndroid ( vs17 "Visual Studio 17 2022" "ARM" )
endif ( )
if ( APPLE )
if ( CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
set ( BundleTestInstallDir
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e T e s t / I n s t a l l D i r e c t o r y " )
add_test ( BundleTest ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u n d l e T e s t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e T e s t "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest" )
add_test ( NAME CFBundleTest 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 / 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
$ { 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 C F B u n d l e T e s t
- - b u i l d - c o n f i g $ < C O N F I G U R A T I O N >
- - 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 O N F I G U R A T I O N >
- 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 _ 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest" )
endif ( )
endif ( )
if ( APPLE AND CTEST_TEST_CPACK )
add_test ( BundleGeneratorTest ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / B u n d l e G e n e r a t o r T e s t "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / B u n d l e G e n e r a t o r T e s t "
- - b u i l d - t w o - c o n f i g
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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
- - 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 "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" )
endif ( )
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" )
add_test ( WarnUnusedCliUsed ${ 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 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 "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 " )
set_tests_properties ( WarnUnusedCliUsed PROPERTIES
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 " )
set_tests_properties ( WarnUnusedCliUsed PROPERTIES
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 ' " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed" )
add_test ( WarnUninitialized ${ 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 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 "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 " )
set_tests_properties ( WarnUninitialized PROPERTIES
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 ' " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized" )
add_test ( TestsWorkingDirectory
$ { 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 / 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 "
$ { 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 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 "
- - 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 - C \ $ { 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/TestsWorkingDirectory" )
# Make sure CTest can handle a test with no newline in output.
add_test ( CTest.NoNewline
$ { 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 ! " )
# A simple test for ctest in script mode
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t S c r i p t M o d e / C T e s t T e s t S c r i p t M o d e . c m a k e " @ O N L Y )
# add_test(CTest.ScriptMode ${CMAKE_CTEST_COMMAND}
# -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake"
# )
# Test CTest Update with Subversion
if ( NOT DEFINED CMake_TEST_CTestUpdate_SVN OR CMake_TEST_CTestUpdate_SVN )
find_package ( Subversion QUIET )
if ( Subversion_FOUND )
get_filename_component ( _Subversion_BIN_DIR
$ { S u b v e r s i o n _ S V N _ E X E C U T A B L E } P A T H )
find_program ( Subversion_SVNADMIN_EXECUTABLE svnadmin
H I N T S $ { _ S u b v e r s i o n _ B I N _ D I R }
)
mark_as_advanced ( Subversion_SVNADMIN_EXECUTABLE )
if ( NOT Subversion_SVNADMIN_EXECUTABLE )
set ( Subversion_FOUND FALSE )
endif ( )
endif ( )
endif ( )
if ( NOT DEFINED CMake_TEST_CTestUpdate_SVN AND Subversion_FOUND )
set ( CMake_TEST_CTestUpdate_SVN 1 )
endif ( )
if ( CMake_TEST_CTestUpdate_SVN )
if ( NOT Subversion_FOUND )
message ( FATAL_ERROR "CMake_TEST_CTestUpdate_SVN enabled but Subversion is not found." )
endif ( )
set ( CTestUpdateSVN_DIR "CTest UpdateSVN" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e S V N . c m a k e " @ O N L Y )
add_test ( CTest.UpdateSVN ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e S V N . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}" )
endif ( )
# Test CTest Update with CVS
if ( NOT DEFINED CMake_TEST_CTestUpdate_CVS OR CMake_TEST_CTestUpdate_CVS )
find_program ( CVS_EXECUTABLE NAMES cvs )
mark_as_advanced ( CVS_EXECUTABLE )
endif ( )
if ( NOT DEFINED CMake_TEST_CTestUpdate_CVS AND CVS_EXECUTABLE
AND ( UNIX OR NOT "${CVS_EXECUTABLE}" MATCHES "cygwin" ) )
set ( CMake_TEST_CTestUpdate_CVS 1 )
endif ( )
if ( CMake_TEST_CTestUpdate_CVS )
if ( NOT CVS_EXECUTABLE )
message ( FATAL_ERROR "CMake_TEST_CTestUpdate_CVS enabled but CVS_EXECUTABLE is not found." )
endif ( )
set ( CTestUpdateCVS_DIR "CTest UpdateCVS" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e C V S . c m a k e " @ O N L Y )
add_test ( CTest.UpdateCVS ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e C V S . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}" )
endif ( )
# Test CTest Update with BZR
if ( CMake_TEST_CTestUpdate_BZR )
if ( TEST_HOME )
file ( MAKE_DIRECTORY "${TEST_HOME}/.bazaar" )
endif ( )
find_program ( BZR_EXECUTABLE NAMES bzr )
mark_as_advanced ( BZR_EXECUTABLE )
if ( NOT BZR_EXECUTABLE )
message ( FATAL_ERROR "CMake_TEST_CTestUpdate_BZR enabled but BZR_EXECUTABLE is not found." )
endif ( )
set ( CTestUpdateBZR_DIR "CTest UpdateBZR" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R . c m a k e " @ O N L Y )
add_test ( CTest.UpdateBZR ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}" )
set ( CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R _ C L o c a l e . c m a k e " @ O N L Y )
add_test ( CTest.UpdateBZR.CLocale ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e B Z R _ C L o c a l e . c m a k e "
)
set_tests_properties ( CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}" )
endif ( )
# Test CTest Update with GIT
if ( NOT DEFINED CMake_TEST_CTestUpdate_GIT AND GIT_EXECUTABLE
AND ( UNIX OR NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" ) )
set ( CMake_TEST_CTestUpdate_GIT 1 )
endif ( )
if ( CMake_TEST_CTestUpdate_GIT )
if ( NOT GIT_EXECUTABLE )
message ( FATAL_ERROR "CMake_TEST_CTestUpdate_GIT enabled but GIT_EXECUTABLE is not found." )
endif ( )
set ( CTestUpdateGIT_DIR "CTest UpdateGIT" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e G I T . c m a k e " @ O N L Y )
add_test ( CTest.UpdateGIT ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e G I T . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}" )
set_property ( TEST CTest.UpdateGIT PROPERTY ENVIRONMENT GIT_ALLOW_PROTOCOL=file )
endif ( )
# Test CTest Update with HG
if ( NOT DEFINED CMake_TEST_CTestUpdate_HG OR CMake_TEST_CTestUpdate_HG )
find_program ( HG_EXECUTABLE NAMES hg )
mark_as_advanced ( HG_EXECUTABLE )
endif ( )
if ( NOT DEFINED CMake_TEST_CTestUpdate_HG AND HG_EXECUTABLE
AND ( UNIX OR NOT "${HG_EXECUTABLE}" MATCHES "cygwin" ) )
execute_process ( COMMAND "${HG_EXECUTABLE}" --version OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE HG_RV )
if ( HG_RV EQUAL 0 )
set ( CMake_TEST_CTestUpdate_HG 1 )
endif ( )
endif ( )
if ( CMake_TEST_CTestUpdate_HG )
if ( NOT HG_EXECUTABLE )
message ( FATAL_ERROR "CMake_TEST_CTestUpdate_HG enabled but HG_EXECUTABLE is not found." )
endif ( )
set ( CTestUpdateHG_DIR "CTest UpdateHG" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e H G . c m a k e " @ O N L Y )
add_test ( CTest.UpdateHG ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e H G . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}" )
endif ( )
# Test CTest Update with P4
if ( CMake_TEST_CTestUpdate_P4 )
find_program ( P4_EXECUTABLE NAMES p4 )
find_program ( P4D_EXECUTABLE NAMES p4d )
mark_as_advanced ( P4_EXECUTABLE P4D_EXECUTABLE )
if ( NOT P4_EXECUTABLE OR NOT P4D_EXECUTABLE )
message ( FATAL_ERROR "CMake_TEST_CTestUpdate_HG enabled but P4_EXECUTABLE and P4D_EXECUTABLE are not both not found." )
endif ( )
set ( CTestUpdateP4_DIR "CTest UpdateP4" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestUpdateP4.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e P 4 . c m a k e " @ O N L Y )
add_test ( CTest.UpdateP4 ${ CMAKE_CMAKE_COMMAND }
- P " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t U p d a t e P 4 . c m a k e "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateP4_DIR}" )
endif ( )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o B u i l d . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o B u i l d . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestNoBuild ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o B u i l d . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t O u t 1 . l o g "
)
set_tests_properties ( CTestTestNoBuild PROPERTIES
F A I L _ R E G U L A R _ E X P R E S S I O N " E r r o r " W I L L _ F A I L t r u e )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o E x e . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o E x e . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestNoExe ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t N o E x e . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t F a i l u r e / t e s t O u t 2 . l o g "
)
set_tests_properties ( CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild
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 " )
if ( NOT CMake_TEST_NO_NETWORK )
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 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 )
add_test ( CTestTestUpload ${ 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 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 "
)
set_tests_properties ( CTestTestUpload PROPERTIES
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 " )
endif ( )
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 v e r a g e C o l l e c t G C O V / 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 C o v e r a g e C o l l e c t G C O V / 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 ( CTestCoverageCollectGCOV ${ CMAKE_CTEST_COMMAND }
- C \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P 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 C o v e r a g e C o l l e c t G C O V / t e s t . 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 v e r a g e C o l l e c t G C O V / t e s t O u t . l o g "
)
set_property ( TEST CTestCoverageCollectGCOV PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL= )
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 E m p t y B i n a r y D i r e c t o r y / 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 E m p t y B i n a r y D i r e c t o r y / 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 ( CTestTestEmptyBinaryDirectory ${ 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 E m p t y B i n a r y D i r e c t o r y / 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 E m p t y B i n a r y D i r e c t o r y / t e s t O u t . l o g "
)
set_tests_properties ( CTestTestEmptyBinaryDirectory PROPERTIES
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 _ S U C C E S S " )
# 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 ( REMOVE_RECURSE "${CMake_BINARY_DIR}/Testing/MumpsCoverage/VistA-FOIA" )
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 " )
add_test ( NAME CTestGTMCoverage
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 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 )
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
" P r o c e s s f i l e . * Z Z C O V T S T . m . * T o t a l L O C : . * 3 2 . * P e r c e n t a g e C o v e r a g e : 8 1 . 2 5 * "
E N V I R O N M E N T C O V F I L E = )
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 ( REMOVE_RECURSE "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/VistA-FOIA" )
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 " )
add_test ( NAME CTestCacheCoverage
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 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 )
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
" P r o c e s s f i l e . * Z Z C O V T S T . m . * T o t a l L O C : . * 3 2 . * P e r c e n t a g e C o v e r a g e : 8 7 . 5 0 . * "
E N V I R O N M E N T C O V F I L E = )
# 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 _ C M A K E _ C O M M A N D } - 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 = )
# Adding a test case for non-python Cobertura Coverage
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C o b e r t u r a 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 / C o b e r t u r a 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 / C o b e r t u r a 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 / C o b e r t u r a C o v e r a g e / c o v e r a g e . x m l " )
file ( COPY "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/src"
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 / C o b e r t u r a C o v e r a g e " )
add_test ( NAME CTestCoberturaCoverage
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 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 / C o b e r t u r a 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 ( CTestCoberturaCoverage 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 . * C o v e r a g e T e s t . j a v a . * T o t a l L O C : . * 1 8 . * P e r c e n t a g e C o v e r a g e : 7 2 . 2 2 . * "
E N V I R O N M E N T C O B E R T U R A D I R = $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / C o b e r t u r a C o v e r a g e
E N V I R O N M E N T C O V F I L E = )
# Adding a test case for JaCoCo Coverage
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J a c o c o 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 / J a c o c o 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/JacocoCoverage/Coverage"
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 / J a c o c o C o v e r a g e " )
configure_file ( "${CMake_BINARY_DIR}/Testing/JacocoCoverage/Coverage/target/site/jacoco.xml.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / J a c o c o C o v e r a g e / C o v e r a g e / t a r g e t / s i t e / j a c o c o . x m l " )
add_test ( NAME CTestJacocoCoverage
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 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 / J a c o c o 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 ( CTestJacocoCoverage 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 . * C o v e r a g e T e s t . j a v a . * T o t a l L O C : . * 1 7 . * P e r c e n t a g e C o v e r a g e : 7 6 . 4 7 * "
E N V I R O N M E N T C O V F I L E = )
# Adding a test case for Javascript Coverage
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / J a v a s c r i p t 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 / J a v a s c r i p t 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 / J a v a s c r i p t C o v e r a g e / o u t p u t . j s o n . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t i n g / J a v a s c r i p t C o v e r a g e / o u t p u t . j s o n " )
file ( COPY "${CMake_SOURCE_DIR}/Tests/JavascriptCoverage/"
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 / J a v a s c r i p t C o v e r a g e "
F I L E S _ M A T C H I N G P A T T E R N " * . j s " )
add_test ( NAME CTestJavascriptCoverage
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 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 / J a v a s c r i p t 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 ( CTestJavascriptCoverage 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 . * t e s t 3 . j s . * T o t a l L O C : . * 4 9 . * P e r c e n t a g e C o v e r a g e : 7 9 . 5 9 * "
E N V I R O N M E N T C O V F I L E = )
# test coverage for Delphi-code-Coverage
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / D e l p h i 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 / D e l p h i 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/DelphiCoverage/src"
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 / D e l p h i C o v e r a g e " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / D e l p h i C o v e r a g e / UTCovTest ( UTCovTest.pas ) . h t 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 / D e l p h i C o v e r a g e / UTCovTest ( UTCovTest.pas ) . h t m l " )
add_test ( NAME CTestDelphiCoverage
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 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 / D e l p h i 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 ( CTestDelphiCoverage 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 . * U T C o v T e s t . p a s . * T o t a l L O C : . * 2 0 . * P e r c e n t a g e C o v e r a g e : 9 5 . * "
E N V I R O N M E N T C O V F I L E = )
function ( add_config_tests cfg )
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
)
endfunction ( )
add_config_tests ( Debug )
add_config_tests ( MinSizeRel )
add_config_tests ( Release )
add_config_tests ( RelWithDebInfo )
# 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 "
)
ADD_TEST_MACRO ( CMakeCommands.add_compile_definitions add_compile_definitions )
ADD_TEST_MACRO ( CMakeCommands.add_compile_options add_compile_options )
ADD_TEST_MACRO ( CMakeCommands.target_link_libraries target_link_libraries )
ADD_TEST_MACRO ( CMakeCommands.target_include_directories target_include_directories )
ADD_TEST_MACRO ( CMakeCommands.target_compile_definitions target_compile_definitions )
ADD_TEST_MACRO ( CMakeCommands.target_compile_options target_compile_options )
ADD_TEST_MACRO ( CMakeCommands.target_sources target_sources )
ADD_TEST_MACRO ( CMakeCommands.add_link_options )
ADD_TEST_MACRO ( CMakeCommands.target_link_options )
ADD_TEST_MACRO ( CMakeCommands.link_directories )
ADD_TEST_MACRO ( CMakeCommands.target_link_directories )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestCrash ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C r a s h / t e s t O u t p u t . l o g "
)
# with watcom the SEGFAULT is not found, it just fails
if ( CMAKE_GENERATOR MATCHES "Watcom WMake" )
set_tests_properties ( CTestTestCrash PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " F a i l e d " )
else ( )
set_tests_properties ( CTestTestCrash PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " ( I l l e g a l | S e g F a u l t | S u b p r o c e s s a b o r t e d | S I G T R A P ) " )
endif ( )
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 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 )
add_test ( CTestTestBadExe ${ 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 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 "
)
set ( CTestTestBadExe_REGEX "BAD_COMMAND" )
# some cygwin can not be made to produce a BAD_COMMAND error
# the best we can get from it is a failed test
if ( CYGWIN )
set ( CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND" )
endif ( )
set_tests_properties ( CTestTestBadExe PROPERTIES
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 } " )
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 B a d G e n e r a t o 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 B a d G e n e r a t o r / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestBadGenerator ${ CMAKE_CTEST_COMMAND }
- 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 B a d G e n e r a t o 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 B a d G e n e r a t o r / t e s t O u t p u t . l o g "
)
set_property ( TEST CTestTestBadGenerator PROPERTY
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 c r e a t e g e n e r a t o r n a m e d \ " B a d G e n e r a t o r \ " " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestParallel ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t P a r a l l e l / t e s t O u t p u t . l o g "
)
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTestVerboseOutput/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t V e r b o s e O u t p u t / t e s t . c m a k e " @ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestVerboseOutput ${ 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 V e r b o s e O u t p u t / t e s t . 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 T e s t V e r b o s e O u t p u t / t e s t O u t p u t . l o g "
- C " \ $ { C T e s t T e s t _ C O N F I G } "
)
set_property ( TEST CTestTestVerboseOutput PROPERTY PASS_REGULAR_EXPRESSION
" T e s t c o m m a n d : . * W o r k i n g D i r e c t o r y : . * E n v i r o n m e n t v a r i a b l e s : . * f o o = b a r . * t h i s = t h a t "
)
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t S k i p R e t u r n C o d 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 k i p R e t u r n C o d 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 ( CTestTestSkipReturnCode ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S k i p R e t u r n C o d 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 k i p R e t u r n C o d e / t e s t O u t p u t . l o g "
- C \ $ { C T E S T _ C O N F I G U R A T I O N _ T Y P E }
)
set_tests_properties ( CTestTestSkipReturnCode 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 V 1 \ \ . * + P a s s e d . * C M a k e V 2 \ \ . + \ \ * + S k i p p e d " )
set_property ( TEST CTestTestSkipReturnCode PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL= )
ADD_TEST_MACRO ( CTestTestSerialInDepends ${ 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 } " )
ADD_TEST_MACRO ( CTestTestMissingDependsExe ${ CMAKE_CTEST_COMMAND }
- - 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 } " )
set_tests_properties ( CTestTestMissingDependsExe PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " \ \ * \ \ * \ \ * N o t R u n "
)
ADD_TEST_MACRO ( CTestTestSerialOrder ${ CMAKE_CTEST_COMMAND }
- - 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 } " )
set_property ( TEST CTestTestSerialOrder PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL= )
if ( NOT BORLAND )
set ( CTestLimitDashJ_CTEST_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_test ( CTestTestPrintLabels ${ CMAKE_CTEST_COMMAND } --print-labels )
set_tests_properties ( CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2" )
set_tests_properties ( CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION
" A l l L a b e l s : . * L a b e l 1 . * L a b e l 2 " )
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 L a b e l R e g E x p / 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 L a b e l R e g E x p / 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 ( NAME CTestTestLabelRegExp
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 S O U R C E _ D I R = $ { 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 L a b e l R e g E x p
- 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 T e s t L a b e l R e g E x p / t e s t . c m a k e
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 L a b e l R e g E x p
)
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 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 )
add_test ( CTestTestResourceLock ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R 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 "
)
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t S 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 )
add_test ( CTestTestScheduler ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S 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 "
)
set_tests_properties ( CTestTestScheduler PROPERTIES
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 " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t C 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 )
add_test ( CTestTestCostSerial ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C 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 "
)
set_tests_properties ( CTestTestCostSerial PROPERTIES
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 " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t S 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 )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t S 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 )
add_test ( CTestTestStopTime ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S 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 "
)
set_tests_properties ( CTestTestStopTime PROPERTIES
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 " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestSubdir ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t S u b d i r / t e s t O u t p u t . l o g "
)
#make sure all 3 subdirs were added
set_tests_properties ( CTestTestSubdir PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " 0 t e s t s f a i l e d o u t o f 3 " )
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t T i m e o u t / t e s t . c m a k e . i n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t T i m e o u t / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTestTimeout ${ CMAKE_CTEST_COMMAND }
- 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 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 "
)
set_tests_properties ( CTestTestTimeout PROPERTIES
P A S S _ R E G U L A R _ E X P R E S S I O N " T e s t T i m e o u t * \ \ . + * \ \ * \ \ * \ \ * T i m e o u t . * T e s t S l e e p * \ \ . + * P a s s e d . * t i m e o u t c o r r e c t l y k i l l e d c h i l d " )
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 )
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 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 )
add_test ( CTestTestDepends ${ CMAKE_CTEST_COMMAND }
- 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 "
)
configure_file (
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / C T e s t T e s t C 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 )
add_test ( CTestTestCycle ${ CMAKE_CTEST_COMMAND }
- 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 "
)
set_tests_properties ( CTestTestCycle PROPERTIES
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 " )
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 R u n S c r i p 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 R u n S c r i p t / t e s t . c m a k e "
@ O N L Y E S C A P E _ Q U O T E S )
configure_file (
" $ { 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 "
" $ { 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 )
add_test ( CTestTestRunScript ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t R u n S c r i p t / t e s t O u t p u t . l o g "
)
add_test ( CTestTestShowOnly ${ CMAKE_CTEST_COMMAND } -N )
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 "
)
if ( CMAKE_TESTS_CDASH_SERVER )
set ( regex "^([^:]+)://([^/]+)(.*)$" )
if ( "${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}" )
set ( protocol "${CMAKE_MATCH_1}" )
set ( server "${CMAKE_MATCH_2}" )
set ( path "${CMAKE_MATCH_3}" )
else ( )
set ( protocol "http" )
set ( server "open.cdash.org" )
set ( path "" )
message ( "warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex..." )
message ( " ...using default url='${protocol}://${server}${path}' for CTestTest[23]" )
endif ( )
endif ( )
if ( CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t / t e s t . c m a k e " @ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTest ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t / t e s t . c m a k e " - V
- - o u t p u t - l o g " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t / t e s t O u t p u t . l o g "
)
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 2 / t e s t . c m a k e " @ O N L Y E S C A P E _ Q U O T E S )
add_test ( CTestTest2 ${ CMAKE_CTEST_COMMAND }
- 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
- - 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 "
)
endif ( )
if ( "${CMAKE_GENERATOR}" MATCHES "Makefiles" OR "${CMAKE_GENERATOR}" MATCHES "Ninja" )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTestLaunchers/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t L a u n c h e r 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 )
add_test ( CTestTestLaunchers ${ 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 L a u n c h e r 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 L a u n c h e r s / t e s t O u t p u t . l o g "
)
set_tests_properties ( CTestTestLaunchers PROPERTIES
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 _ L A U N C H E R _ S U C C E S S " )
endif ( )
configure_file ( "${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in"
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t 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 )
add_test ( CTestTestChecksum ${ CMAKE_CTEST_COMMAND }
- S " $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / C T e s t T e s t C 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 "
)
set_tests_properties ( CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION
" m d 5 m i s m a t c h " )
# these tests take a long time, make sure they have it
# if timeouts have not already been set
get_test_property ( CTestTest TIMEOUT PREVIOUS_TIMEOUT )
if ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
set_tests_properties ( CTestTest
P R O P E R T I E S T I M E O U T $ { C M A K E _ L O N G _ T E S T _ T I M E O U T } )
endif ( )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
get_test_property ( CTestTest2 TIMEOUT PREVIOUS_TIMEOUT )
if ( "${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND )
set_tests_properties ( CTestTest2
P R O P E R T I E S T I M E O U T $ { C M A K E _ L O N G _ T E S T _ T I M E O U T } )
endif ( )
endif ( )
endif ( )
if ( NOT DEFINED CMake_TEST_BOOTSTRAP )
if ( CMAKE_RUN_LONG_TESTS
A N D N O T C M A K E _ S K I P _ B O O T S T R A P _ T E S T
A N D N O T C M a k e _ T E S T _ E X T E R N A L _ C M A K E
A N D N O T C M A K E _ G E N E R A T O R M A T C H E S " X c o d e "
A N D N O T E X I S T S " $ { C M a k e _ B I N A R Y _ D I R } / C M a k e L i s t s . t x t "
)
set ( CMake_TEST_BOOTSTRAP 1 )
else ( )
set ( CMake_TEST_BOOTSTRAP 0 )
endif ( )
endif ( )
set ( bootstrap "" )
if ( CMake_TEST_BOOTSTRAP )
if ( UNIX )
set ( bootstrap ${ CMake_SOURCE_DIR } /bootstrap )
elseif ( MSYS )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /bootstrap.bat.in
$ { 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 )
set ( bootstrap ${ CMAKE_CURRENT_BINARY_DIR } /bootstrap.bat )
endif ( )
endif ( )
if ( bootstrap )
add_test ( NAME BootstrapTest
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 " b o o t s t r a p = $ { b o o t s t r a p } "
- D " b i n _ 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 "
- D " g e n e r a t o r = $ { C M A K E _ G E N E R A T O R } "
- P $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / B o o t s t r a p T e s t . c m a k e
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest" )
# This test will use all processors.
set_property ( TEST BootstrapTest PROPERTY RUN_SERIAL 1 )
# This test may take a long time.
if ( NOT DEFINED CMake_TEST_BOOTSTRAP_TIMEOUT )
set ( CMake_TEST_BOOTSTRAP_TIMEOUT 5400 )
endif ( )
set_property ( TEST BootstrapTest PROPERTY TIMEOUT "${CMake_TEST_BOOTSTRAP_TIMEOUT}" )
endif ( )
if ( CMAKE_Fortran_COMPILER )
add_test ( Fortran ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / F o r t r a n "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / F o r t r a n "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran" )
if ( CMAKE_Fortran_COMPILER_SUPPORTS_F90 )
add_test ( FortranModules ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / F o r t r a n M o d u l e s "
" $ { 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 M o d u l e s "
$ { 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 F o r t r a n M o d u l e s
- - b u i l d - o p t i o n s
- D C M a k e _ T E S T _ N E S T E D _ 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 _ E X P L I C I T _ M A K E _ P R O G R A M }
- D C M a k e _ T E S T _ F o r t r a n _ S U B M O D U L E S : B O O L = $ { C M a k e _ T E S T _ F o r t r a n _ S U B M O D U L E S }
$ { C M a k e _ T E S T _ F o r t r a n M o d u l e s _ B U I L D _ O P T I O N S }
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranModules" )
endif ( )
# FortranCInterface tests.
if ( UNIX )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /FortranC/Flags.cmake.in
$ { 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 )
add_test ( FortranC.Flags ${ CMAKE_CMAKE_COMMAND } -P
$ { 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags" )
else ( )
add_test ( FortranC ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / F o r t r a n C "
" $ { 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 "
$ { 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 F o r t r a n C
- - 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 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC" )
endif ( )
endif ( )
if ( NOT DEFINED CMake_TEST_Java )
if ( APPLE OR MINGW )
set ( CMake_TEST_Java 0 )
else ( )
set ( CMake_TEST_Java 1 )
endif ( )
endif ( )
if ( CMake_TEST_Java )
find_package ( Java COMPONENTS Development QUIET )
endif ( )
if ( Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE )
set ( JavaExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH= ${ CMake_TEST_EXPLICIT_MAKE_PROGRAM } )
ADD_TEST_MACRO ( JavaExportImport JavaExportImport )
get_filename_component ( JAVACPATH ${ Java_JAVAC_EXECUTABLE } REALPATH )
get_filename_component ( JNIPATH ${ JAVACPATH } PATH )
find_file ( JNI_H jni.h
" $ { J N I P A T H } / . . / i n c l u d e "
" $ { J N I P A T H } / . . / j a v a / i n c l u d e " )
if ( JNI_H AND EXISTS "${JNI_H}" ) # in case jni.h is a broken symlink
file ( READ "${JNI_H}" JNI_FILE )
if ( "${JNI_FILE}" MATCHES "JDK1_2" )
execute_process (
C O M M A N D " $ { J a v a _ J A V A _ E X E C U T A B L E } " - v e r s i o n
O U T P U T _ V A R I A B L E _ v e r s i o n E R R O R _ V A R I A B L E _ v e r s i o n R E S U L T _ V A R I A B L E _ r e s u l t
)
# E2K has broken Java RVM before 3.5.2
if ( CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "e2k" AND _result EQUAL 0 )
string ( REGEX MATCH "RVM ([0-9.]+)" RVMVER "${_version}" )
# Consider empty match a broken version too
if ( "${CMAKE_MATCH_1}" VERSION_LESS "3.5.2" )
set ( BROKEN_RVM TRUE )
endif ( )
endif ( )
if ( NOT BROKEN_RVM )
add_test ( NAME Java.Jar COMMAND ${ CMAKE_CTEST_COMMAND } -C $< CONFIG >
- - 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 J a r "
$ { 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 h e l l o
- - 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 J a 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 } - V - C $ < C O N F I G > )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJar" )
# For next tests, java tool must have same architecture as toolchain
math ( EXPR _object_mode "${CMAKE_SIZEOF_VOID_P} * 8" )
if ( _result EQUAL 0 AND _version MATCHES "${_object_mode}-Bit" )
## next test is valid only if Java version is less than 1.10
if ( "${Java_VERSION}" VERSION_LESS 1.10 )
add_test ( NAME Java.Javah COMMAND ${ CMAKE_CTEST_COMMAND } -C $< CONFIG >
- - 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 J a v a h "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J a v a J a v a 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 h e l l o J a v a h
- - 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 J a v a h / "
- - 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 O N F I G > )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJavah" )
endif ( )
## next test is valid only if Java is, at least, version 1.8
if ( NOT "${Java_VERSION}" VERSION_LESS 1.8 )
add_test ( NAME Java.NativeHeaders COMMAND ${ CMAKE_CTEST_COMMAND } -C $< CONFIG >
- - 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 N a t i v e H e a d e r s "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / J a v a N a t i v e H e a d e r s "
$ { 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 h e l l o J a v a N a t i v e H e a d e r s
- - 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 N a t i v e H e a d e r s / "
- - b u i l d - t a r g e t i n s t a l l
- - 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 / J a v a N a t i v e H e a d e r s / I n s t a l l "
- - 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 O N F I G > )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders" )
endif ( )
endif ( )
endif ( )
endif ( )
endif ( )
endif ( )
# add some cross compiler tests, for now only with makefile based generators
if ( CMAKE_GENERATOR MATCHES "Makefiles" )
# if sdcc is found, build the SimpleCOnly project with sdcc
find_program ( SDCC_EXECUTABLE sdcc )
mark_as_advanced ( SDCC_EXECUTABLE )
if ( SDCC_EXECUTABLE )
add_test ( SimpleCOnly_sdcc ${ CMAKE_CTEST_COMMAND }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e C O n l y "
" $ { 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 "
$ { 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 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 } " )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" )
endif ( )
# If a Linux -> MinGW cross compiler is found then try it
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 }
- - b u i l d - a n d - t e s t
" $ { C M a k e _ S O U R C E _ D I R } / T e s t s / S i m p l e "
" $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / S i m p l e _ M i n g w _ L i n u x 2 W i n "
$ { b u i l d _ g e n e r a t o r _ a r g s }
- - 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 "
" - D C M A K E _ C _ C O M P I L E R = $ { M I N G W _ C C _ L I N U X 2 W I N _ E X E C U T A B L E } "
" - D C M A K E _ C X X _ C O M P I L E R = $ { M I N G W _ C X X _ L I N U X 2 W I N _ E X E C U T A B L E } "
" - 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 } "
)
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" )
endif ( )
endif ( )
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" )
endif ( )
if ( NOT EXISTS "${script}" )
message ( "warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found..." )
endif ( )
add_test ( BuildCSE ${ CMAKE_CTEST_COMMAND } -V -S "${script}" )
set_tests_properties ( BuildCSE PROPERTIES TIMEOUT 5400 )
endif ( )
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 )
endif ( )
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 )
endif ( )
if ( CMAKE_TEST_KDELIBS_ALPHA_1_DIR )
add_test ( KDELibsAlpha1 ${ CMAKE_CTEST_COMMAND } -V -S ${ CMAKE_TEST_KDELIBS_ALPHA_1_DIR } /../../EasyDashboardScripts/kdelibs.cmake )
set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400 )
endif ( )
# Define a set of "contract" tests, each activated by a cache entry
# named "CMake_TEST_CONTRACT_<project>". For each Contract test,
# the project should provide a directory with a CMakeLists.txt file
# that uses ExternalProject to download and configure the project.
# The directory should also contain a Configure.cmake file that
# sets "CMake_TEST_CONTRACT_<project>_<var>" variables to configure
# the code below.
foreach ( project IN ITEMS PLplot Trilinos VTK )
if ( CMake_TEST_CONTRACT_ ${ project } )
include ( Contracts/ ${ project } /Configure.cmake )
ADD_TEST_MACRO ( Contracts. ${ project } ${ CMake_TEST_CONTRACT_${project } _RUN_TEST} )
# The external projects may take a long time to build.
if ( DEFINED CMake_TEST_CONTRACT_ ${ project } _TIMEOUT )
set ( timeout ${ CMake_TEST_CONTRACT_${project } _TIMEOUT} )
elseif ( CMake_TEST_CONTRACT_DEFAULT_TIMEOUT )
set ( timeout ${ CMake_TEST_CONTRACT_DEFAULT_TIMEOUT } )
else ( )
set ( timeout 21600 )
endif ( )
set_property ( TEST Contracts. ${ project } PROPERTY TIMEOUT "${timeout}" )
endif ( )
endforeach ( )
if ( TEST_CompileCommandOutput )
set ( CompileCommandOutput_BUILD_OPTIONS
- 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 } )
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 " )
endif ( )
add_test ( IncludeDirectories ${ 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 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
$ { 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 c l u d e D i r e c t o r i e s
- - 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 }
- - 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 )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories" )
if ( CMAKE_GENERATOR MATCHES "^((Unix|MSYS) Makefiles|Ninja)$" AND
( ( C M A K E _ C X X _ C O M P I L E R _ I D S T R E Q U A L " G N U " A N D C M A K E _ C X X _ C O M P I L E R _ V E R S I O N V E R S I O N _ G R E A T E R 4 . 4 )
OR ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" )
OR ( CMAKE_CXX_COMPILER_ID STREQUAL "LCC" )
OR ( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" ) ) )
add_test ( IncludeDirectoriesCPATH ${ 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 c l u d e D i r e c t o r i e s C P A T H "
" $ { 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 C P A T H "
- - 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 c l u d e D i r e c t o r i e s C P A T H )
list ( APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH" )
set_tests_properties ( IncludeDirectoriesCPATH
P R O P E R T I E S
E N V I R O N M E N T " C P A T H = $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / I n c l u d e D i r e c t o r i e s C P A T H / v i a c p a t h " )
endif ( )
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" )
ADD_TEST_MACRO ( InterfaceLinkLibrariesDirect )
if ( NOT CMake_TEST_EXTERNAL_CMAKE )
add_subdirectory ( CMakeTests )
endif ( )
if ( BUILD_QtDialog AND CMake_TEST_GUI AND NOT CMake_TEST_EXTERNAL_CMAKE )
add_subdirectory ( CMakeGUI )
endif ( )
# Run CheckSourceTree as the very last test in the CMake/CTest/CPack test
# suite. It detects if any changes have been made to the CMake source tree
# by any previous configure, build or test steps.
if ( GIT_EXECUTABLE AND EXISTS "${CMake_SOURCE_DIR}/.git"
A N D N O T " $ { C M a k e _ S O U R C E _ D I R } " S T R E Q U A L " $ { C M a k e _ B I N A R Y _ D I R } " )
add_subdirectory ( CheckSourceTree )
endif ( )
# If this is not an in-source build, provide a target to wipe out
# all the test build directories. This must come at the end after
# all the above logic has finished adding to TEST_BUILD_DIRS
if ( NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt" )
configure_file ( ${ CMake_SOURCE_DIR } /Tests/test_clean.cmake.in
$ { C M a k e _ B I N A R Y _ D I R } / T e s t s / t e s t _ c l e a n . c m a k e @ O N L Y )
add_custom_target ( test_clean
C O M M A N D $ { C M A K E _ C O M M A N D } - P $ { C M a k e _ B I N A R Y _ D I R } / T e s t s / t e s t _ c l e a n . c m a k e
C O M M E N T " R e m o v i n g t e s t b u i l d d i r e c t o r i e s . "
)
endif ( )
endif ( )