#ifndef LLVM_TESTING_SUPPORT_ERROR_H
#define LLVM_TESTING_SUPPORT_ERROR_H
#include "llvm/Support/Error.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gmock/gmock.h"
#include <ostream>
namespace llvm {
namespace detail {
ErrorHolder TakeError(Error Err);
template <typename T> ExpectedHolder<T> TakeExpected(Expected<T> &Exp) { … }
template <typename T> ExpectedHolder<T> TakeExpected(Expected<T> &&Exp) { … }
template <typename T>
class ValueMatchesMono
: public testing::MatcherInterface<const ExpectedHolder<T> &> { … };
template<typename M>
class ValueMatchesPoly { … };
template <typename InfoT>
class ErrorMatchesMono : public testing::MatcherInterface<const ErrorHolder &> { … };
class ErrorMessageMatches
: public testing::MatcherInterface<const ErrorHolder &> { … };
}
#define EXPECT_THAT_ERROR(Err, Matcher) …
#define ASSERT_THAT_ERROR(Err, Matcher) …
#define EXPECT_THAT_EXPECTED(Err, Matcher) …
#define ASSERT_THAT_EXPECTED(Err, Matcher) …
MATCHER(Succeeded, "") { … }
MATCHER(Failed, "") { … }
template <typename InfoT>
testing::Matcher<const detail::ErrorHolder &> Failed() { … }
template <typename InfoT, typename M>
testing::Matcher<const detail::ErrorHolder &> Failed(M Matcher) { … }
template <typename... M>
testing::Matcher<const detail::ErrorHolder &> FailedWithMessage(M... Matcher) { … }
template <typename M>
testing::Matcher<const detail::ErrorHolder &> FailedWithMessageArray(M Matcher) { … }
template <typename M>
detail::ValueMatchesPoly<M> HasValue(M Matcher) { … }
}
#endif