ee21a3e395
- rename ComparisonTask to ChecksumTask - have ChecksumTask handle all the checksum-checking - turn on all extra modes by default - simplify progress output to a countdown BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/88543002 git-svn-id: http://skia.googlecode.com/svn/trunk@12398 2bbb7eff-a529-9590-31e7-b0007b416f81
39 lines
851 B
C++
39 lines
851 B
C++
#include "DMReporter.h"
|
|
|
|
#include "SkCommandLineFlags.h"
|
|
|
|
DEFINE_bool(quiet, false, "If true, don't print status updates.");
|
|
|
|
namespace DM {
|
|
|
|
void Reporter::updateStatusLine() const {
|
|
if (FLAGS_quiet) {
|
|
return;
|
|
}
|
|
|
|
SkString status;
|
|
status.printf("\r\033[K%d tasks left", this->started() - this->finished());
|
|
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
|