CMakeLists.txt 84.4 KB
Newer Older
Ken Martin's avatar
Ken Martin committed
1 2
# a macro for tests that have a simple format where the name matches the
# directory and project
3
MACRO(ADD_TEST_MACRO NAME COMMAND)
4 5
  STRING(REPLACE "." "/" dir "${NAME}")
  STRING(REGEX REPLACE "[^.]*\\." "" proj "${NAME}")
Ken Martin's avatar
Ken Martin committed
6 7
  ADD_TEST(${NAME} ${CMAKE_CTEST_COMMAND}
    --build-and-test
8 9
    "${CMake_SOURCE_DIR}/Tests/${dir}"
    "${CMake_BINARY_DIR}/Tests/${dir}"
Ken Martin's avatar
Ken Martin committed
10 11 12
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
13
    --build-project ${proj}
14
    ${${NAME}_EXTRA_OPTIONS}
15
    --test-command ${COMMAND} ${ARGN})
16
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
Ken Martin's avatar
Ken Martin committed
17 18
ENDMACRO(ADD_TEST_MACRO)

19 20 21 22 23 24
# Fake a user home directory to avoid polluting the real one.
IF(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME)
  SET(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome")
  FILE(MAKE_DIRECTORY "${TEST_HOME}")
  FILE(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n")
  SET(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one.
25 26
# But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that
# need access to the real HOME directory.
27
SET(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
28 29
SET(ENV{HOME} \"${TEST_HOME}\")
")
30 31
ENDIF()

32 33 34 35 36 37
# Choose a default configuration for CTest tests.
SET(CTestTest_CONFIG Debug)
IF(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE)
  SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE})
ENDIF()

38 39
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
               ${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY)
40

41 42
# Testing
IF(BUILD_TESTING)
43 44 45 46
  IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
    SET(TEST_CompileCommandOutput 1)
  ENDIF()

47 48
  ADD_SUBDIRECTORY(CMakeLib)

49 50 51
  # Collect a list of all test build directories.
  SET(TEST_BUILD_DIRS)

52
  # Should the long tests be run?
53
  OPTION(CMAKE_RUN_LONG_TESTS
54 55
    "Should the long tests be run (such as Bootstrap)." ON)
  MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
56

57
  IF (CMAKE_RUN_LONG_TESTS)
58 59
    OPTION(CTEST_TEST_CTEST
      "Should the tests that run a full sub ctest process be run?"
60 61
      OFF)
    MARK_AS_ADVANCED(CTEST_TEST_CTEST)
62 63

    OPTION(TEST_KDE4_STABLE_BRANCH
64
      "Should the KDE4 stable branch test be run?"
65 66
      OFF)
    MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH)
67
  ENDIF (CMAKE_RUN_LONG_TESTS)
68

69 70 71 72
  # Should tests that use CVS be run?
  #
  set(do_cvs_tests 0)

73 74
  if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
    find_package(CVS QUIET)
75 76
  else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
    find_program(CVS_EXECUTABLE NAMES cvs)
77
  endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
78

79 80 81 82
  if(CVS_EXECUTABLE)
    set(do_cvs_tests 1)
  endif(CVS_EXECUTABLE)

83 84 85
  if(do_cvs_tests AND NOT UNIX)
    if("${CVS_EXECUTABLE}" MATCHES "cygwin")
      set(do_cvs_tests 0)
86 87
    endif("${CVS_EXECUTABLE}" MATCHES "cygwin")
  endif(do_cvs_tests AND NOT UNIX)
88

89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
  # Should CPack tests be run? By default, yes, but...
  #
  # Disable packaging test on Apple 10.3 and below. PackageMaker starts
  # DiskManagementTool as root and disowns it
  # (http://lists.apple.com/archives/installer-dev/2005/Jul/msg00005.html).
  # It is left holding open pipe handles and preventing ProcessUNIX from
  # detecting end-of-data even after its immediate child exits. Then
  # the test hangs until it times out and is killed. This is a
  # well-known bug in kwsys process execution that I would love to get
  # time to fix.
  #
  OPTION(CTEST_TEST_CPACK
    "Should the tests that use '--build-target package' be run?"
    ON)
  MARK_AS_ADVANCED(CTEST_TEST_CPACK)
104 105
  SET(CTEST_TEST_OSX_ARCH 0)
  IF(APPLE)
106 107 108 109 110 111 112 113 114
    EXECUTE_PROCESS(
      COMMAND sw_vers -productVersion
      OUTPUT_VARIABLE OSX_VERSION
      OUTPUT_STRIP_TRAILING_WHITESPACE
      )
    IF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
      MESSAGE(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
      MESSAGE(STATUS "OSX_VERSION='${OSX_VERSION}'")
      SET(CTEST_TEST_CPACK OFF)
115 116
    ELSE(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
      SET(CTEST_TEST_OSX_ARCH 1)
117
    ENDIF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
118
  ENDIF(APPLE)
119

120 121 122 123 124 125 126 127 128 129
  # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
  # whichever is greater.
  SET(CMAKE_LONG_TEST_TIMEOUT 1500)
  IF(CTEST_TEST_TIMEOUT)
    SET(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT})
  ENDIF(CTEST_TEST_TIMEOUT)
  IF(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
    SET(CMAKE_LONG_TEST_TIMEOUT 1500)
  ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500)

130
  # add a bunch of standard build-and-test style tests
Ken Martin's avatar
Ken Martin committed
131 132
  ADD_TEST_MACRO(CommandLineTest CommandLineTest)
  ADD_TEST_MACRO(FindPackageTest FindPackageTest)
Bill Hoffman's avatar
Bill Hoffman committed
133
  ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll)
Ken Martin's avatar
Ken Martin committed
134 135 136 137 138
  ADD_TEST_MACRO(StringFileTest StringFileTest)
  ADD_TEST_MACRO(TryCompile TryCompile)
  ADD_TEST_MACRO(TarTest TarTest)
  ADD_TEST_MACRO(SystemInformation SystemInformation)
  ADD_TEST_MACRO(MathTest MathTest)
139 140 141 142 143 144 145
  # assume no resources building to test
  SET(TEST_RESOURCES FALSE)
  # for windows and cygwin assume we have resources
  IF(WIN32 OR CYGWIN)
    SET(TEST_RESOURCES TRUE)
  ENDIF()
  # for borland and watcom there is no resource support
146 147
  IF("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR
      "${CMAKE_TEST_GENERATOR}" MATCHES "Borland")
148 149 150
    SET(TEST_RESOURCES FALSE)
  ENDIF()
  IF(TEST_RESOURCES)
151 152
    ADD_TEST_MACRO(VSResource VSResource)
  ENDIF()
Ken Martin's avatar
Ken Martin committed
153 154
  ADD_TEST_MACRO(Simple Simple)
  ADD_TEST_MACRO(PreOrder PreOrder)
155 156
  ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
  SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES
157
    PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
Ken Martin's avatar
Ken Martin committed
158 159
  ADD_TEST_MACRO(COnly COnly)
  ADD_TEST_MACRO(CxxOnly CxxOnly)
160
  ADD_TEST_MACRO(IPO COnly/COnly)
161
  ADD_TEST_MACRO(OutDir runtime/OutDir)
Ken Martin's avatar
Ken Martin committed
162 163
  ADD_TEST_MACRO(NewlineArgs NewlineArgs)
  ADD_TEST_MACRO(SetLang SetLang)
164 165
  ADD_TEST_MACRO(ExternalOBJ ExternalOBJ)
  ADD_TEST_MACRO(LoadCommand LoadedCommand)
166
  ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory)
167
  ADD_TEST_MACRO(LinkLanguage LinkLanguage)
168 169
  ADD_TEST_MACRO(LinkLine LinkLine)
  ADD_TEST_MACRO(MacroTest miniMacroTest)
170
  ADD_TEST_MACRO(FunctionTest miniFunctionTest)
171
  ADD_TEST_MACRO(ReturnTest ReturnTest)
172
  ADD_TEST_MACRO(Properties Properties)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
173
  ADD_TEST_MACRO(Assembler HelloAsm)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
174
  ADD_TEST_MACRO(SourceGroups SourceGroups)
175
  ADD_TEST_MACRO(Preprocess Preprocess)
176
  ADD_TEST_MACRO(ExportImport ExportImport)
Brad King's avatar
Brad King committed
177
  ADD_TEST_MACRO(Unset Unset)
178
  ADD_TEST_MACRO(PolicyScope PolicyScope)
179 180
  ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
  SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES
181
    PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test")
182
  ADD_TEST_MACRO(CrossCompile CrossCompile)
183 184
  SET_TESTS_PROPERTIES(CrossCompile PROPERTIES
    PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
185 186 187
  IF("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
    ADD_TEST_MACRO(Policy0002 Policy0002)
  ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
188 189 190
  IF(CTEST_TEST_OSX_ARCH)
    ADD_TEST_MACRO(Architecture Architecture)
    SET_TESTS_PROPERTIES(Architecture PROPERTIES
191
      PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)")
192
  ENDIF(CTEST_TEST_OSX_ARCH)
193

194 195
  LIST(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})

196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214

  # run test for BundleUtilities on supported platforms
  if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR
     CMAKE_SYSTEM_NAME MATCHES "Linux" OR
     CMAKE_SYSTEM_NAME MATCHES "Darwin")
    ADD_TEST(BundleUtilities ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/BundleUtilities"
      "${CMake_BINARY_DIR}/Tests/BundleUtilities"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project BundleUtilities
      --test-command testdir2/testbundleutils2
      )
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
  endif(CMAKE_SYSTEM_NAME MATCHES "Windows" OR
     CMAKE_SYSTEM_NAME MATCHES "Linux" OR
     CMAKE_SYSTEM_NAME MATCHES "Darwin")

215 216 217 218 219 220
  SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly")
  SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly")
  CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
    "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake" @ONLY)
  ADD_TEST(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P
    "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake")
