Use pipefail when available.
[oota-llvm.git] / test / CMakeLists.txt
1 configure_lit_site_cfg(
2   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
3   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
4   )
5 configure_lit_site_cfg(
6   ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
7   ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
8   )
9
10 # Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
11 if(NOT LLVM_BUILD_TOOLS)
12   set(EXCLUDE_FROM_ALL ON)
13 endif()
14
15 # Set the depends list as a variable so that it can grow conditionally.
16 set(LLVM_TEST_DEPENDS
17           UnitTests
18           BugpointPasses
19           LLVMHello
20           llc
21           lli
22           llvm-ar
23           llvm-as
24           llvm-bcanalyzer
25           llvm-cov
26           llvm-diff
27           llvm-dis
28           llvm-extract
29           llvm-dwarfdump
30           llvm-link
31           llvm-mc
32           llvm-mcmarkup
33           llvm-nm
34           llvm-objdump
35           llvm-readobj
36           llvm-rtdyld
37           llvm-symbolizer
38           macho-dump
39           opt
40           profile_rt-shared
41           FileCheck
42           count
43           not
44           yaml2obj
45           obj2yaml
46         )
47
48 # If Intel JIT events are supported, depend on a tool that tests the listener.
49 if( LLVM_USE_INTEL_JITEVENTS )
50   set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener)
51 endif( LLVM_USE_INTEL_JITEVENTS )
52
53 add_lit_testsuite(check-llvm "Running the LLVM regression tests"
54   ${CMAKE_CURRENT_BINARY_DIR}
55   PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
56          llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
57   DEPENDS ${LLVM_TEST_DEPENDS}
58   )
59 set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
60
61 # Setup a legacy alias for 'check-llvm'. This will likely change to be an
62 # alias for 'check-all' at some point in the future.
63 add_custom_target(check)
64 add_dependencies(check check-llvm)
65 set_target_properties(check PROPERTIES FOLDER "Tests")