blob: 4b607d8485e9c576db03f292efe2a4e6eaeb0858 [file] [edit]
//===-- RunInTerminalTest.cpp --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "RunInTerminal.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
#include <thread>
using namespace lldb_dap;
using namespace llvm;
TEST(RunInTerminalTest, ErrorRoundTrip) {
Expected<std::shared_ptr<FifoFile>> fifo = CreateRunInTerminalCommFile();
ASSERT_THAT_EXPECTED(fifo, Succeeded());
RunInTerminalLauncherCommChannel launcher((*fifo)->GetPath());
(*fifo)->Connect();
RunInTerminalDebugAdapterCommChannel adapter(*fifo);
std::thread sender([&launcher]() { launcher.NotifyError("boom"); });
EXPECT_EQ(adapter.GetLauncherError(), "boom");
sender.join();
}