Skip to content

Commit a6db416

Browse files
author
Tim Hammerquist
committed
cmake + xcode: prevent gtests from using includes from project root
Summary: At present, several gtests in the lldb open source codebase are using #include statements rooted at $(SOURCE_ROOT)/${LLDB_PROJECT_ROOT}. This patch cleans up this directory/include structure for both CMake and Xcode build systems. rdar://problem/33835795 Reviewers: zturner, jingham, beanz Reviewed By: beanz Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D36598 llvm-svn: 314849
1 parent 3696352 commit a6db416

17 files changed

+36
-37
lines changed

lldb/lldb.xcodeproj/project.pbxproj

Lines changed: 25 additions & 25 deletions
Large diffs are not rendered by default.

lldb/unittests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ add_custom_target(LLDBUnitTests)
22
set_target_properties(LLDBUnitTests PROPERTIES FOLDER "LLDB tests")
33

44
include_directories(${LLDB_SOURCE_ROOT})
5-
include_directories(${LLDB_PROJECT_ROOT})
5+
include_directories(${LLDB_PROJECT_ROOT}/unittests)
66

77
set(LLDB_GTEST_COMMON_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/gtest_common.h)
88
if (MSVC)
@@ -59,6 +59,7 @@ function(add_unittest_inputs test_name inputs)
5959
endforeach()
6060
endfunction()
6161

62+
add_subdirectory(TestingSupport)
6263
add_subdirectory(Breakpoint)
6364
add_subdirectory(Core)
6465
add_subdirectory(Editline)

lldb/unittests/Interpreter/TestCompletion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "lldb/Utility/StringList.h"
1313
#include "lldb/Utility/TildeExpressionResolver.h"
1414

15-
#include "unittests/Utility/Helpers/MockTildeExpressionResolver.h"
15+
#include "TestingSupport/MockTildeExpressionResolver.h"
1616
#include "llvm/ADT/SmallString.h"
1717
#include "llvm/Support/FileSystem.h"
1818
#include "llvm/Support/Path.h"

lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "lldb/Core/ModuleSpec.h"
1515
#include "lldb/Core/Section.h"
1616
#include "lldb/Host/HostInfo.h"
17-
#include "unittests/Utility/Helpers/TestUtilities.h"
17+
#include "TestingSupport/TestUtilities.h"
1818
#include "llvm/ADT/Optional.h"
1919
#include "llvm/Support/FileUtilities.h"
2020
#include "llvm/Support/Path.h"

lldb/unittests/Process/minidump/MinidumpParserTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "lldb/Utility/DataBufferLLVM.h"
2424
#include "lldb/Utility/DataExtractor.h"
2525
#include "lldb/Utility/FileSpec.h"
26-
#include "unittests/Utility/Helpers/TestUtilities.h"
26+
#include "TestingSupport/TestUtilities.h"
2727
#include "llvm/ADT/ArrayRef.h"
2828
#include "llvm/ADT/Optional.h"
2929
#include "llvm/Support/FileSystem.h"

lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "lldb/Host/HostInfo.h"
1717
#include "lldb/Symbol/DWARFCallFrameInfo.h"
1818
#include "lldb/Utility/StreamString.h"
19-
#include "unittests/Utility/Helpers/TestUtilities.h"
19+
#include "TestingSupport/TestUtilities.h"
2020
#include "llvm/Support/FileUtilities.h"
2121
#include "llvm/Support/Path.h"
2222
#include "llvm/Support/Program.h"

lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "lldb/Symbol/LineTable.h"
2929
#include "lldb/Symbol/SymbolVendor.h"
3030
#include "lldb/Utility/FileSpec.h"
31-
#include "unittests/Utility/Helpers/TestUtilities.h"
31+
#include "TestingSupport/TestUtilities.h"
3232

3333
using namespace lldb_private;
3434

lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "lldb/Symbol/LineTable.h"
2929
#include "lldb/Symbol/SymbolVendor.h"
3030
#include "lldb/Utility/FileSpec.h"
31-
#include "unittests/Utility/Helpers/TestUtilities.h"
31+
#include "TestingSupport/TestUtilities.h"
3232

3333
#if defined(_MSC_VER)
3434
#include "lldb/Host/windows/windows.h"

lldb/unittests/Target/ModuleCacheTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "lldb/Host/HostInfo.h"
1111
#include "lldb/Symbol/SymbolContext.h"
1212
#include "lldb/Target/ModuleCache.h"
13-
#include "unittests/Utility/Helpers/TestUtilities.h"
13+
#include "TestingSupport/TestUtilities.h"
1414

1515
using namespace lldb_private;
1616
using namespace lldb;

lldb/unittests/Utility/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
add_subdirectory(Helpers)
2-
31
add_lldb_unittest(UtilityTests
42
ConstStringTest.cpp
53
JSONTest.cpp

lldb/unittests/Utility/StructuredDataTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "gtest/gtest.h"
1111

12-
#include "Helpers/TestUtilities.h"
12+
#include "TestingSupport/TestUtilities.h"
1313
#include "lldb/Utility/Status.h"
1414
#include "lldb/Utility/StreamString.h"
1515
#include "lldb/Utility/StructuredData.h"

lldb/unittests/Utility/TildeExpressionResolverTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "gtest/gtest.h"
22

3-
#include "Helpers/MockTildeExpressionResolver.h"
3+
#include "TestingSupport/MockTildeExpressionResolver.h"
44
#include "lldb/Utility/TildeExpressionResolver.h"
55

66
#include "llvm/ADT/SmallString.h"

0 commit comments

Comments
 (0)