support -android mode when running tests, which spews out android specific
formatting for their testing env.
git-svn-id: http://skia.googlecode.com/svn/trunk@152 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/Test.cpp b/tests/Test.cpp
index 5b8d439..2de0183 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -17,6 +17,7 @@
fCurrTest = test;
this->onStart(test);
fTestCount += 1;
+ fCurrTestSuccess = true; // we're optimistic
}
void Reporter::report(const char desc[], Result result) {
@@ -25,6 +26,9 @@
}
this->onReport(desc, result);
fResultCount[result] += 1;
+ if (kFailed == result) {
+ fCurrTestSuccess = false;
+ }
}
void Reporter::endTest(Test* test) {
@@ -52,9 +56,10 @@
return fName.c_str();
}
-void Test::run() {
+bool Test::run() {
fReporter->startTest(this);
this->onRun(fReporter);
fReporter->endTest(this);
+ return fReporter->getCurrSuccess();
}