File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 11option (CMKR_GENERATE_DOCUMENTATION "Generate cmkr documentation" ${CMKR_ROOT_PROJECT} )
2- set (CMKR_TESTS "" CACHE INTERNAL "List of test directories in the order declared in tests/cmake.toml" )
3-
4- if (CMKR_GENERATE_DOCUMENTATION)
5- # Hook the add_test function to capture the tests in the order declared in tests/cmake.toml
6- function (add_test)
7- cmake_parse_arguments (TEST "" "WORKING_DIRECTORY" "" ${ARGN} )
8- get_filename_component (TEST_WORKING_DIRECTORY "${TEST_WORKING_DIRECTORY} " NAME )
9- list (APPEND CMKR_TESTS "${TEST_WORKING_DIRECTORY} " )
10- set (CMKR_TESTS "${CMKR_TESTS} " CACHE INTERNAL "" )
11- _add_test(${test} ${ARGN} )
12- endfunction ()
13- endif ()
142
153function (generate_documentation)
164 if (CMKR_GENERATE_DOCUMENTATION)
175 message (STATUS "[cmkr] Generating documentation..." )
6+
7+ # Extract the order of the tests
8+ set (CMKR_TESTS "" )
9+ file (READ "${PROJECT_SOURCE_DIR} /tests/cmake.toml" tests_toml NO_HEX_CONVERSION )
10+ string (REGEX MATCHALL "working-directory = \" ([^\" ]+)\" " tests_match "${tests_toml} " )
11+ foreach (match ${tests_match} )
12+ if (match MATCHES "working-directory = \" ([^\" ]+)\" " )
13+ list (APPEND CMKR_TESTS "${CMAKE_MATCH_1} " )
14+ else ()
15+ message (FATAL_ERROR "This should not happen (wrong regex?)" )
16+ endif ()
17+ endforeach ()
1818
1919 # Delete previously generated examples
2020 set (example_folder "${PROJECT_SOURCE_DIR} /docs/examples" )
You can’t perform that action at this time.
0 commit comments