Skip to content

Commit 07c9cd1

Browse files
committed
[lldb][test] XcodeSDKModuleTests: remove non-deterministic source mapping checks
This assertion was added to check that `RegisterXcodeSDK` will correctly update the source mappings of the module. However, the source mapping will only get updated if the command-line invocation of `xcrun` succeeded. Even if `xcrun` failed to find an SDK, the source mappings would get an entry (see https://github.com/llvm/llvm-project/blob/f6212c1cd3d8b827c7d7e2f6cf54b135c27eacc6/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm#L424-L444). But if the shell invocation itself failed, then the mappings are not updated. This means depending on how slow `xcrun` is on a given host, this test may fail. On my machine this happens consistently in debug and release builds. This patch removes this flakey assertion. We unfortunately lost some test coverage here but I'm not sure there's great alternatives unless we either: 1. Mock the `xcrun` call somehow (we could maybe pass a callable around which defaults to `xcrun` in non-test code?) 2. Make a `xcrun` time-out not an error either? (cherry picked from commit 338c9a4)
1 parent 3a02857 commit 07c9cd1

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,8 @@ TEST_F(XcodeSDKModuleTests, TestModuleGetXcodeSDK) {
116116
SymbolFileDWARF &sym_file = dwarf_cu->GetSymbolFileDWARF();
117117
CompUnitSP comp_unit = sym_file.GetCompileUnitAtIndex(0);
118118
ASSERT_TRUE(static_cast<bool>(comp_unit.get()));
119-
ModuleSP module = t.GetModule();
120-
ASSERT_EQ(module->GetSourceMappingList().GetSize(), 0u);
121119
XcodeSDK sdk = sym_file.ParseXcodeSDK(*comp_unit);
122120
ASSERT_EQ(sdk.GetType(), XcodeSDK::Type::MacOSX);
123-
ASSERT_EQ(module->GetSourceMappingList().GetSize(), 1u);
124121
}
125122

126123
TEST_F(XcodeSDKModuleTests, TestSDKPathFromDebugInfo_InvalidSDKPath) {

0 commit comments

Comments
 (0)