blob: df51bf821f8a809c8796a09b0f3855952f734c54 [file] [log] [blame]
Michael J. Spenceree6944f2010-09-24 09:01:13 +00001function(add_llvm_unittest test_name)
2 if (CMAKE_BUILD_TYPE)
3 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
4 ${LLVM_BINARY_DIR}/unittests/${test_name}/${CMAKE_BUILD_TYPE})
5 else()
6 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
7 ${LLVM_BINARY_DIR}/unittests/${test_name})
8 endif()
9 if( NOT LLVM_BUILD_TESTS )
10 set(EXCLUDE_FROM_ALL ON)
11 endif()
Oscar Fuentes066de852010-09-25 20:25:25 +000012 add_llvm_executable(${test_name}Tests ${ARGN})
Michael J. Spenceree6944f2010-09-24 09:01:13 +000013endfunction()
14
15include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
Michael J. Spencer8a806ae2010-10-19 18:04:19 +000016set(LLVM_REQUIRES_RTTI 1)
17add_definitions(-DGTEST_HAS_RTTI=0)
Michael J. Spenceree6944f2010-09-24 09:01:13 +000018
19set(LLVM_LINK_COMPONENTS
20 jit
21 interpreter
22 nativecodegen
23 BitWriter
24 BitReader
25 AsmParser
26 Core
27 System
28 Support
29 )
30
31set(LLVM_USED_LIBS
32 gtest
33 gtest_main
34 )
35
36add_llvm_unittest(ADT
37 ADT/APFloatTest.cpp
38 ADT/APIntTest.cpp
39 ADT/BitVectorTest.cpp
40 ADT/DAGDeltaAlgorithmTest.cpp
41 ADT/DeltaAlgorithmTest.cpp
42 ADT/DenseMapTest.cpp
43 ADT/DenseSetTest.cpp
44 ADT/ilistTest.cpp
45 ADT/ImmutableSetTest.cpp
46 ADT/SmallBitVectorTest.cpp
47 ADT/SmallStringTest.cpp
48 ADT/SmallVectorTest.cpp
49 ADT/SparseBitVectorTest.cpp
50 ADT/StringMapTest.cpp
51 ADT/StringRefTest.cpp
52 ADT/TripleTest.cpp
53 ADT/TwineTest.cpp
Douglas Gregorc576d3d2010-09-27 16:40:43 +000054 )
Michael J. Spenceree6944f2010-09-24 09:01:13 +000055
56add_llvm_unittest(Analysis
57 Analysis/ScalarEvolutionTest.cpp
58 )
59
60add_llvm_unittest(ExecutionEngine
61 ExecutionEngine/ExecutionEngineTest.cpp
62 )
63
64add_llvm_unittest(JIT
65 ExecutionEngine/JIT/JITEventListenerTest.cpp
66 ExecutionEngine/JIT/JITMemoryManagerTest.cpp
67 ExecutionEngine/JIT/JITTest.cpp
68 ExecutionEngine/JIT/MultiJITTest.cpp
69 )
70
Michael J. Spencer12647eb2010-10-11 21:22:34 +000071add_llvm_unittest(Transforms
72 Transforms/Utils/Cloning.cpp
73 )
74
75add_llvm_unittest(VMCore
76 VMCore/ConstantsTest.cpp
77 VMCore/DerivedTypesTest.cpp
78 VMCore/InstructionsTest.cpp
79 VMCore/MetadataTest.cpp
80 VMCore/PassManagerTest.cpp
81 VMCore/VerifierTest.cpp
82 )
83
84set(LLVM_LINK_COMPONENTS
85 System
86 Support
87 Core
88 )
89
Michael J. Spenceree6944f2010-09-24 09:01:13 +000090add_llvm_unittest(Support
91 Support/AllocatorTest.cpp
92 Support/Casting.cpp
93 Support/CommandLineTest.cpp
94 Support/ConstantRangeTest.cpp
Michael J. Spencer5e0b2bf2010-10-21 20:28:21 +000095 Support/EndianTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +000096 Support/LeakDetectorTest.cpp
97 Support/MathExtrasTest.cpp
98 Support/raw_ostream_test.cpp
99 Support/RegexTest.cpp
Michael J. Spencer4c099b82010-10-11 21:56:16 +0000100 Support/SwapByteOrderTest.cpp
Michael J. Spencer5e0b2bf2010-10-21 20:28:21 +0000101 Support/System.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000102 Support/TypeBuilderTest.cpp
103 Support/ValueHandleTest.cpp
104 )