221
  LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR})
222

Brad King's avatar
Brad King committed
223 224
  ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize)

225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
  ADD_TEST(LinkFlags-prepare
    ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/LinkFlags"
    "${CMake_BINARY_DIR}/Tests/LinkFlags"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-project LinkFlags
    --build-target LinkFlags
    --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
    )
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")

  MACRO(ADD_LINK_FLAGS_TEST name depends)
    ADD_TEST(LinkFlags-${name}
      ${CMAKE_CMAKE_COMMAND} --build "${CMake_BINARY_DIR}/Tests/LinkFlags"
      --target LinkFlags_${name} --config \${CTEST_CONFIGURATION_TYPE}
      )
    SET_TESTS_PROPERTIES(LinkFlags-${name} PROPERTIES
      PASS_REGULAR_EXPRESSION "BADFLAG" DEPENDS LinkFlags-${depends})
  ENDMACRO()
  ADD_LINK_FLAGS_TEST(lib prepare)
  ADD_LINK_FLAGS_TEST(dll lib)
  ADD_LINK_FLAGS_TEST(exe dll)
  ADD_LINK_FLAGS_TEST(lib_config exe)
  ADD_LINK_FLAGS_TEST(dll_config lib_config)
  ADD_LINK_FLAGS_TEST(exe_config dll_config)

