blob: 3d9dae586247c48f49397a8b86fb38183a830d18 [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#include "DMReporter.h"
2
3namespace DM {
4
5void Reporter::updateStatusLine() const {
mtklein@google.coma7a9f372013-10-18 20:52:44 +00006 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());
mtklein@google.comd36522d2013-10-16 13:02:15 +000013}
14
15int32_t Reporter::failed() const {
16 SkAutoMutexAcquire reader(&fMutex);
17 return fFailures.count();
18}
19
20void Reporter::fail(SkString name) {
21 SkAutoMutexAcquire writer(&fMutex);
22 fFailures.push_back(name);
23}
24
25void Reporter::getFailures(SkTArray<SkString>* failures) const {
26 SkAutoMutexAcquire reader(&fMutex);
27 *failures = fFailures;
28}
29
30} // namespace DM