Use these patterns together with CaptureFD and EXPECT_PCRE_MATCH() to test for the presence (or absence) of log lines at a particular level:
Synopsis
Declared in <folly/testing/TestUtil.h>
std::string
glogErrorPattern();
Description
CaptureFD stderr(2); LOG(INFO) << "All is well"; EXPECT_NO_PCRE_MATCH(glogErrOrWarnPattern(), stderr.readIncremental()); LOG(ERROR) << "Uh‐oh"; EXPECT_PCRE_MATCH(glogErrorPattern(), stderr.readIncremental());
Return Value
A PCRE pattern matching an error‐level glog line.
Created with MrDocs