Returns an indented copy of stderr output for a death test. This makes distinguishing death test output lines from regular log lines much easier.
| 8128 | // This makes distinguishing death test output lines from regular log lines |
| 8129 | // much easier. |
| 8130 | static ::std::string FormatDeathTestOutput(const ::std::string& output) { |
| 8131 | ::std::string ret; |
| 8132 | for (size_t at = 0; ; ) { |
| 8133 | const size_t line_end = output.find('\n', at); |
| 8134 | ret += "[ DEATH ] "; |
| 8135 | if (line_end == ::std::string::npos) { |
| 8136 | ret += output.substr(at); |
| 8137 | break; |
| 8138 | } |
| 8139 | ret += output.substr(at, line_end + 1 - at); |
| 8140 | at = line_end + 1; |
| 8141 | } |
| 8142 | return ret; |
| 8143 | } |
| 8144 | |
| 8145 | // Assesses the success or failure of a death test, using both private |
| 8146 | // members which have previously been set, and one argument: |