Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: tools/image_expectations.h

Issue 466153006: add --descriptions flag to render_pictures tool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef image_expectations_DEFINED 8 #ifndef image_expectations_DEFINED
9 #define image_expectations_DEFINED 9 #define image_expectations_DEFINED
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 * 104 *
105 * @param sourceName name of the source file that generated this result 105 * @param sourceName name of the source file that generated this result
106 * @param fileName relative path to the image output file on local disk 106 * @param fileName relative path to the image output file on local disk
107 * @param digest description of the image's contents 107 * @param digest description of the image's contents
108 * @param tileNumber if not NULL, pointer to tile number 108 * @param tileNumber if not NULL, pointer to tile number
109 */ 109 */
110 void add(const char *sourceName, const char *fileName, const ImageDigest &digest, 110 void add(const char *sourceName, const char *fileName, const ImageDigest &digest,
111 const int *tileNumber=NULL); 111 const int *tileNumber=NULL);
112 112
113 /** 113 /**
114 * Adds a key/value pair to the descriptions dict within the summary of results.
115 *
116 * @param key key within the descriptions dict
117 * @param value value to associate with that key
118 */
119 void addDescription(const char *key, const char *value);
120
121 /**
114 * Returns true if this test result matches its expectations. 122 * Returns true if this test result matches its expectations.
115 * If there are no expectations for this test result, this will return f alse. 123 * If there are no expectations for this test result, this will return f alse.
116 * 124 *
117 * @param sourceName name of the source file that generated this result 125 * @param sourceName name of the source file that generated this result
118 * @param digest description of the image's contents 126 * @param digest description of the image's contents
119 * @param tileNumber if not NULL, pointer to tile number 127 * @param tileNumber if not NULL, pointer to tile number
120 */ 128 */
121 bool matchesExpectation(const char *sourceName, const ImageDigest &diges t, 129 bool matchesExpectation(const char *sourceName, const ImageDigest &diges t,
122 const int *tileNumber=NULL); 130 const int *tileNumber=NULL);
123 131
124 /** 132 /**
125 * Writes the summary (as constructed so far) to a file. 133 * Writes the summary (as constructed so far) to a file.
126 * 134 *
127 * @param filename path to write the summary to 135 * @param filename path to write the summary to
128 */ 136 */
129 void writeToFile(const char *filename) const; 137 void writeToFile(const char *filename) const;
130 138
131 private: 139 private:
132 140
133 /** 141 /**
134 * Read the file contents from filePtr and parse them into jsonRoot. 142 * Read the file contents from filePtr and parse them into jsonRoot.
135 * 143 *
136 * It is up to the caller to close filePtr after this is done. 144 * It is up to the caller to close filePtr after this is done.
137 * 145 *
138 * Returns true if successful. 146 * Returns true if successful.
139 */ 147 */
140 static bool Parse(SkFILE* filePtr, Json::Value *jsonRoot); 148 static bool Parse(SkFILE* filePtr, Json::Value *jsonRoot);
141 149
142 Json::Value fActualResults; 150 Json::Value fActualResults;
151 Json::Value fDescriptions;
143 Json::Value fExpectedJsonRoot; 152 Json::Value fExpectedJsonRoot;
144 Json::Value fExpectedResults; 153 Json::Value fExpectedResults;
145 }; 154 };
146 155
147 } // namespace sk_tools 156 } // namespace sk_tools
148 157
149 #endif // image_expectations_DEFINED 158 #endif // image_expectations_DEFINED
OLDNEW
« no previous file with comments | « gm/gm_json.py ('k') | tools/image_expectations.cpp » ('j') | tools/render_pictures_main.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698