Tests: Optionally configure tests exclusively, with an external CMake

Add an undocumented CMake_TEST_EXTERNAL_CMAKE option to name an external
CMake 'bin' directory.  Skip all main CMake binary builds and instead
configure the Tests directory to run using the external CMake provided.
This will provide a means to exercise the CMake test suite generating
for target platforms and compilers with which the CMake source does not
build.  That will allow us to raise the level of C++ features required
of a compiler to build our source while retaining tests for generating
projects with older compiler tools.
This commit is contained in:
Brad King 2014-03-03 15:24:03 -05:00
parent 9f5bd180c8
commit 9608ef6f40
2 changed files with 195 additions and 155 deletions

View File

@ -21,7 +21,9 @@ if(CMAKE_BOOTSTRAP)
unset(CMAKE_BOOTSTRAP CACHE) unset(CMAKE_BOOTSTRAP CACHE)
endif() endif()
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin) if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
endif()
if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host. # Disallow architecture-specific try_run. It may not run on the host.
@ -102,9 +104,11 @@ endmacro()
set(CMAKE_BUILD_ON_VISUAL_STUDIO 0) if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1) if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
endif()
endif() endif()
@ -126,9 +130,19 @@ macro(CMAKE_SETUP_TESTING)
# the ctest from this cmake is used for testing # the ctest from this cmake is used for testing
# and not the ctest from the cmake building and testing # and not the ctest from the cmake building and testing
# cmake. # cmake.
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") if(CMake_TEST_EXTERNAL_CMAKE)
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") set(CMAKE_CTEST_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/ctest")
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") set(CMAKE_CMAKE_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cpack")
foreach(exe cmake ctest cpack)
add_executable(${exe} IMPORTED)
set_property(TARGET ${exe} PROPERTY IMPORTED_LOCATION ${CMake_TEST_EXTERNAL_CMAKE}/${exe})
endforeach()
else()
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
endif()
endif() endif()
# configure some files for testing # configure some files for testing
@ -362,18 +376,20 @@ macro (CMAKE_BUILD_UTILITIES)
endmacro () endmacro ()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") if(NOT CMake_TEST_EXTERNAL_CMAKE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
${CMAKE_CXX_COMPILER_ARG1} -dumpversion execute_process(COMMAND ${CMAKE_CXX_COMPILER}
OUTPUT_VARIABLE _GXX_VERSION ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
) OUTPUT_VARIABLE _GXX_VERSION
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" )
_GXX_VERSION_SHORT ${_GXX_VERSION}) string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
if(_GXX_VERSION_SHORT EQUAL 33) _GXX_VERSION_SHORT ${_GXX_VERSION})
message(FATAL_ERROR if(_GXX_VERSION_SHORT EQUAL 33)
"GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n" message(FATAL_ERROR
"Please use GXX 4.2 or greater to build CMake on OpenBSD\n" "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
endif()
endif() endif()
endif() endif()
@ -392,31 +408,33 @@ include (${CMAKE_ROOT}/Modules/Dart.cmake)
set_directory_properties(PROPERTIES set_directory_properties(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake") TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
# where to write the resulting executables and libraries if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(BUILD_SHARED_LIBS OFF) # where to write the resulting executables and libraries
set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") set(BUILD_SHARED_LIBS OFF)
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
"Where to put the libraries for CMake") set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake")
# The CMake executables usually do not need any rpath to run in the build or # The CMake executables usually do not need any rpath to run in the build or
# install tree. # install tree.
set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
# Load install destinations. # Load install destinations.
include(Source/CMakeInstallDestinations.cmake) include(Source/CMakeInstallDestinations.cmake)
if(BUILD_TESTING) if(BUILD_TESTING)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
# include special compile flags for some compilers
include(CompileFlags.cmake)
# no clue why we are testing for this here
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
endif() endif()
# include special compile flags for some compilers
include(CompileFlags.cmake)
# no clue why we are testing for this here
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
# CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests. # CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
# #
# If not defined or "", this variable defaults to the server at # If not defined or "", this variable defaults to the server at
@ -434,70 +452,73 @@ if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
endif() endif()
# build the utilities (a macro defined in this file) if(NOT CMake_TEST_EXTERNAL_CMAKE)
CMAKE_BUILD_UTILITIES() # build the utilities (a macro defined in this file)
CMAKE_BUILD_UTILITIES()
# On NetBSD ncurses is required, since curses doesn't have the wsyncup() # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
# function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib, # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
# which isn't in the default linker search path. So without RPATH ccmake # which isn't in the default linker search path. So without RPATH ccmake
# doesn't run and the build doesn't succeed since ccmake is executed for # doesn't run and the build doesn't succeed since ccmake is executed for
# generating the documentation. # generating the documentation.
if(BUILD_CursesDialog) if(BUILD_CursesDialog)
get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH) get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
set(CURSES_NEED_RPATH FALSE) set(CURSES_NEED_RPATH FALSE)
if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
set(CURSES_NEED_RPATH TRUE) set(CURSES_NEED_RPATH TRUE)
endif()
endif()
if(BUILD_QtDialog)
if(APPLE)
set(CMAKE_BUNDLE_VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in /
string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
math(EXPR LEN "${LEN} -1" )
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
if(NOT "${ENDCH}" STREQUAL "/")
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif() endif()
set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
endif() endif()
set(QT_NEED_RPATH FALSE) if(BUILD_QtDialog)
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") if(APPLE)
set(QT_NEED_RPATH TRUE) set(CMAKE_BUNDLE_VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in /
string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
math(EXPR LEN "${LEN} -1" )
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
if(NOT "${ENDCH}" STREQUAL "/")
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif()
set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
endif()
set(QT_NEED_RPATH FALSE)
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
set(QT_NEED_RPATH TRUE)
endif()
endif() endif()
# The same might be true on other systems for other libraries.
# Then only enable RPATH if we have are building at least with cmake 2.4,
# since this one has much better RPATH features than cmake 2.2.
# The executables are then built with the RPATH for the libraries outside
# the build tree, which is both the build and the install RPATH.
if (UNIX)
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
endif ()
# add the uninstall support
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
include (CMakeCPack.cmake)
endif() endif()
# The same might be true on other systems for other libraries.
# Then only enable RPATH if we have are building at least with cmake 2.4,
# since this one has much better RPATH features than cmake 2.2.
# The executables are then built with the RPATH for the libraries outside
# the build tree, which is both the build and the install RPATH.
if (UNIX)
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
endif ()
# add the uninstall support
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
include (CMakeCPack.cmake)
# setup some Testing support (a macro defined in this file) # setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING() CMAKE_SETUP_TESTING()
configure_file( configure_file(
@ -505,62 +526,69 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf" "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
COPYONLY) COPYONLY)
if(NOT CMake_VERSION_IS_RELEASE) if(NOT CMake_TEST_EXTERNAL_CMAKE)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND if(NOT CMake_VERSION_IS_RELEASE)
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2) if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND
set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
-Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
-Wmissing-format-attribute -fno-common -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security
) -Wmissing-format-attribute -fno-common -Wundef
set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W )
-Wshadow -Wpointer-arith -Wformat-security -Wundef set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W
) -Wshadow -Wpointer-arith -Wformat-security -Wundef
)
foreach(FLAG_LANG C CXX) foreach(FLAG_LANG C CXX)
foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST}) foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST})
if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ") if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ")
set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}") set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}")
endif() endif()
endforeach()
endforeach() endforeach()
endforeach()
unset(C_FLAGS_LIST) unset(C_FLAGS_LIST)
unset(CXX_FLAGS_LIST) unset(CXX_FLAGS_LIST)
endif()
endif() endif()
# build the remaining subdirectories
add_subdirectory(Source)
add_subdirectory(Utilities)
endif() endif()
# build the remaining subdirectories
add_subdirectory(Source)
add_subdirectory(Utilities)
add_subdirectory(Tests) add_subdirectory(Tests)
if(BUILD_TESTING) if(NOT CMake_TEST_EXTERNAL_CMAKE)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") if(BUILD_TESTING)
endif() CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat") endif()
if(TARGET documentation) CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
CMAKE_SET_TARGET_FOLDER(documentation "Documentation") if(TARGET documentation)
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
endif()
endif() endif()
# add a test # add a test
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
--system-information -G "${CMAKE_GENERATOR}" ) --system-information -G "${CMAKE_GENERATOR}" )
# Install license file as it requires. if(NOT CMake_TEST_EXTERNAL_CMAKE)
install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}) # Install license file as it requires.
install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
# Install script directories. # Install script directories.
install( install(
DIRECTORY Help Modules Templates DIRECTORY Help Modules Templates
DESTINATION ${CMAKE_DATA_DIR} DESTINATION ${CMAKE_DATA_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE WORLD_READ WORLD_EXECUTE
PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE WORLD_READ WORLD_EXECUTE
) )
# Install auxiliary files integrating with other tools. # Install auxiliary files integrating with other tools.
add_subdirectory(Auxiliary) add_subdirectory(Auxiliary)
endif()

View File

@ -57,8 +57,10 @@ if(BUILD_TESTING)
set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")
endif() endif()
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_GENERATOR}" MATCHES Ninja AND NOT WIN32)) if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(TEST_CompileCommandOutput 1) if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_GENERATOR}" MATCHES Ninja AND NOT WIN32))
set(TEST_CompileCommandOutput 1)
endif()
endif() endif()
set(MAKE_IS_GNU ) set(MAKE_IS_GNU )
@ -95,13 +97,17 @@ if(BUILD_TESTING)
list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
endif() endif()
add_subdirectory(CMakeLib) if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeLib)
endif()
add_subdirectory(CMakeOnly) add_subdirectory(CMakeOnly)
add_subdirectory(RunCMake) add_subdirectory(RunCMake)
add_subdirectory(FindPackageModeMakefileTest) add_subdirectory(FindPackageModeMakefileTest)
add_subdirectory(CTestTestMemcheck) if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CTestTestMemcheck)
endif()
# Collect a list of all test build directories. # Collect a list of all test build directories.
set(TEST_BUILD_DIRS) set(TEST_BUILD_DIRS)
@ -248,7 +254,9 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(SetLang SetLang) ADD_TEST_MACRO(SetLang SetLang)
ADD_TEST_MACRO(EmptyProperty EmptyProperty) ADD_TEST_MACRO(EmptyProperty EmptyProperty)
ADD_TEST_MACRO(ExternalOBJ ExternalOBJ) ADD_TEST_MACRO(ExternalOBJ ExternalOBJ)
ADD_TEST_MACRO(LoadCommand LoadedCommand) if(NOT CMake_TEST_EXTERNAL_CMAKE)
ADD_TEST_MACRO(LoadCommand LoadedCommand)
endif()
ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory) ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory)
ADD_TEST_MACRO(LinkLanguage LinkLanguage) ADD_TEST_MACRO(LinkLanguage LinkLanguage)
ADD_TEST_MACRO(LinkLine LinkLine) ADD_TEST_MACRO(LinkLine LinkLine)
@ -1018,16 +1026,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
"${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures") "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures")
endif() endif()
add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} if(NOT CMake_TEST_EXTERNAL_CMAKE)
--build-and-test add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND}
"${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" --build-and-test
"${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig"
${build_generator_args} "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
--build-project LoadCommand ${build_generator_args}
--build-options ${build_options} --build-project LoadCommand
--test-command LoadedCommand --build-options ${build_options}
) --test-command LoadedCommand
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") )
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
endif()
add_test(complex ${CMAKE_CTEST_COMMAND} add_test(complex ${CMAKE_CTEST_COMMAND}
--build-and-test --build-and-test
@ -2771,5 +2781,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle)
endif() endif()
add_subdirectory(CMakeTests) if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeTests)
endif()
endif() endif()