forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
12 changed files
with
193 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
Support | ||
) | ||
|
||
add_llvm_unittest(ADTTests | ||
APFloatTest.cpp | ||
APIntTest.cpp | ||
BitVectorTest.cpp | ||
DAGDeltaAlgorithmTest.cpp | ||
DeltaAlgorithmTest.cpp | ||
DenseMapTest.cpp | ||
DenseSetTest.cpp | ||
FoldingSet.cpp | ||
HashingTest.cpp | ||
ilistTest.cpp | ||
ImmutableSetTest.cpp | ||
IntEqClassesTest.cpp | ||
IntervalMapTest.cpp | ||
IntrusiveRefCntPtrTest.cpp | ||
PackedVectorTest.cpp | ||
SCCIteratorTest.cpp | ||
SmallPtrSetTest.cpp | ||
SmallStringTest.cpp | ||
SmallVectorTest.cpp | ||
SparseBitVectorTest.cpp | ||
SparseSetTest.cpp | ||
StringMapTest.cpp | ||
StringRefTest.cpp | ||
TripleTest.cpp | ||
TwineTest.cpp | ||
VariadicFunctionTest.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
Analysis | ||
) | ||
|
||
add_llvm_unittest(AnalysisTests | ||
ScalarEvolutionTest.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
BitReader | ||
BitWriter | ||
) | ||
|
||
add_llvm_unittest(BitcodeTests | ||
BitReaderTest.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
jit | ||
interpreter | ||
nativecodegen | ||
) | ||
|
||
add_llvm_unittest(ExecutionEngineTests | ||
ExecutionEngineTest.cpp | ||
) | ||
|
||
add_subdirectory(JIT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
jit | ||
interpreter | ||
nativecodegen | ||
) | ||
|
||
# HACK: Declare a couple of source files as optionally compiled to satisfy the | ||
# missing-file-checker in LLVM's weird CMake build. | ||
set(LLVM_OPTIONAL_SOURCES | ||
IntelJITEventListenerTest.cpp | ||
OProfileJITEventListenerTest.cpp | ||
) | ||
|
||
if( LLVM_USE_INTEL_JITEVENTS ) | ||
include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} ) | ||
link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} ) | ||
set(ProfileTestSources | ||
IntelJITEventListenerTest.cpp | ||
) | ||
set(LLVM_LINK_COMPONENTS | ||
${LLVM_LINK_COMPONENTS} | ||
IntelJITEvents | ||
) | ||
endif( LLVM_USE_INTEL_JITEVENTS ) | ||
|
||
if( LLVM_USE_OPROFILE ) | ||
set(ProfileTestSources | ||
${ProfileTestSources} | ||
OProfileJITEventListenerTest.cpp | ||
) | ||
set(LLVM_LINK_COMPONENTS | ||
${LLVM_LINK_COMPONENTS} | ||
OProfileJIT | ||
) | ||
endif( LLVM_USE_OPROFILE ) | ||
|
||
set(JITTestsSources | ||
JITEventListenerTest.cpp | ||
JITMemoryManagerTest.cpp | ||
JITTest.cpp | ||
MultiJITTest.cpp | ||
${ProfileTestSources} | ||
) | ||
|
||
if(MSVC) | ||
list(APPEND JITTestsSources JITTests.def) | ||
endif() | ||
|
||
add_llvm_unittest(ExecutionEngine/JITTests | ||
${JITTestsSources} | ||
) | ||
|
||
if(MINGW OR CYGWIN) | ||
set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
Support | ||
Core | ||
) | ||
|
||
add_llvm_unittest(SupportTests | ||
AlignOfTest.cpp | ||
AllocatorTest.cpp | ||
BlockFrequencyTest.cpp | ||
Casting.cpp | ||
CommandLineTest.cpp | ||
ConstantRangeTest.cpp | ||
DataExtractorTest.cpp | ||
EndianTest.cpp | ||
IntegersSubsetTest.cpp | ||
IRBuilderTest.cpp | ||
LeakDetectorTest.cpp | ||
ManagedStatic.cpp | ||
MathExtrasTest.cpp | ||
MDBuilderTest.cpp | ||
Path.cpp | ||
raw_ostream_test.cpp | ||
RegexTest.cpp | ||
SwapByteOrderTest.cpp | ||
TimeValue.cpp | ||
TypeBuilderTest.cpp | ||
ValueHandleTest.cpp | ||
YAMLParserTest.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(Utils) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
TransformUtils | ||
) | ||
|
||
add_llvm_unittest(UtilsTests | ||
Cloning.cpp | ||
Local.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
asmparser | ||
analysis | ||
core | ||
ipa | ||
target | ||
) | ||
|
||
set(VMCoreSources | ||
ConstantsTest.cpp | ||
DominatorTreeTest.cpp | ||
InstructionsTest.cpp | ||
MetadataTest.cpp | ||
PassManagerTest.cpp | ||
ValueMapTest.cpp | ||
VerifierTest.cpp | ||
) | ||
|
||
# MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug. | ||
# See issue#331418 in Visual Studio. | ||
if(MSVC AND MSVC_VERSION LESS 1600) | ||
list(REMOVE_ITEM VMCoreSources ValueMapTest.cpp) | ||
endif() | ||
|
||
add_llvm_unittest(VMCoreTests | ||
${VMCoreSources} | ||
) |