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

Side by Side Diff: dm/DMReporter.cpp

Issue 179403010: Revert of Let DM run unit tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « dm/DMReporter.h ('k') | dm/DMTask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMReporter.h" 1 #include "DMReporter.h"
2 2
3 #include "SkCommandLineFlags.h" 3 #include "SkCommandLineFlags.h"
4 #include "OverwriteLine.h" 4 #include "OverwriteLine.h"
5 5
6 DEFINE_bool2(quiet, q, false, "If true, don't print status updates."); 6 DEFINE_bool(quiet, false, "If true, don't print status updates.");
7 DEFINE_bool2(verbose, v, false, "If true, print status updates one-per-line.");
8 7
9 namespace DM { 8 namespace DM {
10 9
11 void Reporter::finish(SkString name) { 10 void Reporter::updateStatusLine() const {
12 sk_atomic_inc(&fFinished);
13
14 if (FLAGS_quiet) { 11 if (FLAGS_quiet) {
15 return; 12 return;
16 } 13 }
17 14
18 SkString status; 15 SkString status;
19 status.printf("%s%d tasks left", 16 status.printf("%s%d tasks left", kSkOverwriteLine, this->started() - this->f inished());
20 FLAGS_verbose ? "\n" : kSkOverwriteLine,
21 this->started() - this->finished());
22 const int failed = this->failed(); 17 const int failed = this->failed();
23 if (failed > 0) { 18 if (failed > 0) {
24 status.appendf(", %d failed", failed); 19 status.appendf(", %d failed", failed);
25 } 20 }
26 status.appendf("\t[%s done]", name.c_str());
27 SkDebugf(status.c_str()); 21 SkDebugf(status.c_str());
28 } 22 }
29 23
30 int32_t Reporter::failed() const { 24 int32_t Reporter::failed() const {
31 SkAutoMutexAcquire reader(&fMutex); 25 SkAutoMutexAcquire reader(&fMutex);
32 return fFailures.count(); 26 return fFailures.count();
33 } 27 }
34 28
35 void Reporter::fail(SkString msg) { 29 void Reporter::fail(SkString name) {
36 SkAutoMutexAcquire writer(&fMutex); 30 SkAutoMutexAcquire writer(&fMutex);
37 fFailures.push_back(msg); 31 fFailures.push_back(name);
38 } 32 }
39 33
40 void Reporter::getFailures(SkTArray<SkString>* failures) const { 34 void Reporter::getFailures(SkTArray<SkString>* failures) const {
41 SkAutoMutexAcquire reader(&fMutex); 35 SkAutoMutexAcquire reader(&fMutex);
42 *failures = fFailures; 36 *failures = fFailures;
43 } 37 }
44 38
45 } // namespace DM 39 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMReporter.h ('k') | dm/DMTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698