aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMReporter.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-26 16:31:22 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-26 16:31:22 +0000
commit0dc5bd149a8b69e8dc6d3b4713b827659c9b0a6b (patch)
tree53fdc1e7747c8ed33c275deb6f24802bc41d365a /dm/DMReporter.cpp
parent1e762d39bb6383d33d8e1f04a296f164aa2a6beb (diff)
Let DM run unit tests.
- refactor GYPs and a few flags - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs - add a few more UI features to make DM more like tests I believe this makes the program 'tests' obsolete. It should be somewhat faster to run the two sets together than running the old binaries serially: - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU) - together: 27s (6m21s CPU) Next up is to incorporate benches. I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet. Tested: out/Debug/tests && out/Debug/dm && echo ok BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=13586 R=reed@google.com, bsalomon@google.com, mtklein@google.com, tfarina@chromium.org Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/178273002 git-svn-id: http://skia.googlecode.com/svn/trunk@13592 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'dm/DMReporter.cpp')
-rw-r--r--dm/DMReporter.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/dm/DMReporter.cpp b/dm/DMReporter.cpp
index 0fd83e5bb6..1ff64c57cc 100644
--- a/dm/DMReporter.cpp
+++ b/dm/DMReporter.cpp
@@ -3,21 +3,27 @@
#include "SkCommandLineFlags.h"
#include "OverwriteLine.h"
-DEFINE_bool(quiet, false, "If true, don't print status updates.");
+DEFINE_bool2(quiet, q, false, "If true, don't print status updates.");
+DEFINE_bool2(verbose, v, false, "If true, print status updates one-per-line.");
namespace DM {
-void Reporter::updateStatusLine() const {
+void Reporter::finish(SkString name) {
+ sk_atomic_inc(&fFinished);
+
if (FLAGS_quiet) {
return;
}
SkString status;
- status.printf("%s%d tasks left", kSkOverwriteLine, this->started() - this->finished());
+ status.printf("%s%d tasks left",
+ FLAGS_verbose ? "\n" : kSkOverwriteLine,
+ this->started() - this->finished());
const int failed = this->failed();
if (failed > 0) {
status.appendf(", %d failed", failed);
}
+ status.appendf("\t[%s done]", name.c_str());
SkDebugf(status.c_str());
}
@@ -26,9 +32,9 @@ int32_t Reporter::failed() const {
return fFailures.count();
}
-void Reporter::fail(SkString name) {
+void Reporter::fail(SkString msg) {
SkAutoMutexAcquire writer(&fMutex);
- fFailures.push_back(name);
+ fFailures.push_back(msg);
}
void Reporter::getFailures(SkTArray<SkString>* failures) const {