summaryrefslogtreecommitdiffstats
path: root/testing/CMakeLists.txt
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-02 10:13:19 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-02 10:13:19 (GMT)
commit4ad6c2ab4dc19aeffef3d40ae3f813ba9ee41a4a (patch)
tree9f02f249303168a3141a0dab3d55fb81d8daf766 /testing/CMakeLists.txt
parent1c2acccbe1a1f348c5741036289f630e54c3f771 (diff)
downloadDoxygen-4ad6c2ab4dc19aeffef3d40ae3f813ba9ee41a4a.zip
Doxygen-4ad6c2ab4dc19aeffef3d40ae3f813ba9ee41a4a.tar.gz
Doxygen-4ad6c2ab4dc19aeffef3d40ae3f813ba9ee41a4a.tar.bz2
Enable running tests in parallel using cmake's ctest.
Diffstat (limited to 'testing/CMakeLists.txt')
-rw-r--r--testing/CMakeLists.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
index 40cb40b..6c0a338 100644
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -1,9 +1,20 @@
+# run all tests sequentially (keep for backward compatibilty)
add_custom_target(tests
COMMENT "Running doxygen tests..."
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
DEPENDS doxygen
)
-add_test(NAME suite
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --doxygen $<TARGET_FILE:doxygen> --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
-)
+# get the files in the testing directory starting with 3 digits and an underscore
+file(GLOB TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/[0-9][0-9][0-9]_*.*")
+
+foreach(TEST_FILE ${TEST_FILES})
+ # extract the test name from the file name (3 digit excluding trailing zeros)
+ string(REGEX REPLACE "^.*/([0-9][0-9][0-9]*.*)\\.[^.]*$" "\\1" TEST_NAME "${TEST_FILE}")
+ # extract the test id from the file name
+ string(REGEX REPLACE "^.*/0?0?([1-9][0-9]*).*$" "\\1" TEST_ID "${TEST_FILE}")
+ # add a test target for each test
+ add_test(NAME ${TEST_NAME}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --doxygen $<TARGET_FILE:doxygen> --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
+ )
+endforeach()