blob: 3d9dae586247c48f49397a8b86fb38183a830d18 [file] [log] [blame]
#include "DMReporter.h"
namespace DM {
void Reporter::updateStatusLine() const {
SkString status;
status.printf("\r\033[K%d / %d", this->finished(), this->started());
const int failed = this->failed();
if (failed > 0) {
status.appendf(", %d failed", failed);
}
SkDebugf(status.c_str());
}
int32_t Reporter::failed() const {
SkAutoMutexAcquire reader(&fMutex);
return fFailures.count();
}
void Reporter::fail(SkString name) {
SkAutoMutexAcquire writer(&fMutex);
fFailures.push_back(name);
}
void Reporter::getFailures(SkTArray<SkString>* failures) const {
SkAutoMutexAcquire reader(&fMutex);
*failures = fFailures;
}
} // namespace DM