Debian Codegraph @

lldb/unittests/TestingSupport/Host/PipeTestUtilities.h

raw
1 //===-- PipeTestUtilities.cpp ---------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLDB_UNITTESTS_TESTINGSUPPORT_PIPETESTUTILITIES_H
10 #define LLDB_UNITTESTS_TESTINGSUPPORT_PIPETESTUTILITIES_H
11
12 #include "lldb/Host/Pipe.h"
13 #include "llvm/Testing/Support/Error.h"
14 #include "gtest/gtest.h"
15
16 /// A base class for tests that need a pair of pipes for communication.
17 class PipePairTest : public testing::Test {
18 protected:
19 lldb_private::Pipe input;
20 lldb_private::Pipe output;
21
22 void SetUp() override {
23 ASSERT_THAT_ERROR(input.CreateNew().ToError(), llvm::Succeeded());
24 ASSERT_THAT_ERROR(output.CreateNew().ToError(), llvm::Succeeded());
25 }
26 };
27
28 #endif