blob: 8a5a367794bd9977eafd253685987b617d2d36cb [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)
16
17set(LLVM_LINK_COMPONENTS
18 jit
19 interpreter
20 nativecodegen
21 BitWriter
22 BitReader
23 AsmParser
24 Core
25 System
26 Support
27 )
28
29set(LLVM_USED_LIBS
30 gtest
31 gtest_main
32 )
33
34add_llvm_unittest(ADT
35 ADT/APFloatTest.cpp
36 ADT/APIntTest.cpp
37 ADT/BitVectorTest.cpp
38 ADT/DAGDeltaAlgorithmTest.cpp
39 ADT/DeltaAlgorithmTest.cpp
40 ADT/DenseMapTest.cpp
41 ADT/DenseSetTest.cpp
42 ADT/ilistTest.cpp
43 ADT/ImmutableSetTest.cpp
44 ADT/SmallBitVectorTest.cpp
45 ADT/SmallStringTest.cpp
46 ADT/SmallVectorTest.cpp
47 ADT/SparseBitVectorTest.cpp
48 ADT/StringMapTest.cpp
49 ADT/StringRefTest.cpp
50 ADT/TripleTest.cpp
51 ADT/TwineTest.cpp
Douglas Gregorc576d3d2010-09-27 16:40:43 +000052 )
Michael J. Spenceree6944f2010-09-24 09:01:13 +000053
54add_llvm_unittest(Analysis
55 Analysis/ScalarEvolutionTest.cpp
56 )
57
58add_llvm_unittest(ExecutionEngine
59 ExecutionEngine/ExecutionEngineTest.cpp
60 )
61
62add_llvm_unittest(JIT
63 ExecutionEngine/JIT/JITEventListenerTest.cpp
64 ExecutionEngine/JIT/JITMemoryManagerTest.cpp
65 ExecutionEngine/JIT/JITTest.cpp
66 ExecutionEngine/JIT/MultiJITTest.cpp
67 )
68
Michael J. Spencer12647eb2010-10-11 21:22:34 +000069add_llvm_unittest(Transforms
70 Transforms/Utils/Cloning.cpp
71 )
72
73add_llvm_unittest(VMCore
74 VMCore/ConstantsTest.cpp
75 VMCore/DerivedTypesTest.cpp
76 VMCore/InstructionsTest.cpp
77 VMCore/MetadataTest.cpp
78 VMCore/PassManagerTest.cpp
79 VMCore/VerifierTest.cpp
80 )
81
82set(LLVM_LINK_COMPONENTS
83 System
84 Support
85 Core
86 )
87
Michael J. Spenceree6944f2010-09-24 09:01:13 +000088add_llvm_unittest(Support
89 Support/AllocatorTest.cpp
90 Support/Casting.cpp
91 Support/CommandLineTest.cpp
92 Support/ConstantRangeTest.cpp
93 Support/LeakDetectorTest.cpp
94 Support/MathExtrasTest.cpp
95 Support/raw_ostream_test.cpp
96 Support/RegexTest.cpp
97 Support/System.cpp
Michael J. Spencer4c099b82010-10-11 21:56:16 +000098 Support/SwapByteOrderTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +000099 Support/TypeBuilderTest.cpp
100 Support/ValueHandleTest.cpp
101 )