Skip to content

Commit 014c41d

Browse files
author
Walter Erquinigo
committed
[LLDB] Attempt to fix DumpDataExtractorTest
This test was broken by 710276a because DumpDataExtractor now accesses the Target properties, which someone ends up relying on the file system. This is an instance of this error https://lab.llvm.org/buildbot/#/builders/96/builds/45607/steps/6/logs/stdio I cannot reproduce this locally, but it seems that the error happens because we are not initializing the FileSystem and the Host as part of the test setup.
1 parent 7bac0bc commit 014c41d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lldb/unittests/Core/DumpDataExtractorTest.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "lldb/Core/DumpDataExtractor.h"
10+
#include "lldb/Host/FileSystem.h"
11+
#include "lldb/Host/HostInfo.h"
1012
#include "lldb/Utility/DataBufferHeap.h"
1113
#include "lldb/Utility/DataExtractor.h"
1214
#include "lldb/Utility/Endian.h"
@@ -18,6 +20,20 @@
1820
using namespace lldb;
1921
using namespace lldb_private;
2022

23+
// This is needed for the tests because they rely on the Target global
24+
// properties.
25+
class DumpDataExtractorTest : public ::testing::Test {
26+
public:
27+
void SetUp() override {
28+
FileSystem::Initialize();
29+
HostInfo::Initialize();
30+
}
31+
void TearDown() override {
32+
HostInfo::Terminate();
33+
FileSystem::Terminate();
34+
}
35+
};
36+
2137
static void TestDumpWithAddress(uint64_t base_addr, size_t item_count,
2238
llvm::StringRef expected) {
2339
std::vector<uint8_t> data{0x11, 0x22};

0 commit comments

Comments
 (0)