253 254
  # If we are running right now with a UnixMakefiles based generator,
  # build the "Simple" test with the ExtraGenerators, if available
255
  # This doesn't test whether the generated project files work (unfortunately),
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
  # mainly it tests that cmake doesn't crash when generating these project files.
  IF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
    # check which generators we have
    EXEC_PROGRAM(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput )
    # check for the Eclipse generator
    IF ("${cmakeOutput}" MATCHES Eclipse)
      ADD_TEST(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Simple"
         "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator"
         --build-two-config
         --build-generator "Eclipse CDT4 - Unix Makefiles"
         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
         --build-project Simple
         --test-command Simple)
271
      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
272 273 274 275 276 277 278 279 280 281 282 283 284
    ENDIF ("${cmakeOutput}" MATCHES Eclipse)

    # check for the CodeBlocks generator
    IF ("${cmakeOutput}" MATCHES CodeBlocks)
      ADD_TEST(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Simple"
         "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator"
         --build-two-config
         --build-generator "CodeBlocks - Unix Makefiles"
         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
         --build-project Simple
         --test-command Simple)
285
      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
286 287 288 289 290 291 292 293 294 295 296 297
    ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
    # check for the KDevelop3 generator
    IF ("${cmakeOutput}" MATCHES KDevelop3)
      ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Simple"
         "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator"
         --build-two-config
         --build-generator "KDevelop3 - Unix Makefiles"
         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
         --build-project Simple
         --test-command Simple)
298
      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
Alexander Neundorf's avatar
Alexander Neundorf committed
299
    ENDIF ("${cmakeOutput}" MATCHES KDevelop3)
300 301 302

  ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")

303 304
  # test for correct sub-project generation
  # not implemented in VS6 or Xcode
305
  IF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
    # run cmake and configure all of SubProject
    # but only build the independent executable car
    ADD_TEST(SubProject ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/SubProject"
      "${CMake_BINARY_DIR}/Tests/SubProject"
      --build-project SubProject
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-target car
      --test-command car
      )
    # For stage 2, do not run cmake again.
    # Then build the foo sub project which should build
    # the bar library which should be referenced because
    # foo links to the static library bar, but bar is not
    # directly in the foo sub project
    ADD_TEST(SubProject-Stage2  ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/SubProject/foo"
326
      "${CMake_BINARY_DIR}/Tests/SubProject/foo"
327 328
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
329
      --build-nocmake
330 331 332 333
      --build-project foo
      --build-target foo
      --test-command foo
      )
334
    SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
335
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject")
336
  ENDIF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
337

338 339 340
  IF (CMAKE_STRICT)
    ADD_TEST_MACRO(DocTest DocTest)
  ENDIF (CMAKE_STRICT)
