Pavel Labath | 11e5917 | 2017-12-18 14:31:39 +0000 | [diff] [blame^] | 1 | //===-- LLGSTest.cpp --------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "TestBase.h" |
| 11 | #include "lldb/Host/Host.h" |
| 12 | #include "llvm/Testing/Support/Error.h" |
| 13 | |
| 14 | using namespace llgs_tests; |
| 15 | using namespace lldb_private; |
| 16 | using namespace llvm; |
| 17 | |
| 18 | TEST_F(TestBase, LaunchModePreservesEnvironment) { |
| 19 | if (TestClient::IsDebugServer()) { |
| 20 | GTEST_LOG_(WARNING) << "Test fails with debugserver: llvm.org/pr35671"; |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | putenv(const_cast<char *>("LLDB_TEST_MAGIC_VARIABLE=LLDB_TEST_MAGIC_VALUE")); |
| 25 | |
| 26 | auto ClientOr = TestClient::launch(getLogFileName(), |
| 27 | {getInferiorPath("environment_check")}); |
| 28 | ASSERT_THAT_EXPECTED(ClientOr, Succeeded()); |
| 29 | auto &Client = **ClientOr; |
| 30 | |
| 31 | ASSERT_THAT_ERROR(Client.ContinueAll(), Succeeded()); |
| 32 | ASSERT_THAT_EXPECTED( |
| 33 | Client.GetLatestStopReplyAs<StopReplyExit>(), |
| 34 | HasValue(testing::Property(&StopReply::getKind, |
| 35 | WaitStatus{WaitStatus::Exit, 0}))); |
| 36 | } |