MCPcopy Create free account
hub / github.com/catboost/catboost / PrintTestStatus

Method PrintTestStatus

library/cpp/testing/gtest/main.cpp:209–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207 }
208
209 void PrintTestStatus(
210 const ::testing::TestInfo& testInfo,
211 std::string_view status,
212 std::string_view messages,
213 const std::unordered_map<std::string, double>& properties,
214 std::chrono::duration<double> ts)
215 {
216 (*Trace_)
217 << "{"
218 << "\"name\": \"subtest-finished\", "
219 << "\"timestamp\": " << std::setprecision(14) << ts.count() << ", "
220 << "\"value\": {"
221 << "\"class\": " << EscapeJson(testInfo.test_suite_name()) << ", "
222 << "\"subtest\": " << EscapeJson(testInfo.name()) << ", "
223 << "\"comment\": " << EscapeJson(messages) << ", "
224 << "\"status\": " << EscapeJson(status) << ", "
225 << "\"time\": " << (testInfo.result()->elapsed_time() * (1 / 1000.0)) << ", "
226 << "\"metrics\": {";
227 {
228 std::string_view sep = "";
229 for (auto& [key, value]: properties) {
230 (*Trace_) << sep << EscapeJson(key) << ": " << value;
231 sep = ", ";
232 }
233 }
234 (*Trace_)
235 << "}"
236 << "}"
237 << "}"
238 << "\n"
239 << std::flush;
240 }
241
242 std::ostream* Trace_;
243 };

Callers

nothing calls this directly

Calls 5

EscapeJsonFunction · 0.85
elapsed_timeMethod · 0.80
countMethod · 0.45
nameMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected