10 #include <gtest/gtest.h>
15 , fCaptureStdOut(captureStdOut)
16 , fCaptureStdErr(captureStdErr)
23 if (fCaptureStdOut && fCaptureStdErr) {
24 std::cout <<
"Can't capture stdout and stderr at the same time." << std::endl;
39 std::string tmpOutput;
49 const std::string& sep =
"\n";
50 std::size_t start = 0, end = 0;
51 while ((end = tmpOutput.find(sep, start)) != std::string::npos) {
52 fLineVector.push_back(tmpOutput.substr(start, end - start));
std::string GetCaptureLine(int line)
FairCaptureOutputNew(bool captureStdErr=false, bool captureStdOut=true)