[lldb] Initialize reproducers in LocateSymbolFileTest

Since a842950b62 this test started using
the reproducer subsystem but we never initialized it in the test. The
Subsystem takes an argument, so we can't use the usual SubsystemRAII at the
moment to do this for us.

This just adds the initialize/terminate calls to get the test passing again.
This commit is contained in:
Raphael Isemann 2020-08-25 20:25:15 +02:00
parent 7de7fe5d0e
commit ef76686916

View file

@ -14,6 +14,7 @@
#include "lldb/Host/HostInfo.h" #include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/LocateSymbolFile.h" #include "lldb/Symbol/LocateSymbolFile.h"
#include "lldb/Target/Target.h" #include "lldb/Target/Target.h"
#include "lldb/Utility/Reproducer.h"
using namespace lldb_private; using namespace lldb_private;
@ -27,15 +28,22 @@ public:
TEST_F( TEST_F(
SymbolsTest, SymbolsTest,
TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) { TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) {
EXPECT_THAT_ERROR(
repro::Reproducer::Initialize(repro::ReproducerMode::Off, llvm::None),
llvm::Succeeded());
ModuleSpec module_spec; ModuleSpec module_spec;
FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths(); FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
FileSpec symbol_file_spec = FileSpec symbol_file_spec =
Symbols::LocateExecutableSymbolFile(module_spec, search_paths); Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty()); EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
repro::Reproducer::Terminate();
} }
TEST_F(SymbolsTest, TEST_F(SymbolsTest,
LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) { LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) {
EXPECT_THAT_ERROR(
repro::Reproducer::Initialize(repro::ReproducerMode::Off, llvm::None),
llvm::Succeeded());
ModuleSpec module_spec; ModuleSpec module_spec;
// using a GUID here because the symbol file shouldn't actually exist on disk // using a GUID here because the symbol file shouldn't actually exist on disk
module_spec.GetSymbolFileSpec().SetFile( module_spec.GetSymbolFileSpec().SetFile(
@ -44,4 +52,5 @@ TEST_F(SymbolsTest,
FileSpec symbol_file_spec = FileSpec symbol_file_spec =
Symbols::LocateExecutableSymbolFile(module_spec, search_paths); Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty()); EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
repro::Reproducer::Terminate();
} }