38 bool RegressionAssertion::compareObjectMark(
39 const std::string& key_,
42 assert(test_mark_ !=
nullptr);
47 const std::string full_key_(context_.object_path->getRegressionKey(key_));
48 TestMarkPtr stored_(context_.test_mark_storage->getTestMark(full_key_));
52 if(stored_ !=
nullptr)
53 equal_ = test_mark_->isEqual(*stored_);
58 report_ <<
"regression check '" << full_key_ <<
"' has passed" <<
commitMsg();
60 report_ <<
"regression check '" << full_key_ <<
"' has failed" <<
commitMsg();
64 TestMarkFormatterAssert formatter_(&report_,
"");
67 report_ <<
"--------- Current ---------" <<
commitMsg();
68 test_mark_->printMark(formatter_);
71 report_ <<
"--------- Original ---------" <<
commitMsg();
72 if(stored_ !=
nullptr) {
74 stored_->printMark(formatter_);
78 report_ <<
"--------- Difference ---------" <<
commitMsg();
79 if(stored_ !=
nullptr) {
81 std::vector<TestMark::LinearizedRecord> array1_;
82 std::vector<TestMark::LinearizedRecord> array2_;
84 DiffLogBuilderBlock log_builder_(&diff_log_);
85 test_mark_->computeDiff(*stored_, array1_, array2_, log_builder_);
93 test_mark_->printAddMark(formatter_);
99 std::cout <<
"test mark key: " << full_key_ << std::endl;
100 TestMarkFormatterAssert formatter_(&report_,
"");
101 test_mark_->printMark(formatter_);
104 return report_.getResult();
107 bool RegressionAssertion::storeObjectMark(
108 const std::string& key_,
110 assert(test_mark_ !=
nullptr);
115 const std::string full_key_(context_.object_path->getRegressionKey(key_));
116 context_.test_mark_storage->setTestMark(full_key_, test_mark_);
120 report_ <<
"stored regression mark '" << full_key_ <<
"'" <<
commitMsg();
121 return report_.getResult();