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

Method OnError

library/cpp/testing/unittest/utmain.cpp:398–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396 }
397
398 void OnError(const TError* descr) override {
399 TraceProcessor->Error(*descr);
400 if (!GetIsForked() && ForkExitedCorrectly) {
401 return;
402 }
403 if (!PrintAfterTest_) {
404 return;
405 }
406
407 const TString err = Sprintf("[%sFAIL%s] %s::%s -> %s%s%s\n%s%s%s", LightRedColor().data(), OldColor().data(),
408 descr->test->unit->name.data(),
409 descr->test->name,
410 LightRedColor().data(), descr->msg, OldColor().data(), LightCyanColor().data(), descr->BackTrace.data(), OldColor().data());
411 const TDuration test_duration = SaveTestDuration();
412 if (ShowFails) {
413 if (PrintTimes_) {
414 Fails.push_back(Sprintf("%s %s", test_duration.ToString().data(), err.data()));
415 } else {
416 Fails.push_back(err);
417 }
418 }
419 fprintf(stderr, "%s", err.data());
420 NOTE_IN_VALGRIND(descr->test);
421 PrintTimes(test_duration);
422 if (GetIsForked()) {
423 fprintf(stderr, "%s", ForkCorrectExitMsg);
424 }
425 }
426
427 void OnFinish(const TFinish* descr) override {
428 TraceProcessor->Finish(*descr);

Callers

nothing calls this directly

Calls 5

SprintfFunction · 0.85
ErrorMethod · 0.45
dataMethod · 0.45
push_backMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected