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

Unified Diff: tools/VisualBench/VisualLightweightBenchModule.cpp

Issue 1342203002: vb: also thread --key through to .json (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: match formatting Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualLightweightBenchModule.cpp
diff --git a/tools/VisualBench/VisualLightweightBenchModule.cpp b/tools/VisualBench/VisualLightweightBenchModule.cpp
index bc592a3934d564a18b29fdf6419f1dbc7622740c..7b7cdbbeb76abf92ac5f9b7a6512f607ace5ee5c 100644
--- a/tools/VisualBench/VisualLightweightBenchModule.cpp
+++ b/tools/VisualBench/VisualLightweightBenchModule.cpp
@@ -31,8 +31,9 @@ DEFINE_int32(samples, 10, "Number of times to time each skp.");
DEFINE_int32(frames, 5, "Number of frames of each skp to render per sample.");
DEFINE_double(loopMs, 5, "Target loop time in millseconds.");
DEFINE_bool2(verbose, v, false, "enable verbose output from the test driver.");
-DEFINE_string(key, "", ""); // dummy to enable gm tests that have platform-specific names
DEFINE_string(outResultsFile, "", "If given, write results here as JSON.");
+DEFINE_string(key, "",
+ "Space-separated key/value pairs to add to JSON identifying this builder.");
DEFINE_string(properties, "",
"Space-separated key/value pairs to add to JSON identifying this run.");
@@ -63,6 +64,14 @@ VisualLightweightBenchModule::VisualLightweightBenchModule(VisualBench* owner)
fResults.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0]));
}
+ if (1 == FLAGS_key.count() % 2) {
+ SkDebugf("ERROR: --key must be passed with an even number of arguments.\n");
+ } else {
+ for (int i = 1; i < FLAGS_key.count(); i += 2) {
+ fResults->key(FLAGS_key[i - 1], FLAGS_key[i]);
+ }
+ }
+
if (1 == FLAGS_properties.count() % 2) {
SkDebugf("ERROR: --properties must be passed with an even number of arguments.\n");
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698