[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.63 1.64 test_clean.cmake.in NONE 1.1
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Aug 19 11:43:59 EDT 2008
Update of /cvsroot/CMake/CMake/Tests
In directory public:/mounts/ram/cvs-serv24843/Tests
Modified Files:
CMakeLists.txt
Added Files:
test_clean.cmake.in
Log Message:
ENH: Add test_clean target to wipe out tests
We frequently need to wipe out all the CMake test build directories in
order to run tests from scratch. This change adds a test_clean custom
target to remove all these directories for out-of-source builds.
--- NEW FILE: test_clean.cmake.in ---
SET(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@")
FILE(REMOVE_RECURSE ${TEST_BUILD_DIRS})
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CMakeLists.txt,v
retrieving revision 1.63
retrieving revision 1.64
diff -C 2 -d -r1.63 -r1.64
*** CMakeLists.txt 6 Aug 2008 21:43:34 -0000 1.63
--- CMakeLists.txt 19 Aug 2008 15:43:57 -0000 1.64
***************
*** 11,18 ****
--- 11,22 ----
--build-project ${NAME}
--test-command ${COMMAND})
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${NAME}")
ENDMACRO(ADD_TEST_MACRO)
# Testing
IF(BUILD_TESTING)
+ # Collect a list of all test build directories.
+ SET(TEST_BUILD_DIRS)
+
# Should the long tests be run?
OPTION(CMAKE_RUN_LONG_TESTS
***************
*** 111,114 ****
--- 115,119 ----
--build-project Simple
--test-command Simple)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
ENDIF ("${cmakeOutput}" MATCHES Eclipse)
***************
*** 124,127 ****
--- 129,133 ----
--build-project Simple
--test-command Simple)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
***************
*** 137,140 ****
--- 143,147 ----
--build-project Simple
--test-command Simple)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
ENDIF ("${cmakeOutput}" MATCHES KDevelop3)
***************
*** 173,176 ****
--- 180,184 ----
)
SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject")
ENDIF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
***************
*** 204,207 ****
--- 212,216 ----
"-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install"
--test-command bar)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND}
***************
*** 216,219 ****
--- 225,229 ----
${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName")
ADD_TEST(LibName ${CMAKE_CTEST_COMMAND}
***************
*** 228,231 ****
--- 238,242 ----
--test-command foobar
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND}
***************
*** 240,243 ****
--- 251,255 ----
--test-command foo bar.c
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND}
***************
*** 252,255 ****
--- 264,268 ----
--test-command CustomCommand
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
ADD_TEST(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND}
***************
*** 263,266 ****
--- 276,280 ----
--test-command working
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
#ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND}
***************
*** 299,302 ****
--- 313,319 ----
--test-command
"${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
+ 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}
***************
*** 308,311 ****
--- 325,329 ----
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
SET(SimpleInstallInstallDir
***************
*** 322,325 ****
--- 340,344 ----
"-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
--test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExe)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall")
ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND}
--build-and-test
***************
*** 334,337 ****
--- 353,357 ----
"-DSTAGE2:BOOL=1"
--test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2")
# By default, run the CPackComponents test if the CTEST_TEST_CPACK
***************
*** 368,371 ****
--- 388,392 ----
"-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents"
-P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
ENDIF(CTEST_RUN_CPackComponents)
***************
*** 379,382 ****
--- 400,404 ----
--build-two-config
--test-command UseX11)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
ADD_TEST(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND}
***************
*** 389,392 ****
--- 411,415 ----
--test-command LoadedCommand
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
# Como does not seem to support shared libraries.
***************
*** 411,414 ****
--- 434,438 ----
--test-command complex
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex")
ADD_TEST(complexOneConfig ${CMAKE_CTEST_COMMAND}
***************
*** 424,427 ****
--- 448,452 ----
-DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
--test-command complex)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
# This fails on VS 70
***************
*** 461,464 ****
--- 486,490 ----
--test-command helloDemo
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example")
# do each of the tutorial steps
***************
*** 474,477 ****
--- 500,504 ----
--test-command Tutorial 25.0)
ENDFOREACH(STP)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
ADD_TEST(testing ${CMAKE_CTEST_COMMAND}
***************
*** 485,488 ****
--- 512,516 ----
--test-command testing
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
ADD_TEST(wrapping ${CMAKE_CTEST_COMMAND}
***************
*** 506,509 ****
--- 534,538 ----
--test-command qtwrapping
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND}
***************
*** 539,542 ****
--- 568,572 ----
--test-command TestDriverTest subdir/test3
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
ADD_TEST(Dependency ${CMAKE_CTEST_COMMAND}
***************
*** 550,553 ****
--- 580,584 ----
--test-command exec
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
IF("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
***************
*** 593,596 ****
--- 624,628 ----
--test-command jumpExecutable
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND}
***************
*** 603,606 ****
--- 635,639 ----
--build-two-config
--test-command bin/example)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
IF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
***************
*** 628,631 ****
--- 661,665 ----
--test-command Exec2
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
SET_TESTS_PROPERTIES ( qtwrapping PROPERTIES DEPENDS wrapping)
SET_TESTS_PROPERTIES ( testdriver1 PROPERTIES DEPENDS qtwrapping)
***************
*** 645,648 ****
--- 679,683 ----
--test-command kwsysTestsCxx testIOS
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys")
ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
SET(MAKE_IS_GNU )
***************
*** 677,680 ****
--- 712,716 ----
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces")
ENDIF (MAKE_IS_GNU OR
"${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
***************
*** 708,711 ****
--- 744,748 ----
)
ENDIF (WIN32)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
IF(CMAKE_TEST_MSVC)
***************
*** 724,727 ****
--- 761,765 ----
--test-command check_clean
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
***************
*** 736,739 ****
--- 774,778 ----
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--test-command VSExternalInclude)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
***************
*** 755,758 ****
--- 794,798 ----
--test-command
${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest")
ADD_TEST_MACRO(ObjC++ ObjC++)
***************
*** 771,774 ****
--- 811,815 ----
--build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
ENDIF(APPLE AND CTEST_TEST_CPACK)
***************
*** 833,836 ****
--- 874,878 ----
--test-command
${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest")
# provide more time for the bootstrap test
***************
*** 864,867 ****
--- 906,910 ----
--build-two-config
--test-command testf)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
ENDIF(CMAKE_Fortran_COMPILER_FULLPATH)
ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles"
***************
*** 888,891 ****
--- 931,935 ----
--build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
ENDIF(JNI_H)
***************
*** 910,913 ****
--- 954,958 ----
"-DCMAKE_SYSTEM_NAME=Generic"
"-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
ENDIF(SDCC_EXECUTABLE)
***************
*** 928,931 ****
--- 973,977 ----
"-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
"-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
ENDIF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE)
***************
*** 946,949 ****
--- 992,996 ----
--test-command UseWX
)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/UseWX")
ENDIF(BUILD_WXDialog AND wxWidgets_CONFIG_EXECUTABLE)
***************
*** 976,979 ****
--- 1023,1037 ----
ENDIF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
+ # If this is not an in-source build, provide a target to wipe out
+ # all the test build directories.
+ IF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
+ ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
+ ADD_CUSTOM_TARGET(test_clean
+ COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
+ COMMENT "Removing test build directories."
+ )
+ ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+
ENDIF(BUILD_TESTING)
More information about the Cmake-commits
mailing list