summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Expression
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-06-05 10:29:48 +0000
committerPavel Labath <labath@google.com>2018-06-05 10:29:48 +0000
commit4e34bfcbeb5afebdc13f6c4979cd5d4edd9e15d8 (patch)
treec04809f7b3ca9bdacaa5ed8531b53061cfd7390f /lldb/unittests/Expression
parent4c1fdcfb974b8d3e1479ec3d4b0efb1bc249cf0c (diff)
downloadbcm5719-llvm-4e34bfcbeb5afebdc13f6c4979cd5d4edd9e15d8.tar.gz
bcm5719-llvm-4e34bfcbeb5afebdc13f6c4979cd5d4edd9e15d8.zip
Really fix ClangParserTest
It turns out the test needs a fixture after all (to initialize HostInfo), so provide one that does that. llvm-svn: 334003
Diffstat (limited to 'lldb/unittests/Expression')
-rw-r--r--lldb/unittests/Expression/ClangParserTest.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/unittests/Expression/ClangParserTest.cpp b/lldb/unittests/Expression/ClangParserTest.cpp
index 1727be9f01f..c776e48c952 100644
--- a/lldb/unittests/Expression/ClangParserTest.cpp
+++ b/lldb/unittests/Expression/ClangParserTest.cpp
@@ -9,12 +9,20 @@
#include "Plugins/ExpressionParser/Clang/ClangHost.h"
#include "TestingSupport/TestUtilities.h"
+#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/lldb-defines.h"
#include "gtest/gtest.h"
using namespace lldb_private;
+namespace {
+struct ClangHostTest : public testing::Test {
+ static void SetUpTestCase() { HostInfo::Initialize(); }
+ static void TearDownTestCase() { HostInfo::Terminate(); }
+};
+} // namespace
+
#ifdef __APPLE__
static std::string ComputeClangDir(std::string lldb_shlib_path,
bool verify = false) {
@@ -24,7 +32,7 @@ static std::string ComputeClangDir(std::string lldb_shlib_path,
return clang_dir.GetPath();
}
-TEST(ClangHostTest, MacOSX) {
+TEST_F(ClangHostTest, MacOSX) {
// This returns whatever the POSIX fallback returns.
std::string posix = "/usr/lib/liblldb.dylib";
EXPECT_FALSE(ComputeClangDir(posix).empty());
OpenPOWER on IntegriCloud