20 const std::string& working_directory_path)
21 : working_directory_(working_directory_path) {}
24 if (entries_written_ < entries_.size() ||
25 dimensions_written_ < dimensions_.size()) {
27 <<
"golden digest at " << working_directory_
28 <<
" incomplete, with only "
29 << dimensions_written_ <<
" out of "
30 << dimensions_.size() <<
" dimensions "
32 << entries_written_ <<
" out of "
33 << entries_.size() <<
" image entries"
39 return working_directory_;
43 const std::string& filename)
const {
48 const std::string& value) {
50 ss <<
"\"" <<
value <<
"\"";
51 dimensions_[
name] = ss.str();
55 const std::string& filename,
72 dimensions_written_ = 0u;
73 entries_written_ = 0u;
75 fout <<
"{" << std::endl;
76 fout <<
" \"dimensions\": {" << std::endl;
78 for (
const auto& dimension : dimensions_) {
80 fout <<
"," << std::endl;
83 fout <<
" \"" << dimension.first <<
"\": " << dimension.second;
84 dimensions_written_++;
86 fout << std::endl <<
" }," << std::endl;
87 fout <<
" \"entries\":" << std::endl;
89 fout <<
" [" << std::endl;
91 for (
const auto& entry : entries_) {
93 fout <<
"," << std::endl;
97 fout <<
" { " <<
"\"testName\" : \"" << entry.test_name <<
"\", "
98 <<
"\"filename\" : \"" << entry.filename <<
"\", "
99 <<
"\"width\" : " << entry.width <<
", "
100 <<
"\"height\" : " << entry.height <<
", ";
102 if (entry.max_diff_pixels_percent ==
103 static_cast<int64_t
>(entry.max_diff_pixels_percent)) {
104 fout <<
"\"maxDiffPixelsPercent\" : " << entry.max_diff_pixels_percent
107 fout <<
"\"maxDiffPixelsPercent\" : " << entry.max_diff_pixels_percent
111 fout <<
"\"maxColorDelta\":" << entry.max_color_delta <<
" ";
115 fout << std::endl <<
" ]" << std::endl;
117 fout <<
"}" << std::endl;
127 dimensions_written_ = 0u;
128 entries_written_ = 0u;
void AddImage(const std::string &test_name, const std::string &golden_filename, int32_t width, int32_t height)
std::string GetFullPath(const std::string &filename) const
const std::string & GetWorkingDirectory() const
void AddDimension(const std::string &name, const std::string &value)
GoldenDigestManager(const std::string &working_directory)
#define FML_LOG(severity)
static const double kMaxDiffPixelsPercent
static const int32_t kMaxColorDelta
static const double kMaxDiffPixelsPercent
static const int32_t kMaxColorDelta
DEF_SWITCHES_START aot vmservice shared library name
std::string JoinPaths(std::initializer_list< std::string > components)