Returns an indented copy of stderr output for a death test. This makes distinguishing death test output lines from regular log lines much easier.
| 6985 | // This makes distinguishing death test output lines from regular log lines |
| 6986 | // much easier. |
| 6987 | static ::std::string FormatDeathTestOutput(const ::std::string& output) { |
| 6988 | ::std::string ret; |
| 6989 | for (size_t at = 0; ; ) { |
| 6990 | const size_t line_end = output.find('\n', at); |
| 6991 | ret += "[ DEATH ] "; |
| 6992 | if (line_end == ::std::string::npos) { |
| 6993 | ret += output.substr(at); |
| 6994 | break; |
| 6995 | } |
| 6996 | ret += output.substr(at, line_end + 1 - at); |
| 6997 | at = line_end + 1; |
| 6998 | } |
| 6999 | return ret; |
| 7000 | } |
| 7001 | |
| 7002 | // Assesses the success or failure of a death test, using both private |
| 7003 | // members which have previously been set, and one argument: |