341 342 343 344 345 346 347
  # macro to add a test that will build a nightly release
  # of CMake for given platform using the release scripts
  MACRO(ADD_NIGHTLY_BUILD_TEST name script)
    SET(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}")
    FILE(MAKE_DIRECTORY "${_TEST_DIR}")
    FILE(WRITE "${_TEST_DIR}/nightly-cmake.sh"
      "cd ${_TEST_DIR}
348
${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P ${CMake_SOURCE_DIR}/Utilities/Release/${script}
349
${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake
350 351 352
    ")
    ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh)
    IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
353
      SET_TESTS_PROPERTIES (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
354 355 356 357 358 359 360 361 362 363
    ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
  ENDMACRO(ADD_NIGHTLY_BUILD_TEST)
  IF(CMAKE_BUILD_NIGHTLY_RELEASES)
    ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows
      dash2win64_release.cmake)
    ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac
      dashmacmini2_release.cmake)
    ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux
      magrathea_release.cmake)
  ENDIF(CMAKE_BUILD_NIGHTLY_RELEASES)
364

365
  # add tests with more complex invocations
366 367 368 369 370 371 372 373 374 375 376
  ADD_TEST(Framework ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/Framework"
    "${CMake_BINARY_DIR}/Tests/Framework"
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-project Framework
    --build-options
    "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install"
    --test-command bar)
377
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
378

379 380 381 382 383 384 385 386
  ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/TargetName"
    "${CMake_BINARY_DIR}/Tests/TargetName"
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-project TargetName
387
    --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
388 389
    ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
    ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
390
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName")
391 392 393 394 395 396 397 398

  ADD_TEST(LibName ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/LibName"
    "${CMake_BINARY_DIR}/Tests/LibName"
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
399
    --build-project LibName
400 401 402
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
    --test-command foobar
    )
403
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
404 405 406 407 408 409 410 411

  ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/CustComDepend"
    "${CMake_BINARY_DIR}/Tests/CustComDepend"
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
412
    --build-project CustComDepend
413 414 415
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
    --test-command foo bar.c
    )
416
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
417

Ben Boeckel's avatar
Ben Boeckel committed
418 419 420 421 422 423 424 425 426
  ADD_TEST(ArgumentExpansion  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/ArgumentExpansion"
    "${CMake_BINARY_DIR}/Tests/ArgumentExpansion"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project ArgumentExpansion
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
    )
427 428
  SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES
    FAIL_REGULAR_EXPRESSION "Unexpected: ")
Ben Boeckel's avatar
Ben Boeckel committed
429 430
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion")

431 432 433 434 435 436 437 438 439 440 441
  ADD_TEST(CustomCommand  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/CustomCommand"
    "${CMake_BINARY_DIR}/Tests/CustomCommand"
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project CustomCommand
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
    --test-command CustomCommand
    )
442
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
443 444 445 446 447 448 449 450 451 452 453

  ADD_TEST(CustomCommandWorkingDirectory  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory"
    "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory"
    --build-two-config
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project TestWorkingDir
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --test-command working
    )
454
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
455

Ken Martin's avatar
Ken Martin committed
456 457 458 459 460 461 462 463 464
   #ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND}
   #  --build-and-test
   #  "${CMake_SOURCE_DIR}/Tests/SimpleExclude"
   #  "${CMake_BINARY_DIR}/Tests/SimpleExclude"
   #  --build-generator ${CMAKE_TEST_GENERATOR}
   #  --build-project SimpleExclude
   #  --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
   #  --build-two-config
   #  --test-command t4
465 466
   #--test-command "${CMAKE_COMMAND}"
   #"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
467
   #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
Ken Martin's avatar
Ken Martin committed
468
   #)
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490

#  ADD_TEST(SameName  ${CMAKE_CTEST_COMMAND}
#    --build-and-test
#    "${CMake_SOURCE_DIR}/Tests/SameName"
#    "${CMake_BINARY_DIR}/Tests/SameName"
#    --build-generator ${CMAKE_TEST_GENERATOR}
#    --build-project SameName
#    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
#    --build-two-config
#    --test-command
#    "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")

  ADD_TEST(OutOfSource ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/OutOfSource"
    "${CMake_BINARY_DIR}/Tests/OutOfSource"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project OutOfSource
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-two-config
    --test-command
    "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
491 492 493
  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")
494 495 496 497 498 499 500 501 502

  ADD_TEST(BuildDepends ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/BuildDepends"
    "${CMake_BINARY_DIR}/Tests/BuildDepends"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project BuildDepends
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    )
503
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
504

505 506 507 508 509 510 511 512 513 514 515 516
  SET(SimpleInstallInstallDir
    "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory")
  ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/SimpleInstall"
    "${CMake_BINARY_DIR}/Tests/SimpleInstall"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project TestSimpleInstall
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-two-config
    --build-options
    "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
517
    "-DCTEST_TEST_CPACK:BOOL=${CTEST_TEST_CPACK}"
518
    --test-command   ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExe)
