16GoldenDigest* GoldenDigest::instance_ =
nullptr;
25GoldenDigest::GoldenDigest() {}
28 const std::string&
value) {
30 ss <<
"\"" <<
value <<
"\"";
31 dimensions_[
name] = ss.str();
35 const std::string& filename,
49 fout <<
"{" << std::endl;
50 fout <<
" \"dimensions\": {" << std::endl;
52 for (
const auto& dimension : dimensions_) {
54 fout <<
"," << std::endl;
57 fout <<
" \"" << dimension.first <<
"\": " << dimension.second;
59 fout << std::endl <<
" }," << std::endl;
60 fout <<
" \"entries\":" << std::endl;
62 fout <<
" [" << std::endl;
64 for (
const auto& entry : entries_) {
66 fout <<
"," << std::endl;
70 fout <<
" { " <<
"\"testName\" : \"" << entry.test_name <<
"\", "
71 <<
"\"filename\" : \"" << entry.filename <<
"\", "
72 <<
"\"width\" : " << entry.width <<
", "
73 <<
"\"height\" : " << entry.height <<
", ";
75 if (entry.max_diff_pixels_percent ==
76 static_cast<int64_t
>(entry.max_diff_pixels_percent)) {
77 fout <<
"\"maxDiffPixelsPercent\" : " << entry.max_diff_pixels_percent
80 fout <<
"\"maxDiffPixelsPercent\" : " << entry.max_diff_pixels_percent
84 fout <<
"\"maxColorDelta\":" << entry.max_color_delta <<
" ";
87 fout << std::endl <<
" ]" << std::endl;
89 fout <<
"}" << std::endl;
Manages a global variable for tracking instances of golden images.
bool Write(WorkingDirectory *working_directory)
static GoldenDigest * Instance()
void AddDimension(const std::string &name, const std::string &value)
void AddImage(const std::string &test_name, const std::string &filename, int32_t width, int32_t height)
std::string GetFilenamePath(const std::string &filename) const
static const double kMaxDiffPixelsPercent
static const int32_t kMaxColorDelta
DEF_SWITCHES_START aot vmservice shared library name