mirror of
https://github.com/google/googletest.git
synced 2026-11-10 07:09:57 +08:00
Merge d3a16a1fd96b4cc0c2a48f090b916cf8fac95cbc into cd8e73f067129f8489e35c7b51c7a68552b289d2
This commit is contained in:
commit
c925691c42
@ -266,6 +266,8 @@ const char kInfoVerbosity[] = "info";
|
||||
const char kWarningVerbosity[] = "warning";
|
||||
// No logs are printed.
|
||||
const char kErrorVerbosity[] = "error";
|
||||
// No logs are printed.
|
||||
const char kIgnoreVerbosity[] = "ignore";
|
||||
|
||||
// Returns true if and only if a log with the given severity is visible
|
||||
// according to the --gmock_verbose flag.
|
||||
|
||||
@ -134,12 +134,13 @@ GTEST_API_ bool LogIsVisible(LogSeverity severity) {
|
||||
if (GMOCK_FLAG_GET(verbose) == kInfoVerbosity) {
|
||||
// Always show the log if --gmock_verbose=info.
|
||||
return true;
|
||||
} else if (GMOCK_FLAG_GET(verbose) == kErrorVerbosity) {
|
||||
// Always hide it if --gmock_verbose=error.
|
||||
} else if (GMOCK_FLAG_GET(verbose) == kErrorVerbosity ||
|
||||
GMOCK_FLAG_GET(verbose) == kIgnoreVerbosity) {
|
||||
// Always hide it if --gmock_verbose=error or --gmock_verbose=ignore.
|
||||
return false;
|
||||
} else {
|
||||
// If --gmock_verbose is neither "info" nor "error", we treat it
|
||||
// as "warning" (its default value).
|
||||
// If --gmock_verbose is neither "info", "error", nor "ignore",
|
||||
// we treat it as "warning" (its default value).
|
||||
return severity == kWarning;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user