summaryrefslogtreecommitdiffstats
path: root/Tests/CommandLineTest/CMakeLists.txt
blob: 6249092893e8419dc82d8c58c9a03c8b892a400a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PROJECT(CommandLineTest)

GET_FILENAME_COMPONENT(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH)
FIND_PROGRAM(DUMP_DOC_EXE NAMES DumpDocumentation PATHS ${CMAKE_BIN_DIR})

EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E chdir ${CMAKE_CURRENT_SOURCE_DIR} \"${CMAKE_COMMAND} -E echo \\\"Hello World\\\"\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E time \"${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E time \"${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E time \"${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help-command-list")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help ADD_EXECUTABLE")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help-command ADD_EXECUTABLE")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help-full \"${CMAKE_CURRENT_BINARY_DIR}/cmake.txt\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help-man \"${CMAKE_CURRENT_BINARY_DIR}/cmake.man\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"")
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"")

IF(DUMP_DOC_EXE)
  EXEC_PROGRAM(${DUMP_DOC_EXE} ARGS "--all-for-coverage \"${CMAKE_CURRENT_BINARY_DIR}/all_for_coverage.txt\"")
ELSE(DUMP_DOC_EXE)
  MESSAGE(SEND_ERROR "Cannot find DumpDocumentation executable.")
ENDIF(DUMP_DOC_EXE)

ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx)

GET_FILENAME_COMPONENT(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH)
SET(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest")

EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-N")
EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-R complex -N")
EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-E Simple -N")
EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-E Simple -N")
EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-N -I -10")
EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-N -I 10-")
EXEC_PROGRAM(${CTEST_COMMAND} "${CMAKE_CURRENT_BINARY_DIR}/../.." ARGS "-N -I 3,4")
EXEC_PROGRAM(${CTEST_COMMAND} ARGS "--help")
EXEC_PROGRAM(${CTEST_COMMAND} ARGS "--copyright")
EXEC_PROGRAM(${CTEST_COMMAND} ARGS "--help-full \"${CMAKE_CURRENT_BINARY_DIR}/ctest.txt\"")
EXEC_PROGRAM(${CTEST_COMMAND} ARGS "--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"")
EXEC_PROGRAM(${CTEST_COMMAND} ARGS "--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"")
EXEC_PROGRAM(${CTEST_COMMAND} ARGS "--version")

IF(THIS_SHOULD_BE_SET)
  MESSAGE(STATUS "***************************")
  MESSAGE(STATUS "PreLoad.cmake works fine.")
  MESSAGE(STATUS "***************************")
ELSE(THIS_SHOULD_BE_SET)
  MESSAGE("***************************")
  MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.")
ENDIF(THIS_SHOULD_BE_SET)