519
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall")
520 521 522 523 524 525 526 527 528 529 530
  ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2"
    "${CMake_BINARY_DIR}/Tests/SimpleInstallS2"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project TestSimpleInstall
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-two-config
    --build-options
    "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
    "-DSTAGE2:BOOL=1"
531
    --test-command   ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2)
532
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2")
533

534 535 536 537
  # By default, run the CPackComponents test if the CTEST_TEST_CPACK
  # option is ON:
  #
  set(CTEST_RUN_CPackComponents ${CTEST_TEST_CPACK})
538
  set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK})
539
  set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK})
540

541 542 543 544 545
  find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis
    PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
    DOC "makensis program location"
    )

546 547 548 549 550 551 552 553
  # But on Windows, only run the CPackComponents test if the NSIS
  # installer builder is available:
  #
  if(WIN32)
    if(NSIS_MAKENSIS_EXECUTABLE)
      set(CTEST_RUN_CPackComponents ON)
    else(NSIS_MAKENSIS_EXECUTABLE)
      set(CTEST_RUN_CPackComponents OFF)
554
      set(CTEST_package_X11_TEST OFF)
555 556 557 558
    endif(NSIS_MAKENSIS_EXECUTABLE)
  endif(WIN32)

  IF(CTEST_RUN_CPackComponents)
559 560 561 562
    set(CPackComponents_EXTRA_OPTIONS)
    if(APPLE)
      set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON)
    endif(APPLE)
563 564 565 566
    if(NSIS_MAKENSIS_EXECUTABLE)
      set(CPackComponents_EXTRA_OPTIONS ${CPackComponents_EXTRA_OPTIONS}
        -DCPACK_BINARY_NSIS:BOOL=ON)
    endif(NSIS_MAKENSIS_EXECUTABLE)
567

568 569 570 571 572 573 574 575 576
    ADD_TEST(CPackComponents ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/CPackComponents"
      "${CMake_BINARY_DIR}/Tests/CPackComponents"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-project CPackComponents
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-two-config
      --build-target package
577 578 579
      --build-options
        -DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
        -DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
580
        ${CPackComponents_EXTRA_OPTIONS}
581
        --graphviz=CPackComponents.dot
582 583 584
      --test-command ${CMAKE_CMAKE_COMMAND}
        "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents"
        -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake")
585
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
586
  ENDIF(CTEST_RUN_CPackComponents)
587

588 589 590
  IF(CTEST_RUN_CPackComponentsForAll)
    set(CPackComponentsForAll_EXTRA_OPTIONS)
    set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}")
591 592
    # set up list of CPack generators
    list(APPEND GENLST "ZIP")
593 594 595
    if(APPLE)
      list(APPEND GENLST "DragNDrop")
    endif(APPLE)
596
    if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*")
597
        find_program(RPMBUILD NAMES rpmbuild)
598
    endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*")
599 600 601
    if (RPMBUILD)
       list(APPEND GENLST "RPM")
    endif(RPMBUILD)
602 603 604 605 606 607
    if (CMAKE_SYSTEM_NAME MATCHES "Linux")
       find_program(DPKG NAMES dpkg)
       if (DPKG)
          list(APPEND GENLST "DEB")
       endif(DPKG)
    endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
608 609 610 611 612
    # set up list of component packaging ways
    list(APPEND CWAYLST "default")
    list(APPEND CWAYLST "OnePackPerGroup")
    list(APPEND CWAYLST "IgnoreGroup")
    list(APPEND CWAYLST "AllInOne")
613
    foreach(CPackGen ${GENLST})
614
      set(CPackRun_CPackGen  "-DCPackGen=${CPackGen}")
615
      foreach(CPackComponentWay ${CWAYLST})
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
        set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}")
        ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND}
          --build-and-test
          "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
          "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
          --build-generator ${CMAKE_TEST_GENERATOR}
          --build-project CPackComponentsForAll
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-options
             -DCPACK_BINARY_${CPackGen}:BOOL=ON
             ${CPackRun_CPackComponentWay}
             ${CPackComponentsForAll_EXTRA_OPTIONS}
             --graphviz=CPackComponentsForAll.dot
          --test-command ${CMAKE_CMAKE_COMMAND}
            "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
            "${CPackRun_CPackCommand}"
            "${CPackRun_CPackGen}"
            "${CPackRun_CPackComponentWay}"
            -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
        LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}")
      endforeach(CPackComponentWay)
    endforeach(CPackGen)
638 639
  ENDIF(CTEST_RUN_CPackComponentsForAll)

