diff options
author | Craig Scott <craig.scott@crascit.com> | 2018-05-29 09:24:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-05-29 09:25:04 (GMT) |
commit | 4e890800eb79cfa758c27ae55eb5ffe10b19fcb3 (patch) | |
tree | 8436587acdf02384ff31682a8331f0757a6ac364 /Tests | |
parent | 11818c5fc1fa33fcac6b4961de56f02eb75f9c67 (diff) | |
parent | 7b2f440e2b9c383cca3c5557e8dddd99cc8cab44 (diff) | |
download | CMake-4e890800eb79cfa758c27ae55eb5ffe10b19fcb3.zip CMake-4e890800eb79cfa758c27ae55eb5ffe10b19fcb3.tar.gz CMake-4e890800eb79cfa758c27ae55eb5ffe10b19fcb3.tar.bz2 |
Merge topic 'doxygen-all'
7b2f440e2b FindDoxygen: Add tests for ALL option
79b29b732c FindDoxygen: add optional ALL argument
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2099
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindDoxygen/AllTarget/CMakeLists.txt | 42 | ||||
-rw-r--r-- | Tests/FindDoxygen/CMakeLists.txt | 10 |
2 files changed, 52 insertions, 0 deletions
diff --git a/Tests/FindDoxygen/AllTarget/CMakeLists.txt b/Tests/FindDoxygen/AllTarget/CMakeLists.txt new file mode 100644 index 0000000..69aa518 --- /dev/null +++ b/Tests/FindDoxygen/AllTarget/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE) +enable_testing() + +find_package(Doxygen REQUIRED) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp [[ +/** + * \file + * \brief One C++ file w/ sample Doxygen comment just to produce any docs... + */ +]]) + +set(DOXYGEN_OUTPUT_DIRECTORY outDirWithout) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_DIRECTORY}) +doxygen_add_docs(docsNoAll ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) + +set(DOXYGEN_OUTPUT_DIRECTORY outDirWith) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_DIRECTORY}) +doxygen_add_docs(docsWithAll ALL ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) + +# Define tests cases that check whether targets were built +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dirExists.cmake [[ +cmake_minimum_required(VERSION 3.11) +if(NOT EXISTS ${dirName}) + message(FATAL_ERROR "Directory does not exist: ${dirName}") +endif() +]]) + +add_test(NAME checkWith COMMAND + ${CMAKE_COMMAND} + -D dirName=${CMAKE_CURRENT_BINARY_DIR}/outDirWith + -P dirExists.cmake +) +add_test(NAME checkWithout COMMAND + ${CMAKE_COMMAND} + -D dirName=${CMAKE_CURRENT_BINARY_DIR}/outDirWithout + -P dirExists.cmake +) +set_tests_properties(checkWithout PROPERTIES + WILL_FAIL TRUE +) diff --git a/Tests/FindDoxygen/CMakeLists.txt b/Tests/FindDoxygen/CMakeLists.txt index 69b9eed..7ce98d5 100644 --- a/Tests/FindDoxygen/CMakeLists.txt +++ b/Tests/FindDoxygen/CMakeLists.txt @@ -18,6 +18,16 @@ add_test(NAME FindDoxygen.QuotingTest COMMAND --build-options ${build_options} ) +add_test(NAME FindDoxygen.AllTarget COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindDoxygen/AllTarget" + "${CMake_BINARY_DIR}/Tests/FindDoxygen/AllTarget" + ${build_generator_args} + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> +) + if(CMake_TEST_FindDoxygen_Dot) add_test(NAME FindDoxygen.DotComponentTest COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> |