File indexing completed on 2025-12-16 09:40:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef ABSL_LOG_INTERNAL_TEST_MATCHERS_H_
0023 #define ABSL_LOG_INTERNAL_TEST_MATCHERS_H_
0024
0025 #include <iosfwd>
0026 #include <sstream>
0027 #include <string>
0028
0029 #include "gmock/gmock.h"
0030 #include "gtest/gtest.h"
0031 #include "absl/base/config.h"
0032 #include "absl/base/log_severity.h"
0033 #include "absl/log/internal/test_helpers.h"
0034 #include "absl/log/log_entry.h"
0035 #include "absl/strings/string_view.h"
0036 #include "absl/time/time.h"
0037
0038 namespace absl {
0039 ABSL_NAMESPACE_BEGIN
0040 namespace log_internal {
0041
0042
0043 ::testing::Matcher<absl::string_view> AsString(
0044 const ::testing::Matcher<const std::string&>& str_matcher);
0045
0046
0047 ::testing::Matcher<const absl::LogEntry&> SourceFilename(
0048 const ::testing::Matcher<absl::string_view>& source_filename);
0049 ::testing::Matcher<const absl::LogEntry&> SourceBasename(
0050 const ::testing::Matcher<absl::string_view>& source_basename);
0051
0052
0053
0054
0055 ::testing::Matcher<const absl::LogEntry&> SourceLine(
0056 const ::testing::Matcher<int>& source_line);
0057 ::testing::Matcher<const absl::LogEntry&> Prefix(
0058 const ::testing::Matcher<bool>& prefix);
0059 ::testing::Matcher<const absl::LogEntry&> LogSeverity(
0060 const ::testing::Matcher<absl::LogSeverity>& log_severity);
0061 ::testing::Matcher<const absl::LogEntry&> Timestamp(
0062 const ::testing::Matcher<absl::Time>& timestamp);
0063
0064
0065 ::testing::Matcher<absl::Time> InMatchWindow();
0066 ::testing::Matcher<const absl::LogEntry&> ThreadID(
0067 const ::testing::Matcher<absl::LogEntry::tid_t>&);
0068 ::testing::Matcher<const absl::LogEntry&> TextMessageWithPrefixAndNewline(
0069 const ::testing::Matcher<absl::string_view>&
0070 text_message_with_prefix_and_newline);
0071 ::testing::Matcher<const absl::LogEntry&> TextMessageWithPrefix(
0072 const ::testing::Matcher<absl::string_view>& text_message_with_prefix);
0073 ::testing::Matcher<const absl::LogEntry&> TextMessage(
0074 const ::testing::Matcher<absl::string_view>& text_message);
0075 ::testing::Matcher<const absl::LogEntry&> TextPrefix(
0076 const ::testing::Matcher<absl::string_view>& text_prefix);
0077 ::testing::Matcher<const absl::LogEntry&> Verbosity(
0078 const ::testing::Matcher<int>& verbosity);
0079 ::testing::Matcher<const absl::LogEntry&> Stacktrace(
0080 const ::testing::Matcher<absl::string_view>& stacktrace);
0081
0082 ::testing::Matcher<absl::string_view> MatchesOstream(
0083 const std::ostringstream& stream);
0084 ::testing::Matcher<const std::string&> DeathTestValidateExpectations();
0085
0086 ::testing::Matcher<const absl::LogEntry&> RawEncodedMessage(
0087 const ::testing::Matcher<absl::string_view>& raw_encoded_message);
0088 #define ENCODED_MESSAGE(message_matcher) ::testing::_
0089
0090 }
0091 ABSL_NAMESPACE_END
0092 }
0093
0094 #endif