diff options
author | Brad King <brad.king@kitware.com> | 2003-07-24 14:58:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-07-24 14:58:40 (GMT) |
commit | 08441daded83d314c95016b1a6f7bb047b85e0f2 (patch) | |
tree | 9ced40f442855405d882bc06c2a3c494475a314d /Tests/CommandLineTest | |
parent | 1a0ca7264885f953a8adbe90ae5d6b9dfdf9142c (diff) | |
download | CMake-08441daded83d314c95016b1a6f7bb047b85e0f2.zip CMake-08441daded83d314c95016b1a6f7bb047b85e0f2.tar.gz CMake-08441daded83d314c95016b1a6f7bb047b85e0f2.tar.bz2 |
ENH: Added CommandLineTest to add coverage for command line arguments to cmake executables. This replaces the old DumpDocumentation test.
Diffstat (limited to 'Tests/CommandLineTest')
-rw-r--r-- | Tests/CommandLineTest/CMakeLists.txt | 22 | ||||
-rw-r--r-- | Tests/CommandLineTest/CommandLineTest.cxx | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt new file mode 100644 index 0000000..ebea593 --- /dev/null +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -0,0 +1,22 @@ +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-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\"") + +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) diff --git a/Tests/CommandLineTest/CommandLineTest.cxx b/Tests/CommandLineTest/CommandLineTest.cxx new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/CommandLineTest/CommandLineTest.cxx @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} |