Returns an indented copy of stderr output for a death test. This makes distinguishing death test output lines from regular log lines much easier.
| 7419 | // This makes distinguishing death test output lines from regular log lines |
| 7420 | // much easier. |
| 7421 | static ::std::string FormatDeathTestOutput(const ::std::string& output) { |
| 7422 | ::std::string ret; |
| 7423 | for (size_t at = 0; ; ) { |
| 7424 | const size_t line_end = output.find('\n', at); |
| 7425 | ret += "[ DEATH ] "; |
| 7426 | if (line_end == ::std::string::npos) { |
| 7427 | ret += output.substr(at); |
| 7428 | break; |
| 7429 | } |
| 7430 | ret += output.substr(at, line_end + 1 - at); |
| 7431 | at = line_end + 1; |
| 7432 | } |
| 7433 | return ret; |
| 7434 | } |
| 7435 | |
| 7436 | // Assesses the success or failure of a death test, using both private |
| 7437 | // members which have previously been set, and one argument: |