Merge pull request #2073 from blueyed/fix-examples
tests: examples: remove caching, add depends for ldoc
This commit is contained in:
commit
65b6d12b44
|
@ -288,8 +288,7 @@ if(GENERATE_DOC)
|
||||||
# Copy the aliases to the build directory
|
# Copy the aliases to the build directory
|
||||||
file(COPY ${SOURCE_DIR}/docs/aliases DESTINATION ${BUILD_DIR}/docs)
|
file(COPY ${SOURCE_DIR}/docs/aliases DESTINATION ${BUILD_DIR}/docs)
|
||||||
|
|
||||||
add_custom_target(ldoc ALL
|
add_custom_target(ldoc ALL DEPENDS ${BUILD_DIR}/doc/index.html)
|
||||||
DEPENDS ${BUILD_DIR}/doc/index.html)
|
|
||||||
if (STRICT_TESTS)
|
if (STRICT_TESTS)
|
||||||
set(ldoc_args --fatalwarnings .)
|
set(ldoc_args --fatalwarnings .)
|
||||||
set(ldoc_desc_suffix " (fatal warnings)")
|
set(ldoc_desc_suffix " (fatal warnings)")
|
||||||
|
@ -300,7 +299,7 @@ if(GENERATE_DOC)
|
||||||
OUTPUT ${BUILD_DIR}/doc/index.html
|
OUTPUT ${BUILD_DIR}/doc/index.html
|
||||||
COMMAND ${LDOC_EXECUTABLE} ${ldoc_args}
|
COMMAND ${LDOC_EXECUTABLE} ${ldoc_args}
|
||||||
WORKING_DIRECTORY ${AWE_DOC_DIR}
|
WORKING_DIRECTORY ${AWE_DOC_DIR}
|
||||||
DEPENDS ${AWE_SRCS} ${AWE_LUA_FILES} ${AWE_MD_FILES} ${BUILD_DIR}/docs/config.ld
|
DEPENDS ${AWE_SRCS} ${AWE_LUA_FILES} ${AWE_MD_FILES} ${BUILD_DIR}/docs/config.ld generate-examples
|
||||||
COMMENT "Generating API documentation${ldoc_desc_suffix}")
|
COMMENT "Generating API documentation${ldoc_desc_suffix}")
|
||||||
endif()
|
endif()
|
||||||
# }}}
|
# }}}
|
||||||
|
|
|
@ -282,12 +282,8 @@ endfunction()
|
||||||
file(GLOB_RECURSE test_files LIST_DIRECTORIES false
|
file(GLOB_RECURSE test_files LIST_DIRECTORIES false
|
||||||
"${TOP_SOURCE_DIR}/tests/examples/*.lua")
|
"${TOP_SOURCE_DIR}/tests/examples/*.lua")
|
||||||
|
|
||||||
# TODO: check for changed files (timestamp)?!
|
# Find and run all test files.
|
||||||
if(NOT "${test_files}" STREQUAL "${EXAMPLE_DOC_SOURCE_FILES}")
|
foreach(file ${test_files})
|
||||||
set(EXAMPLE_DOC_SOURCE_FILES "${test_files}" CACHE INTERNAL "Source files used to generate doc files.")
|
|
||||||
|
|
||||||
# Find and run all test files.
|
|
||||||
foreach(file ${test_files})
|
|
||||||
if ((NOT "${file}" MATCHES ".*/shims/.*")
|
if ((NOT "${file}" MATCHES ".*/shims/.*")
|
||||||
AND (NOT "${file}" MATCHES ".*/template.lua"))
|
AND (NOT "${file}" MATCHES ".*/template.lua"))
|
||||||
|
|
||||||
|
@ -308,17 +304,12 @@ if(NOT "${test_files}" STREQUAL "${EXAMPLE_DOC_SOURCE_FILES}")
|
||||||
# " wont work in <code>.
|
# " wont work in <code>.
|
||||||
string(REPLACE "\"" "'" ${TEST_NAME} ${ESCAPED_CODE_EXAMPLE})
|
string(REPLACE "\"" "'" ${TEST_NAME} ${ESCAPED_CODE_EXAMPLE})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
set(EXAMPLE_DOC_GENERATED_FILES ${EXAMPLE_DOC_GENERATED_FILES}
|
add_custom_target(generate-examples DEPENDS ${EXAMPLE_DOC_GENERATED_FILES})
|
||||||
CACHE INTERNAL "List of generated files for example docs.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_custom_target(generate-examples ALL
|
|
||||||
DEPENDS ${EXAMPLE_DOC_GENERATED_FILES})
|
|
||||||
|
|
||||||
add_custom_target(check-examples
|
add_custom_target(check-examples
|
||||||
${CMAKE_COMMAND} -D EXAMPLE_DOC_SOURCE_FILES= ${CMAKE_SOURCE_DIR}
|
${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
list(APPEND CHECK_TARGETS check-examples)
|
list(APPEND CHECK_TARGETS check-examples)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue