31 lines · plain
1# The configured file is not placed in the correct location2# until the tests are run as we need to copy it into3# a copy of the tests folder4configure_lit_site_cfg(5 "${CMAKE_CURRENT_SOURCE_DIR}/tests/lit.site.cfg.in"6 "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg"7 )8 9# Lit's test suite creates output files next to the sources which makes the10# source tree dirty. This is undesirable because we do out of source builds.11# To work around this the tests and the configuration file are copied into the12# build directory just before running them. The tests are not copied over at13# configure time (i.e. `file(COPY ...)`) because this could lead to stale14# tests being run.15add_custom_target(prepare-check-lit16 COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/tests"17 COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/tests" "${CMAKE_CURRENT_BINARY_DIR}/tests"18 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg" "${CMAKE_CURRENT_BINARY_DIR}/tests"19 COMMENT "Preparing lit tests"20)21 22# Add rules for lit's own test suite23add_lit_testsuite(check-lit "Running lit's tests"24 ${CMAKE_CURRENT_BINARY_DIR}25 DEPENDS "FileCheck" "not" "split-file" "prepare-check-lit"26)27 28# For IDEs29set_target_properties(check-lit PROPERTIES FOLDER "LLVM/Tests")30set_target_properties(prepare-check-lit PROPERTIES FOLDER "LLVM/Tests")31