OLD | NEW |
1 #include "DMReporter.h" | 1 #include "DMReporter.h" |
2 | 2 |
3 namespace DM { | 3 namespace DM { |
4 | 4 |
5 void Reporter::updateStatusLine() const { | 5 void Reporter::updateStatusLine() const { |
6 SkDebugf("\r\033[K%d / %d, %d failed", this->finished(), this->started(), th
is->failed()); | 6 SkString status; |
| 7 status.printf("\r\033[K%d / %d", this->finished(), this->started()); |
| 8 const int failed = this->failed(); |
| 9 if (failed > 0) { |
| 10 status.appendf(", %d failed", failed); |
| 11 } |
| 12 SkDebugf(status.c_str()); |
7 } | 13 } |
8 | 14 |
9 int32_t Reporter::failed() const { | 15 int32_t Reporter::failed() const { |
10 SkAutoMutexAcquire reader(&fMutex); | 16 SkAutoMutexAcquire reader(&fMutex); |
11 return fFailures.count(); | 17 return fFailures.count(); |
12 } | 18 } |
13 | 19 |
14 void Reporter::fail(SkString name) { | 20 void Reporter::fail(SkString name) { |
15 SkAutoMutexAcquire writer(&fMutex); | 21 SkAutoMutexAcquire writer(&fMutex); |
16 fFailures.push_back(name); | 22 fFailures.push_back(name); |
17 } | 23 } |
18 | 24 |
19 void Reporter::getFailures(SkTArray<SkString>* failures) const { | 25 void Reporter::getFailures(SkTArray<SkString>* failures) const { |
20 SkAutoMutexAcquire reader(&fMutex); | 26 SkAutoMutexAcquire reader(&fMutex); |
21 *failures = fFailures; | 27 *failures = fFailures; |
22 } | 28 } |
23 | 29 |
24 } // namespace DM | 30 } // namespace DM |
OLD | NEW |