File tree 5 files changed +29
-31
lines changed
5 files changed +29
-31
lines changed Original file line number Diff line number Diff line change @@ -897,7 +897,7 @@ if( LLVM_INCLUDE_TESTS )
897
897
NO_INSTALL
898
898
ALWAYS_CLEAN)
899
899
endif ()
900
- add_subdirectory (utils/lit/tests )
900
+ add_subdirectory (utils/lit)
901
901
add_subdirectory (test )
902
902
add_subdirectory (unittests)
903
903
if ( LLVM_INCLUDE_UTILS )
Original file line number Diff line number Diff line change
1
+ # The configured file is not placed in the correct location
2
+ # until the tests are run as we need to copy it into
3
+ # a copy of the tests folder
4
+ configure_file ("tests/lit.site.cfg.in" "lit.site.cfg" @ONLY)
5
+
6
+ # Lit's test suite creates output files next to the sources which makes the
7
+ # source tree dirty. This is undesirable because we do out of source builds.
8
+ # To work around this the tests and the configuration file are copied into the
9
+ # build directory just before running them. The tests are not copied over at
10
+ # configure time (i.e. `file(COPY ...)`) because this could lead to stale
11
+ # tests being run.
12
+ add_custom_target (prepare-check-lit
13
+ COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR} /tests"
14
+ COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR} /tests" "${CMAKE_CURRENT_BINARY_DIR} /tests"
15
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR} /lit.site.cfg" "${CMAKE_CURRENT_BINARY_DIR} /tests"
16
+ COMMENT "Preparing lit tests"
17
+ )
18
+
19
+ # Add rules for lit's own test suite
20
+ add_lit_testsuite(check-lit "Running lit's tests"
21
+ ${CMAKE_CURRENT_BINARY_DIR}
22
+ DEPENDS "FileCheck" "not" "prepare-check-lit"
23
+ )
24
+
25
+ # For IDEs
26
+ set_target_properties (check-lit PROPERTIES FOLDER "Tests" )
27
+ set_target_properties (prepare-check-lit PROPERTIES FOLDER "Tests" )
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,6 +5,4 @@ config.llvm_obj_root = "@LLVM_BINARY_DIR@"
5
5
config.llvm_tools_dir = "@LLVM_TOOLS_BINARY_DIR@"
6
6
7
7
# Let the main config do the real work.
8
- lit_config.load_config(config, "@LLVM_SOURCE_DIR@/utils/lit/tests/lit.cfg")
9
- config.test_source_root = "@CMAKE_CURRENT_SOURCE_DIR@"
10
- config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
8
+ lit_config.load_config(config, "@LLVM_BINARY_DIR@/utils/lit/tests/lit.cfg")
You can’t perform that action at this time.
0 commit comments