| 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); |