[Lldb-commits] [PATCH] D32548: Xfail data formatter test cases
penryu abandoned this revision. penryu added a comment. Lang's change in https://reviews.llvm.org/D32554 makes these unnecessary. Thanks, Lang! https://reviews.llvm.org/D32548 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35036: switch on enum should be exhaustive and warning-free
penryu created this revision. Testing the value of type_code against the closed enum TypeCodes provides statically verifiable completeness of testing. However, one branch assigns to type_code by casting directly from a masked integer value. This is currently handled by adding a default: case after checking each TypeCodes instance. This patch introduces a bool variable containing the "default" state value, allowing the switch to be exhaustive, protect against future instances not being handled in the switch, and preserves the original logic. As an issue of maintainability, the bitmask on line 524 handles the current values of TypeCodes enum, but this will be invalid if the enum is extended. This patch does not address this, and a more closed conversion from cfinfoa -> TypeCodes would help protect against this. https://reviews.llvm.org/D35036 Files: source/Plugins/Language/ObjC/Cocoa.cpp Index: source/Plugins/Language/ObjC/Cocoa.cpp === --- source/Plugins/Language/ObjC/Cocoa.cpp +++ source/Plugins/Language/ObjC/Cocoa.cpp @@ -543,35 +543,40 @@ } uint64_t value = 0; + bool success = false; switch (type_code) { case TypeCodes::sint8: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 1, 0, error); if (error.Fail()) return false; NSNumber_FormatChar(valobj, stream, (char)value, options.GetLanguage()); +success = true; break; case TypeCodes::sint16: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 2, 0, error); if (error.Fail()) return false; NSNumber_FormatShort(valobj, stream, (short)value, options.GetLanguage()); +success = true; break; case TypeCodes::sint32: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 4, 0, error); if (error.Fail()) return false; NSNumber_FormatInt(valobj, stream, (int)value, options.GetLanguage()); +success = true; break; case TypeCodes::sint64: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 8, 0, error); if (error.Fail()) return false; NSNumber_FormatLong(valobj, stream, value, options.GetLanguage()); +success = true; break; case TypeCodes::f32: { @@ -582,6 +587,7 @@ float flt_value = 0.0f; memcpy(&flt_value, &flt_as_int, sizeof(flt_as_int)); NSNumber_FormatFloat(valobj, stream, flt_value, options.GetLanguage()); +success = true; break; } case TypeCodes::f64: @@ -593,6 +599,7 @@ double dbl_value = 0.0; memcpy(&dbl_value, &dbl_as_lng, sizeof(dbl_as_lng)); NSNumber_FormatDouble(valobj, stream, dbl_value, options.GetLanguage()); +success = true; break; } case TypeCodes::sint128: // internally, this is the same @@ -608,12 +615,11 @@ return false; llvm::APInt i128_value(128, words); NSNumber_FormatInt128(valobj, stream, i128_value, options.GetLanguage()); +success = true; break; } - default: -return false; } - return true; + return success; } } Index: source/Plugins/Language/ObjC/Cocoa.cpp === --- source/Plugins/Language/ObjC/Cocoa.cpp +++ source/Plugins/Language/ObjC/Cocoa.cpp @@ -543,35 +543,40 @@ } uint64_t value = 0; + bool success = false; switch (type_code) { case TypeCodes::sint8: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 1, 0, error); if (error.Fail()) return false; NSNumber_FormatChar(valobj, stream, (char)value, options.GetLanguage()); +success = true; break; case TypeCodes::sint16: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 2, 0, error); if (error.Fail()) return false; NSNumber_FormatShort(valobj, stream, (short)value, options.GetLanguage()); +success = true; break; case TypeCodes::sint32: value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 4, 0, error); if (error.Fail()) return false; NSNumber_FormatInt(valobj, stream, (int)value, options.GetLanguage())
[Lldb-commits] [PATCH] D35036: switch on enum should be exhaustive and warning-free
penryu added a comment. Thanks, sas. I'll be honest, my prefer solution involves an inlined function (uint64_t -> TypeCodes) that eliminates the cast from the NSNumberSummaryProvider() method altogether. This way we can handle any dirty mappings from raw memory directory to the enum within the one function, and take advantage of the compiler's exhaustiveness check to ensure we're covering our bases. I'll ponder a bit and consider reworking this patch in that form. https://reviews.llvm.org/D35036 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D35036: switch on enum should be exhaustive and warning-free
penryu requested review of this revision. penryu added a comment. This revision is now accepted and ready to land. I need to learn more about the number formatters before I make more significant changes than those below. As written currently, it leaves the logic intact and resolves the warning. One step closer to warning-free LLDB! https://reviews.llvm.org/D35036 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36485: Add existing unit tests to Xcode project
penryu created this revision. This adds gtest test files to the Xcode project which were previously only in the cmake config. This is the first of several planned merges. https://reviews.llvm.org/D36485 Files: lldb.xcodeproj/project.pbxproj Index: lldb.xcodeproj/project.pbxproj === --- lldb.xcodeproj/project.pbxproj +++ lldb.xcodeproj/project.pbxproj @@ -885,6 +885,18 @@ 9A3576AA116E9AC700E8ED2F /* SBHostOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */; }; 9A36D24D1EB3BE7F00AAD9EA /* SBTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1E59581EB2B10D002206A5 /* SBTrace.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9A36D24E1EB3BE7F00AAD9EA /* SBTraceOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1E59591EB2B10D002206A5 /* SBTraceOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9A3D43D61F3151C400EB767C /* ConstStringTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */; }; + 9A3D43D71F3151C400EB767C /* LogTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C71F3150D200EB767C /* LogTest.cpp */; }; + 9A3D43D81F3151C400EB767C /* NameMatchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CB1F3150D200EB767C /* NameMatchesTest.cpp */; }; + 9A3D43D91F3151C400EB767C /* StatusTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C61F3150D200EB767C /* StatusTest.cpp */; }; + 9A3D43DA1F3151C400EB767C /* StructuredDataTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CA1F3150D200EB767C /* StructuredDataTest.cpp */; }; + 9A3D43DB1F3151C400EB767C /* TildeExpressionResolverTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C91F3150D200EB767C /* TildeExpressionResolverTest.cpp */; }; + 9A3D43DC1F3151C400EB767C /* TimeoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CC1F3150D200EB767C /* TimeoutTest.cpp */; }; + 9A3D43DD1F3151C400EB767C /* TimerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C51F3150D200EB767C /* TimerTest.cpp */; }; + 9A3D43EC1F3237F900EB767C /* ListenerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E31F3237D500EB767C /* ListenerTest.cpp */; }; + 9A3D43ED1F3237F900EB767C /* StateTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E21F3237D500EB767C /* StateTest.cpp */; }; + 9A3D43EE1F3237F900EB767C /* StreamCallbackTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E11F3237D500EB767C /* StreamCallbackTest.cpp */; }; + 9A3D43F01F32380D00EB767C /* debugserver in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A3D43EF1F32380D00EB767C /* debugserver */; }; 9A4F35101368A51A00823F52 /* StreamAsynchronousIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4F350F1368A51A00823F52 /* StreamAsynchronousIO.cpp */; }; 9A77AD541E64E2760025CE04 /* RegisterInfoPOSIX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A77AD501E64E24E0025CE04 /* RegisterInfoPOSIX_arm.cpp */; }; 9AC7038E117674FB0086C050 /* SBInstruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038D117674EB0086C050 /* SBInstruction.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1200,6 +1212,7 @@ dstSubfolderSpec = 0; files = ( AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */, +9A3D43F01F32380D00EB767C /* debugserver in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; }; @@ -2843,6 +2856,20 @@ 9A357672116E7B6400E8ED2F /* SBStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStringList.cpp; path = source/API/SBStringList.cpp; sourceTree = ""; }; 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBHostOS.h; path = include/lldb/API/SBHostOS.h; sourceTree = ""; }; 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBHostOS.cpp; path = source/API/SBHostOS.cpp; sourceTree = ""; }; + 9A3D43C41F3150D200EB767C /* VASprintfTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VASprintfTest.cpp; sourceTree = ""; }; + 9A3D43C51F3150D200EB767C /* TimerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimerTest.cpp; sourceTree = ""; }; + 9A3D43C61F3150D200EB767C /* StatusTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatusTest.cpp; sourceTree = ""; }; + 9A3D43C71F3150D200EB767C /* LogTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogTest.cpp; sourceTree = ""; }; + 9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstStringT
[Lldb-commits] [PATCH] D36485: Add existing unit tests to Xcode project
penryu added a comment. Note that VASprintfTest.cpp is added to the xcodeproj but not added to the lldb-gtest-build target _YET_. It needs some work before I can enable it. https://reviews.llvm.org/D36485 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36485: Add existing unit tests to Xcode project
penryu edited reviewers, added: spyffe, jingham; removed: zturner, labath. penryu added a comment. This is really an Xcode-only change. https://reviews.llvm.org/D36485 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36485: Add existing unit tests to Xcode project
penryu added a comment. Committing 'https://reviews.llvm.org/D36485: Add existing unit tests to Xcode project'... Sendinglldb.xcodeproj/project.pbxproj Transmitting file data .done Committing transaction... Committed revision 310417. Closing revision https://reviews.llvm.org/D36485 'Add existing unit tests to Xcode project'... Done. https://reviews.llvm.org/D36485 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36496: Fix VASprintfTest.cpp for Darwin, add checks
penryu created this revision. The EncodingError test ensures that trying to encode a multibyte wchar with a given codepage fails. If setlocale() fails, the encoding is performed using the current locale, which may or may not fail. This patch asserts that both setlocale() operations are successful, as well as falling back to a widely available unibyte encoding for non-Windows systems. rdar://problem/33782806 https://reviews.llvm.org/D36496 Files: lldb.xcodeproj/project.pbxproj unittests/Utility/VASprintfTest.cpp Index: unittests/Utility/VASprintfTest.cpp === --- unittests/Utility/VASprintfTest.cpp +++ unittests/Utility/VASprintfTest.cpp @@ -14,6 +14,12 @@ #include +#if defined (_WIN32) +#define TEST_ENCODING ".932" // On Windows, test codepage 932 +#else +#define TEST_ENCODING "C" // ...otherwise, any widely available uni-byte LC +#endif + using namespace lldb_private; using namespace llvm; @@ -46,14 +52,16 @@ // Save the current locale first. std::string Current(::setlocale(LC_ALL, nullptr)); - setlocale(LC_ALL, ".932"); + // Ensure tested locale is successfully set + ASSERT_TRUE(setlocale(LC_ALL, TEST_ENCODING)); wchar_t Invalid[2]; Invalid[0] = 0x100; Invalid[1] = 0; llvm::SmallString<32> Buffer; EXPECT_FALSE(Sprintf(Buffer, "%ls", Invalid)); EXPECT_EQ("", Buffer); - setlocale(LC_ALL, Current.c_str()); + // Ensure we've restored the original locale once tested + ASSERT_TRUE(setlocale(LC_ALL, Current.c_str())); } Index: lldb.xcodeproj/project.pbxproj === --- lldb.xcodeproj/project.pbxproj +++ lldb.xcodeproj/project.pbxproj @@ -875,6 +875,7 @@ 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; }; 9A1E595C1EB2B141002206A5 /* SBTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */; }; 9A1E595D1EB2B141002206A5 /* SBTraceOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59531EB2B0B9002206A5 /* SBTraceOptions.cpp */; }; + 9A2057031F3A605200F6C293 /* VASprintfTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C41F3150D200EB767C /* VASprintfTest.cpp */; }; 9A22A161135E30370024DDC3 /* EmulateInstructionARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15D135E30370024DDC3 /* EmulateInstructionARM.cpp */; }; 9A22A163135E30370024DDC3 /* EmulationStateARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15F135E30370024DDC3 /* EmulationStateARM.cpp */; }; 9A357583116CFDEE00E8ED2F /* SBValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A357582116CFDEE00E8ED2F /* SBValueList.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -7092,6 +7093,7 @@ AFEC5FD81D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp in Sources */, 23CB15401D66DA9300EDDDE1 /* TestClangASTContext.cpp in Sources */, 23CB15411D66DA9300EDDDE1 /* StringExtractorTest.cpp in Sources */, + 9A2057031F3A605200F6C293 /* VASprintfTest.cpp in Sources */, 23CB15421D66DA9300EDDDE1 /* TaskPoolTest.cpp in Sources */, 23CB15431D66DA9300EDDDE1 /* BroadcasterTest.cpp in Sources */, 9A3D43EE1F3237F900EB767C /* StreamCallbackTest.cpp in Sources */, Index: unittests/Utility/VASprintfTest.cpp === --- unittests/Utility/VASprintfTest.cpp +++ unittests/Utility/VASprintfTest.cpp @@ -14,6 +14,12 @@ #include +#if defined (_WIN32) +#define TEST_ENCODING ".932" // On Windows, test codepage 932 +#else +#define TEST_ENCODING "C" // ...otherwise, any widely available uni-byte LC +#endif + using namespace lldb_private; using namespace llvm; @@ -46,14 +52,16 @@ // Save the current locale first. std::string Current(::setlocale(LC_ALL, nullptr)); - setlocale(LC_ALL, ".932"); + // Ensure tested locale is successfully set + ASSERT_TRUE(setlocale(LC_ALL, TEST_ENCODING)); wchar_t Invalid[2]; Invalid[0] = 0x100; Invalid[1] = 0; llvm::SmallString<32> Buffer; EXPECT_FALSE(Sprintf(Buffer, "%ls", Invalid)); EXPECT_EQ("", Buffer); - setlocale(LC_ALL, Current.c_str()); + // Ensure we've restored the original locale once tested + ASSERT_TRUE(setlocale(LC_ALL, Current.c_str())); } Index: lldb.xcodeproj/project.pbxproj === --- lldb.xcodeproj/project.pbxproj +++ lldb.xcodeproj/project.pbxproj @@ -875,6 +875,7 @@ 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB98
[Lldb-commits] [PATCH] D36496: Fix VASprintfTest.cpp for Darwin, add checks
penryu added a comment. I'd prototyped this as simply prepending "DISABLED_" for non-Windows, but as this was designed as a temporary measure, I decided to ensure the same behavior was tested on Windows, and similar/equivalent behavior tested on other platforms. https://reviews.llvm.org/D36496 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36496: Fix VASprintfTest.cpp for Darwin, add checks
penryu added a comment. Committed revision 310499. Closing revision https://reviews.llvm.org/D36496 'Fix VASprintfTest.cpp for Darwin, add checks'... https://reviews.llvm.org/D36496 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36598: Prevent gtests from using includes from project root
penryu created this revision. Herald added subscribers: mgorny, emaste. 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 https://reviews.llvm.org/D36598 Files: lldb.xcodeproj/project.pbxproj unittests/CMakeLists.txt unittests/Interpreter/TestCompletion.cpp unittests/ObjectFile/ELF/TestObjectFileELF.cpp unittests/Process/minidump/MinidumpParserTest.cpp unittests/Symbol/TestDWARFCallFrameInfo.cpp unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp unittests/Target/ModuleCacheTest.cpp Index: unittests/Target/ModuleCacheTest.cpp === --- unittests/Target/ModuleCacheTest.cpp +++ unittests/Target/ModuleCacheTest.cpp @@ -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 "Utility/Helpers/TestUtilities.h" using namespace lldb_private; using namespace lldb; Index: unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp === --- unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp +++ unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp @@ -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 "Utility/Helpers/TestUtilities.h" using namespace lldb_private; Index: unittests/Symbol/TestDWARFCallFrameInfo.cpp === --- unittests/Symbol/TestDWARFCallFrameInfo.cpp +++ unittests/Symbol/TestDWARFCallFrameInfo.cpp @@ -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 "Utility/Helpers/TestUtilities.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" Index: unittests/Process/minidump/MinidumpParserTest.cpp === --- unittests/Process/minidump/MinidumpParserTest.cpp +++ unittests/Process/minidump/MinidumpParserTest.cpp @@ -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 "Utility/Helpers/TestUtilities.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/FileSystem.h" Index: unittests/ObjectFile/ELF/TestObjectFileELF.cpp === --- unittests/ObjectFile/ELF/TestObjectFileELF.cpp +++ unittests/ObjectFile/ELF/TestObjectFileELF.cpp @@ -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 "Utility/Helpers/TestUtilities.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" Index: unittests/Interpreter/TestCompletion.cpp === --- unittests/Interpreter/TestCompletion.cpp +++ unittests/Interpreter/TestCompletion.cpp @@ -12,7 +12,7 @@ #include "lldb/Utility/StringList.h" #include "lldb/Utility/TildeExpressionResolver.h" -#include "unittests/Utility/Helpers/MockTildeExpressionResolver.h" +#include "Utility/Helpers/MockTildeExpressionResolver.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" Index: unittests/CMakeLists.txt === --- unittests/CMakeLists.txt +++ unittests/CMakeLists.txt @@ -2,7 +2,7 @@ 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) Index: lldb.xcodeproj/project.pbxproj === --- lldb.xcodeproj/project.pbxproj +++ lldb.xcodeproj/project.pbxproj @@ -8456,7 +8456,7 @@ "$(LLVM_SOURCE_DIR)/tools/clang/include", "$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include", ); -LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers"; +LLD
[Lldb-commits] [PATCH] D36598: cmake + xcode: prevent gtests from using includes from project root
penryu added a comment. Note that these changes were tested on Darwin with both cmake and xcode. https://reviews.llvm.org/D36598 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D36598: cmake + xcode: prevent gtests from using includes from project root
penryu updated this revision to Diff 112052. penryu added a comment. This patch limits the above include dir to unittests/, and renamed some headers to reduce ambiguity about their purpose, as suggested by beanz. https://reviews.llvm.org/D36598 Files: lldb.xcodeproj/project.pbxproj unittests/CMakeLists.txt unittests/Interpreter/TestCompletion.cpp unittests/ObjectFile/ELF/TestObjectFileELF.cpp unittests/Process/minidump/MinidumpParserTest.cpp unittests/Symbol/TestDWARFCallFrameInfo.cpp unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp unittests/Target/ModuleCacheTest.cpp unittests/TestingSupport/CMakeLists.txt unittests/TestingSupport/MockTildeExpressionResolver.cpp unittests/TestingSupport/MockTildeExpressionResolver.h unittests/TestingSupport/TestUtilities.cpp unittests/TestingSupport/TestUtilities.h unittests/Utility/CMakeLists.txt unittests/Utility/Helpers/CMakeLists.txt unittests/Utility/Helpers/MockTildeExpressionResolver.cpp unittests/Utility/Helpers/MockTildeExpressionResolver.h unittests/Utility/Helpers/TestUtilities.cpp unittests/Utility/Helpers/TestUtilities.h unittests/Utility/StructuredDataTest.cpp unittests/Utility/TildeExpressionResolverTest.cpp Index: unittests/Utility/TildeExpressionResolverTest.cpp === --- unittests/Utility/TildeExpressionResolverTest.cpp +++ 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" Index: unittests/Utility/StructuredDataTest.cpp === --- unittests/Utility/StructuredDataTest.cpp +++ unittests/Utility/StructuredDataTest.cpp @@ -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" Index: unittests/Utility/CMakeLists.txt === --- unittests/Utility/CMakeLists.txt +++ unittests/Utility/CMakeLists.txt @@ -1,5 +1,3 @@ -add_subdirectory(Helpers) - add_lldb_unittest(UtilityTests ConstStringTest.cpp LogTest.cpp Index: unittests/Target/ModuleCacheTest.cpp === --- unittests/Target/ModuleCacheTest.cpp +++ unittests/Target/ModuleCacheTest.cpp @@ -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; Index: unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp === --- unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp +++ unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp @@ -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" Index: unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp === --- unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp +++ unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp @@ -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; Index: unittests/Symbol/TestDWARFCallFrameInfo.cpp === --- unittests/Symbol/TestDWARFCallFrameInfo.cpp +++ unittests/Symbol/TestDWARFCallFrameInfo.cpp @@ -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" Index: unittests/Process/minidump/MinidumpParserTest.cpp === --- unittests/Process/minidump/MinidumpParserTest.cpp +++ unittests/Process/minidump/MinidumpParserTest.cpp @@ -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/TestU
[Lldb-commits] [PATCH] D36598: cmake + xcode: prevent gtests from using includes from project root
This revision was automatically updated to reflect the committed changes. Closed by commit rL314849: cmake + xcode: prevent gtests from using includes from project root (authored by penryu). Changed prior to commit: https://reviews.llvm.org/D36598?vs=112052&id=117587#toc Repository: rL LLVM https://reviews.llvm.org/D36598 Files: lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/unittests/CMakeLists.txt lldb/trunk/unittests/Interpreter/TestCompletion.cpp lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp lldb/trunk/unittests/Target/ModuleCacheTest.cpp lldb/trunk/unittests/TestingSupport/CMakeLists.txt lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.cpp lldb/trunk/unittests/TestingSupport/MockTildeExpressionResolver.h lldb/trunk/unittests/TestingSupport/TestUtilities.cpp lldb/trunk/unittests/TestingSupport/TestUtilities.h lldb/trunk/unittests/Utility/CMakeLists.txt lldb/trunk/unittests/Utility/Helpers/CMakeLists.txt lldb/trunk/unittests/Utility/Helpers/MockTildeExpressionResolver.cpp lldb/trunk/unittests/Utility/Helpers/MockTildeExpressionResolver.h lldb/trunk/unittests/Utility/Helpers/TestUtilities.cpp lldb/trunk/unittests/Utility/Helpers/TestUtilities.h lldb/trunk/unittests/Utility/StructuredDataTest.cpp lldb/trunk/unittests/Utility/TildeExpressionResolverTest.cpp Index: lldb/trunk/lldb.xcodeproj/project.pbxproj === --- lldb/trunk/lldb.xcodeproj/project.pbxproj +++ lldb/trunk/lldb.xcodeproj/project.pbxproj @@ -876,8 +876,8 @@ 966C6B7C18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; }; 9694FA711B32AA64005EBB16 /* ABISysV_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */; }; 9A0FDEA71E8EF5110086B2F5 /* RegisterContextLinux_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */; }; - 9A1542F91F0EE48600DEA1D8 /* MockTildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */; }; - 9A1542FA1F0EE48600DEA1D8 /* TestUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */; }; + 9A18903B1F47D5E600394BCA /* MockTildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1890321F47D5D400394BCA /* MockTildeExpressionResolver.cpp */; }; + 9A18903C1F47D5E600394BCA /* TestUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1890341F47D5D400394BCA /* TestUtilities.cpp */; }; 9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; }; 9A1E595C1EB2B141002206A5 /* SBTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */; }; @@ -2864,11 +2864,11 @@ 9A0FDE991E8EF5010086B2F5 /* RegisterInfos_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm.h; path = Utility/RegisterInfos_arm.h; sourceTree = ""; }; 9A0FDE9A1E8EF5010086B2F5 /* RegisterInfos_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm64.h; path = Utility/RegisterInfos_arm64.h; sourceTree = ""; }; 9A0FDE9B1E8EF5010086B2F5 /* RegisterInfos_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips.h; path = Utility/RegisterInfos_mips.h; sourceTree = ""; }; - 9A1542F41F0EE44000DEA1D8 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; - 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockTildeExpressionResolver.cpp; sourceTree = ""; }; - 9A1542F61F0EE44000DEA1D8 /* MockTildeExpressionResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockTildeExpressionResolver.h; sourceTree = ""; }; - 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestUtilities.cpp; sourceTree = ""; }; - 9A1542F81F0EE44000DEA1D8 /* TestUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestUtilities.h; sourceTree = ""; }; + 9A1890311F47D5D400394BCA /* CMakeLists.txt */ = {isa = PBXFileReference;