Skip to content

Commit

Permalink
cmake + xcode: prevent gtests from using includes from project root
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tim Hammerquist committed Oct 3, 2017
1 parent 3696352 commit a6db416
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 37 deletions.
50 changes: 25 additions & 25 deletions lldb/lldb.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lldb/unittests/CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@ add_custom_target(LLDBUnitTests)
set_target_properties(LLDBUnitTests PROPERTIES FOLDER "LLDB tests")

include_directories(${LLDB_SOURCE_ROOT})
include_directories(${LLDB_PROJECT_ROOT})
include_directories(${LLDB_PROJECT_ROOT}/unittests)

set(LLDB_GTEST_COMMON_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/gtest_common.h)
if (MSVC)
Expand Down Expand Up @@ -59,6 +59,7 @@ function(add_unittest_inputs test_name inputs)
endforeach()
endfunction()

add_subdirectory(TestingSupport)
add_subdirectory(Breakpoint)
add_subdirectory(Core)
add_subdirectory(Editline)
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/Interpreter/TestCompletion.cpp
Expand Up @@ -12,7 +12,7 @@
#include "lldb/Utility/StringList.h"
#include "lldb/Utility/TildeExpressionResolver.h"

#include "unittests/Utility/Helpers/MockTildeExpressionResolver.h"
#include "TestingSupport/MockTildeExpressionResolver.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
Expand Up @@ -14,7 +14,7 @@
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/Section.h"
#include "lldb/Host/HostInfo.h"
#include "unittests/Utility/Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/Path.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/Process/minidump/MinidumpParserTest.cpp
Expand Up @@ -23,7 +23,7 @@
#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/FileSpec.h"
#include "unittests/Utility/Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/FileSystem.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
Expand Up @@ -16,7 +16,7 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/DWARFCallFrameInfo.h"
#include "lldb/Utility/StreamString.h"
#include "unittests/Utility/Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
Expand Up @@ -28,7 +28,7 @@
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Utility/FileSpec.h"
#include "unittests/Utility/Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"

using namespace lldb_private;

Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
Expand Up @@ -28,7 +28,7 @@
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Utility/FileSpec.h"
#include "unittests/Utility/Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"

#if defined(_MSC_VER)
#include "lldb/Host/windows/windows.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/Target/ModuleCacheTest.cpp
Expand Up @@ -10,7 +10,7 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/ModuleCache.h"
#include "unittests/Utility/Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"

using namespace lldb_private;
using namespace lldb;
Expand Down
2 changes: 0 additions & 2 deletions lldb/unittests/Utility/CMakeLists.txt
@@ -1,5 +1,3 @@
add_subdirectory(Helpers)

add_lldb_unittest(UtilityTests
ConstStringTest.cpp
JSONTest.cpp
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/Utility/StructuredDataTest.cpp
Expand Up @@ -9,7 +9,7 @@

#include "gtest/gtest.h"

#include "Helpers/TestUtilities.h"
#include "TestingSupport/TestUtilities.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StructuredData.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/unittests/Utility/TildeExpressionResolverTest.cpp
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "Helpers/MockTildeExpressionResolver.h"
#include "TestingSupport/MockTildeExpressionResolver.h"
#include "lldb/Utility/TildeExpressionResolver.h"

#include "llvm/ADT/SmallString.h"
Expand Down

0 comments on commit a6db416

Please sign in to comment.