640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673
  # 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
      NOT "$ENV{COVFILE}" STREQUAL "" OR
      CMAKE_RUN_LONG_TESTS)
      set(CTEST_RUN_CPackTestAllGenerators ${CTEST_TEST_CPACK})
    endif(CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR
      NOT "$ENV{COVFILE}" STREQUAL "" OR
      CMAKE_RUN_LONG_TESTS)
  endif(NOT DEFINED CTEST_RUN_CPackTestAllGenerators)

  IF(CTEST_RUN_CPackTestAllGenerators)
    ADD_TEST(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators"
      "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-project CPackTestAllGenerators
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --test-command
      ${CMAKE_CMAKE_COMMAND}
        -D dir=${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators
        -D cpack=${CMAKE_CPACK_COMMAND}
        -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake
      )
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators")
  ENDIF(CTEST_RUN_CPackTestAllGenerators)

674
  IF(CTEST_package_X11_TEST)
675
    SET(X11_build_target_arg --build-target package)
676
  ELSE(CTEST_package_X11_TEST)
677
    SET(X11_build_target_arg)
678
  ENDIF(CTEST_package_X11_TEST)
679 680

  ADD_TEST(X11 ${CMAKE_CTEST_COMMAND}
681 682 683 684 685 686 687
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/X11"
    "${CMake_BINARY_DIR}/Tests/X11"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project UseX11
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-two-config
688
    ${X11_build_target_arg}
689
    --test-command  UseX11)
690
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
691

692 693 694 695 696 697 698 699 700 701 702 703 704 705
  if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators)
    set(CTEST_RUN_CMakeTestAllGenerators ON)
  endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators)

  IF(CTEST_RUN_CMakeTestAllGenerators)
    ADD_TEST(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND}
        -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators
        -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
        -P ${CMake_SOURCE_DIR}/Tests/CMakeTestAllGenerators/RunCMake.cmake
      )
    LIST(APPEND TEST_BUILD_DIRS
      "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators")
  ENDIF(CTEST_RUN_CMakeTestAllGenerators)

706 707 708 709 710 711 712 713 714 715 716 717 718 719 720
  if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)
    set(CTEST_RUN_CMakeTestBadCommandLines ON)
  endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)

  IF(CTEST_RUN_CMakeTestBadCommandLines)
    ADD_TEST(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND}
        -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines
        -D gen=${CMAKE_TEST_GENERATOR}
        -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
        -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake
      )
    LIST(APPEND TEST_BUILD_DIRS
      "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines")
  ENDIF(CTEST_RUN_CMakeTestBadCommandLines)

721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
  if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
    set(CTEST_RUN_CMakeTestMultipleConfigures ON)
  endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)

  IF(CTEST_RUN_CMakeTestMultipleConfigures)
    ADD_TEST(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND}
        -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures
        -D gen=${CMAKE_TEST_GENERATOR}
        -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
        -P ${CMake_SOURCE_DIR}/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
      )
    LIST(APPEND TEST_BUILD_DIRS
      "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures")
  ENDIF(CTEST_RUN_CMakeTestMultipleConfigures)

736 737 738 739 740
  ADD_TEST(LoadedCommandOneConfig  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig"
    "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
    --build-generator ${CMAKE_TEST_GENERATOR}
741
    --build-project LoadCommand
742 743 744
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --test-command  LoadedCommand
    )
745
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
746 747 748 749 750 751 752

  # Como does not seem to support shared libraries.
  GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
  IF(CMAKE_BASE_NAME MATCHES "^como$")
    SET(COMPILER_IS_COMO 1)
  ENDIF(CMAKE_BASE_NAME MATCHES "^como$")
  IF(NOT COMPILER_IS_COMO)
753 754 755 756
    SET(COMPLEX_TEST_CMAKELIB 1)
    IF(CMAKE_TEST_DIFFERENT_GENERATOR OR CMAKE_TEST_SYSTEM_LIBRARIES)
      SET(COMPLEX_TEST_CMAKELIB 0)
    ENDIF(CMAKE_TEST_DIFFERENT_GENERATOR OR CMAKE_TEST_SYSTEM_LIBRARIES)
757 758 759
    IF(BORLAND)
      SET(COMPLEX_TEST_CMAKELIB 0)
    ENDIF(BORLAND)
760 761 762 763 764 765 766 767 768 769 770
    ADD_TEST(complex  ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/Complex"
      "${CMake_BINARY_DIR}/Tests/Complex"
      --build-two-config
      --build-config-sample "${CMAKE_CTEST_COMMAND}"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-project Complex
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
      --build-options
771
      -DCOMPLEX_TEST_CMAKELIB:BOOL=${COMPLEX_TEST_CMAKELIB}
772
      -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
773 774
      --test-command complex
      )
