[lit] Remove LitTestCase
[llvm-complete.git] / test / CMakeLists.txt
blobe69ceebabe0da4938f4809d0dbce346d7d2ccb30
1 llvm_canonicalize_cmake_booleans(
2   BUILD_SHARED_LIBS
3   HAVE_LIBXAR
4   HAVE_LIBZ
5   HAVE_OCAMLOPT
6   HAVE_OCAML_OUNIT
7   LLVM_ENABLE_DIA_SDK
8   LLVM_ENABLE_FFI
9   LLVM_ENABLE_THREADS
10   LLVM_INCLUDE_GO_TESTS
11   LLVM_LIBXML2_ENABLED
12   LLVM_LINK_LLVM_DYLIB
13   LLVM_TOOL_LTO_BUILD
14   LLVM_USE_INTEL_JITEVENTS
15   )
17 configure_lit_site_cfg(
18   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
19   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
20   MAIN_CONFIG
21   ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
22   )
23 configure_lit_site_cfg(
24   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
25   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
26   MAIN_CONFIG
27   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
28   )
30 # Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
31 if(NOT LLVM_BUILD_TOOLS)
32   set(EXCLUDE_FROM_ALL ON)
33 endif()
35 # Set the depends list as a variable so that it can grow conditionally.
36 # NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
37 set(LLVM_TEST_DEPENDS
38           BugpointPasses
39           FileCheck
40           LLVMHello
41           UnitTests
42           bugpoint
43           count
44           llc
45           lli
46           lli-child-target
47           llvm-ar
48           llvm-as
49           llvm-bcanalyzer
50           llvm-c-test
51           llvm-cat
52           llvm-cfi-verify
53           llvm-config
54           llvm-cov
55           llvm-cvtres
56           llvm-cxxdump
57           llvm-cxxfilt
58           llvm-cxxmap
59           llvm-diff
60           llvm-dis
61           llvm-dlltool
62           dsymutil
63           llvm-dwarfdump
64           llvm-dwp
65           llvm-elfabi
66           llvm-exegesis
67           llvm-extract
68           llvm-isel-fuzzer
69           llvm-lib
70           llvm-link
71           llvm-lto2
72           llvm-mc
73           llvm-mca
74           llvm-modextract
75           llvm-mt
76           llvm-nm
77           llvm-objcopy
78           llvm-objdump
79           llvm-opt-fuzzer
80           llvm-opt-report
81           llvm-pdbutil
82           llvm-profdata
83           llvm-ranlib
84           llvm-rc
85           llvm-readobj
86           llvm-readelf
87           llvm-rtdyld
88           llvm-size
89           llvm-split
90           llvm-strings
91           llvm-strip
92           llvm-symbolizer
93           llvm-tblgen
94           llvm-undname
95           llvm-xray
96           not
97           obj2yaml
98           opt
99           sancov
100           sanstats
101           verify-uselistorder
102           yaml-bench
103           yaml2obj
104         )
106 if(TARGET llvm-lto)
107   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
108 endif()
110 # If Intel JIT events are supported, depend on a tool that tests the listener.
111 if( LLVM_USE_INTEL_JITEVENTS )
112   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
113 endif( LLVM_USE_INTEL_JITEVENTS )
115 if(TARGET LLVMgold)
116   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LLVMgold)
117 endif()
119 if(TARGET llvm-go)
120   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go)
121 endif()
123 if(TARGET LTO)
124   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
125 endif()
127 if(LLVM_BUILD_EXAMPLES)
128   list(APPEND LLVM_TEST_DEPENDS
129     Kaleidoscope-Ch3
130     Kaleidoscope-Ch4
131     Kaleidoscope-Ch5
132     Kaleidoscope-Ch6
133     Kaleidoscope-Ch7
134     )
135 endif()
137 if(TARGET ocaml_llvm)
138   # Clear all non-OCaml cross-target dependencies when building out-of-tree.
139   if(LLVM_OCAML_OUT_OF_TREE)
140     set(LLVM_TEST_DEPENDS)
141   endif()
143   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS}
144           ocaml_llvm
145           ocaml_llvm_all_backends
146           ocaml_llvm_analysis
147           ocaml_llvm_bitreader
148           ocaml_llvm_bitwriter
149           ocaml_llvm_executionengine
150           ocaml_llvm_irreader
151           ocaml_llvm_linker
152           ocaml_llvm_target
153           ocaml_llvm_ipo
154           ocaml_llvm_passmgr_builder
155           ocaml_llvm_scalar_opts
156           ocaml_llvm_transform_utils
157           ocaml_llvm_vectorize
158         )
159 endif()
161 add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
162 set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
164 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
165   ${CMAKE_CURRENT_BINARY_DIR}
166   DEPENDS ${LLVM_TEST_DEPENDS}
167   )
168 set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
170 add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
171   DEPENDS ${LLVM_TEST_DEPENDS}
172   )
174 # Setup a legacy alias for 'check-llvm'. This will likely change to be an
175 # alias for 'check-all' at some point in the future.
176 add_custom_target(check)
177 add_dependencies(check check-llvm)
178 set_target_properties(check PROPERTIES FOLDER "Tests")