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

Side by Side Diff: dm/DMReporter.cpp

Issue 49323007: DM: add --quiet (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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"
4
5 DEFINE_bool(quiet, false, "If true, don't print status updates.");
6
3 namespace DM { 7 namespace DM {
4 8
5 void Reporter::updateStatusLine() const { 9 void Reporter::updateStatusLine() const {
10 if (FLAGS_quiet) {
11 return;
12 }
13
6 SkString status; 14 SkString status;
7 status.printf("\r\033[K%d / %d", this->finished(), this->started()); 15 status.printf("\r\033[K%d / %d", this->finished(), this->started());
8 const int failed = this->failed(); 16 const int failed = this->failed();
9 if (failed > 0) { 17 if (failed > 0) {
10 status.appendf(", %d failed", failed); 18 status.appendf(", %d failed", failed);
11 } 19 }
12 SkDebugf(status.c_str()); 20 SkDebugf(status.c_str());
13 } 21 }
14 22
15 int32_t Reporter::failed() const { 23 int32_t Reporter::failed() const {
16 SkAutoMutexAcquire reader(&fMutex); 24 SkAutoMutexAcquire reader(&fMutex);
17 return fFailures.count(); 25 return fFailures.count();
18 } 26 }
19 27
20 void Reporter::fail(SkString name) { 28 void Reporter::fail(SkString name) {
21 SkAutoMutexAcquire writer(&fMutex); 29 SkAutoMutexAcquire writer(&fMutex);
22 fFailures.push_back(name); 30 fFailures.push_back(name);
23 } 31 }
24 32
25 void Reporter::getFailures(SkTArray<SkString>* failures) const { 33 void Reporter::getFailures(SkTArray<SkString>* failures) const {
26 SkAutoMutexAcquire reader(&fMutex); 34 SkAutoMutexAcquire reader(&fMutex);
27 *failures = fFailures; 35 *failures = fFailures;
28 } 36 }
29 37
30 } // namespace DM 38 } // namespace DM
OLDNEW
« 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