775
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex")
776 777 778 779 780 781 782 783 784 785

    ADD_TEST(complexOneConfig  ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
      "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-project Complex
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
      --build-options
786
      -DCOMPLEX_TEST_CMAKELIB:BOOL=${COMPLEX_TEST_CMAKELIB}
787
      -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
788
      --test-command complex)
789
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
790 791
    # because of the registry write these tests depend on each other
    SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig)
792

Bill Hoffman's avatar
Bill Hoffman committed
793 794 795 796 797 798 799 800 801 802 803
# This fails on VS 70
# works on Xcode and makefiles
#      ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND}
#        --build-and-test
#        "${CMake_SOURCE_DIR}/Tests/ConvLibrary"
#        "${CMake_BINARY_DIR}/Tests/ConvLibrary"
#        --build-two-config
#        --build-generator ${CMAKE_TEST_GENERATOR}
#        --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
#        --build-project ConvLibrary
#        --test-command bartest)
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828


#    ADD_TEST(complexRelativePaths  ${CMAKE_CTEST_COMMAND}
#      --build-and-test
#      "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"
#      "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths"
#      --build-generator ${CMAKE_TEST_GENERATOR}
#      --build-project complex
#      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
#      --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin"
#      --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON
#      --test-command complex)

  ENDIF(NOT COMPILER_IS_COMO)

  ADD_TEST(Example ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Example"
    "${CMake_BINARY_DIR}/Example"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project HELLO
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo"
    --test-command helloDemo
    )
829
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example")
830

831 832 833 834 835 836 837 838 839
  ADD_TEST(Environment ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/Environment"
    "${CMake_BINARY_DIR}/Tests/Environment"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project EnvironmentProj
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Environment"
    --force-new-ctest-process
840
    --test-command ${CMAKE_CTEST_COMMAND} -V
841 842 843
    )
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment")

844 845 846 847 848 849 850 851 852
  ADD_TEST(ExternalProject ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/ExternalProject"
    "${CMake_BINARY_DIR}/Tests/ExternalProject"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project ExternalProjectTest
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProject"
    --force-new-ctest-process
853
    --test-command ${CMAKE_CTEST_COMMAND} -V
854 855
    )
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
856 857
  SET_TESTS_PROPERTIES(ExternalProject PROPERTIES
    TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
858

859 860
  # do each of the tutorial steps
  FOREACH(STP RANGE 1 7)
861 862 863 864 865 866 867 868 869 870
    ADD_TEST(TutorialStep${STP} ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}"
      "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}"
      --build-two-config
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project Tutorial
      --test-command Tutorial 25.0)
  ENDFOREACH(STP)
871
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
872

873
  ADD_TEST(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
874 875 876 877 878 879
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/Testing"
    "${CMake_BINARY_DIR}/Tests/Testing"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project Testing
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
880
    --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
881
    )
882
  SET_TESTS_PROPERTIES(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
883
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
884 885 886 887 888 889 890 891 892 893 894

  ADD_TEST(wrapping  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/Wrapping"
    "${CMake_BINARY_DIR}/Tests/Wrapping"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project Wrapping
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
    --test-command wrapping
    )
895 896 897 898 899 900 901 902
  ADD_TEST(qtwrapping  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/Wrapping"
    "${CMake_BINARY_DIR}/Tests/Wrapping"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-project Wrapping
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
903 904
      --test-command qtwrapping
      )
905
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938

  ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/TestDriver"
    "${CMake_BINARY_DIR}/Tests/TestDriver"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
    --build-project TestDriverTest
    --test-command TestDriverTest test1
    )

  ADD_TEST(testdriver2 ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/TestDriver"
    "${CMake_BINARY_DIR}/Tests/TestDriver"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
    --build-project TestDriverTest
    --test-command TestDriverTest test2
    )

  ADD_TEST(testdriver3  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/TestDriver"
    "${CMake_BINARY_DIR}/Tests/TestDriver"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
    --build-project TestDriverTest
    --test-command TestDriverTest subdir/test3
    )
939
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
940

941
  ADD_TEST(Dependency ${CMAKE_CTEST_COMMAND}
942 943
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/Dependency"
944 945
    "${CMake_BINARY_DIR}/Tests/Dependency"
    --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/Exec"
946 947 948 949 950
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-project Dependency
    --test-command exec
    )
951
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
952

953 954 955 956 957
  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 .
958
# For now we just require on Syllable that the user adjusts the DLL_PATH
959 960 961
# environment variable, so except the two tests below all other tests will succeed.

    SET(_DLL_PATH "$ENV{DLL_PATH}")
962 963 964 965 966 967
    IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
      MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable")
    ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
    IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
      MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable")
    ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994

  ELSE("${CMAKE_SYSTEM_NAME}" MATCHES syllable)

    ADD_TEST(JumpWithLibOut  ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/Jump"
      "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut"
      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable"
      --build-project Jump
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-options
      -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
      --test-command jumpExecutable
      )

    ADD_TEST(JumpNoLibOut  ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/Jump"
      "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut"
      --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
      --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
      --build-project Jump
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --test-command jumpExecutable
      )
