Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 1 | function(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 Fuentes | 066de85 | 2010-09-25 20:25:25 +0000 | [diff] [blame] | 12 | add_llvm_executable(${test_name}Tests ${ARGN}) |
Oscar Fuentes | da97563 | 2010-10-28 14:38:35 +0000 | [diff] [blame^] | 13 | add_dependencies(UnitTests ${test_name}Tests) |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 14 | endfunction() |
| 15 | |
Oscar Fuentes | da97563 | 2010-10-28 14:38:35 +0000 | [diff] [blame^] | 16 | add_custom_target(UnitTests) |
| 17 | |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 18 | include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) |
Michael J. Spencer | 8a806ae | 2010-10-19 18:04:19 +0000 | [diff] [blame] | 19 | set(LLVM_REQUIRES_RTTI 1) |
| 20 | add_definitions(-DGTEST_HAS_RTTI=0) |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 21 | |
| 22 | set(LLVM_LINK_COMPONENTS |
| 23 | jit |
| 24 | interpreter |
| 25 | nativecodegen |
| 26 | BitWriter |
| 27 | BitReader |
| 28 | AsmParser |
| 29 | Core |
| 30 | System |
| 31 | Support |
| 32 | ) |
| 33 | |
| 34 | set(LLVM_USED_LIBS |
| 35 | gtest |
| 36 | gtest_main |
| 37 | ) |
| 38 | |
| 39 | add_llvm_unittest(ADT |
| 40 | ADT/APFloatTest.cpp |
| 41 | ADT/APIntTest.cpp |
| 42 | ADT/BitVectorTest.cpp |
| 43 | ADT/DAGDeltaAlgorithmTest.cpp |
| 44 | ADT/DeltaAlgorithmTest.cpp |
| 45 | ADT/DenseMapTest.cpp |
| 46 | ADT/DenseSetTest.cpp |
| 47 | ADT/ilistTest.cpp |
| 48 | ADT/ImmutableSetTest.cpp |
| 49 | ADT/SmallBitVectorTest.cpp |
| 50 | ADT/SmallStringTest.cpp |
| 51 | ADT/SmallVectorTest.cpp |
| 52 | ADT/SparseBitVectorTest.cpp |
| 53 | ADT/StringMapTest.cpp |
| 54 | ADT/StringRefTest.cpp |
| 55 | ADT/TripleTest.cpp |
| 56 | ADT/TwineTest.cpp |
Douglas Gregor | c576d3d | 2010-09-27 16:40:43 +0000 | [diff] [blame] | 57 | ) |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 58 | |
| 59 | add_llvm_unittest(Analysis |
| 60 | Analysis/ScalarEvolutionTest.cpp |
| 61 | ) |
| 62 | |
| 63 | add_llvm_unittest(ExecutionEngine |
| 64 | ExecutionEngine/ExecutionEngineTest.cpp |
| 65 | ) |
| 66 | |
| 67 | add_llvm_unittest(JIT |
| 68 | ExecutionEngine/JIT/JITEventListenerTest.cpp |
| 69 | ExecutionEngine/JIT/JITMemoryManagerTest.cpp |
| 70 | ExecutionEngine/JIT/JITTest.cpp |
| 71 | ExecutionEngine/JIT/MultiJITTest.cpp |
| 72 | ) |
| 73 | |
Michael J. Spencer | 12647eb | 2010-10-11 21:22:34 +0000 | [diff] [blame] | 74 | add_llvm_unittest(Transforms |
| 75 | Transforms/Utils/Cloning.cpp |
| 76 | ) |
| 77 | |
| 78 | add_llvm_unittest(VMCore |
| 79 | VMCore/ConstantsTest.cpp |
| 80 | VMCore/DerivedTypesTest.cpp |
| 81 | VMCore/InstructionsTest.cpp |
| 82 | VMCore/MetadataTest.cpp |
| 83 | VMCore/PassManagerTest.cpp |
| 84 | VMCore/VerifierTest.cpp |
| 85 | ) |
| 86 | |
| 87 | set(LLVM_LINK_COMPONENTS |
| 88 | System |
| 89 | Support |
| 90 | Core |
| 91 | ) |
| 92 | |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 93 | add_llvm_unittest(Support |
| 94 | Support/AllocatorTest.cpp |
| 95 | Support/Casting.cpp |
| 96 | Support/CommandLineTest.cpp |
| 97 | Support/ConstantRangeTest.cpp |
Michael J. Spencer | 5e0b2bf | 2010-10-21 20:28:21 +0000 | [diff] [blame] | 98 | Support/EndianTest.cpp |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 99 | Support/LeakDetectorTest.cpp |
| 100 | Support/MathExtrasTest.cpp |
| 101 | Support/raw_ostream_test.cpp |
| 102 | Support/RegexTest.cpp |
Michael J. Spencer | 4c099b8 | 2010-10-11 21:56:16 +0000 | [diff] [blame] | 103 | Support/SwapByteOrderTest.cpp |
Michael J. Spencer | 5e0b2bf | 2010-10-21 20:28:21 +0000 | [diff] [blame] | 104 | Support/System.cpp |
Michael J. Spencer | ee6944f | 2010-09-24 09:01:13 +0000 | [diff] [blame] | 105 | Support/TypeBuilderTest.cpp |
| 106 | Support/ValueHandleTest.cpp |
| 107 | ) |