995
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
996 997 998 999 1000 1001 1002 1003 1004 1005

    ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/Plugin"
      "${CMake_BINARY_DIR}/Tests/Plugin"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-project Plugin
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-two-config
      --test-command bin/example)
1006
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
1007

1008 1009 1010
    IF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
      ADD_TEST_MACRO(RuntimePath RuntimePath)
    ENDIF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
1011
  ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031

  ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
    "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-project LinkLineOrder
    --test-command Exec1
    )

  ADD_TEST(linkorder2  ${CMAKE_CTEST_COMMAND}
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
    "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
    --build-generator ${CMAKE_TEST_GENERATOR}
    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
    --build-project LinkLineOrder
    --test-command Exec2
    )
1032
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
1033 1034 1035 1036 1037 1038
  SET_TESTS_PROPERTIES ( qtwrapping PROPERTIES DEPENDS wrapping)
  SET_TESTS_PROPERTIES ( testdriver1 PROPERTIES DEPENDS qtwrapping)
  SET_TESTS_PROPERTIES ( testdriver2 PROPERTIES DEPENDS testdriver1)
  SET_TESTS_PROPERTIES ( testdriver3 PROPERTIES DEPENDS testdriver2)
  SET_TESTS_PROPERTIES ( linkorder2 PROPERTIES DEPENDS linkorder1)
  SET_TESTS_PROPERTIES ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall)
1039

1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
  # Test static linking on toolchains known to support it.
  IF("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$"
      AND NOT APPLE AND NOT WIN32 AND NOT CYGWIN
      AND EXISTS "/usr/lib/libm.a")
    ADD_TEST(LinkStatic  ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/LinkStatic"
      "${CMake_BINARY_DIR}/Tests/LinkStatic"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project LinkStatic
      --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a
      --test-command LinkStatic
      )
  ENDIF()

1056 1057 1058 1059 1060 1061 1062 1063 1064 1065
  IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
    ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Source/kwsys"
      "${CMake_BINARY_DIR}/Tests/kwsys"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project kwsys
      --test-command kwsysTestsCxx testIOS
      )
1066
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys")
1067 1068 1069 1070
  ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
  SET(MAKE_IS_GNU )
  IF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
    EXEC_PROGRAM(
1071
      ${CMAKE_TEST_MAKEPROGRAM} ARGS no_such_target --version
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
      RETURN_VALUE res OUTPUT_VARIABLE out
      )
    IF("${res}" EQUAL 0)
      IF("${out}" MATCHES "GNU")
        SET(MAKE_IS_GNU 1)
      ENDIF("${out}" MATCHES "GNU")
    ENDIF("${res}" EQUAL 0)
  ENDIF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)

  # only add this test on platforms that support it
  # some old versions of make simply cannot handle spaces in paths
1083
  IF (MAKE_IS_GNU OR
1084 1085 1086 1087 1088 1089
      "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
      "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
    ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/SubDirSpaces"
      "${CMake_BINARY_DIR}/Tests/SubDirSpaces"
1090
      --build-exe-dir
1091 1092 1093 1094 1095 1096 1097 1098
      "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project SUBDIR
      --test-command test
      "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere"
      "${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
      )
1099
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces")
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
  ENDIF (MAKE_IS_GNU OR
    "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
    "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")

  IF (WIN32)
    ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/SubDir"
      "${CMake_BINARY_DIR}/Tests/SubDir"
      --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project SUBDIR
      --test-command test
      "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
      "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
      )
  ELSE (WIN32)
    ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/SubDir"
      "${CMake_BINARY_DIR}/Tests/SubDir"
      --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-project SUBDIR
      --test-command test
      "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
      "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
      )
  ENDIF (WIN32)
1131
  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
1132 1133

  IF(CMAKE_TEST_MSVC)
1134
    ADD_TEST_MACRO(ForceInclude foo)
1135
    ADD_TEST_MACRO(PrecompiledHeader foo)
1136 1137 1138
  ENDIF()
  IF(CMAKE_TEST_MSVC OR
      "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles")
1139
    ADD_TEST_MACRO(ModuleDefinition example_exe)
1140
  ENDIF()
1141

1142 1143
  ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables)

1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
  IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
    ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/MakeClean"
      "${CMake_BINARY_DIR}/Tests/MakeClean"
      --build-generator ${CMAKE_TEST_GENERATOR}
      --build-project MakeClean
      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
      --build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
      --test-command check_clean
      )
1155
    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
1156 1157 1158 1159 1160 1161 1162 1163 1164