From f4d1b3911831d2111a351b2742b3a94a9d17f92e Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Thu, 29 Nov 2012 16:29:58 +0000 Subject: [PATCH] Remove legacy flag for android from tests Review URL: https://codereview.appspot.com/6782133 git-svn-id: http://skia.googlecode.com/svn/trunk@6600 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/skia_test.cpp | 54 +++++++++++------------------------------------------ 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp index a744801..5e944f7 100644 --- a/tests/skia_test.cpp +++ b/tests/skia_test.cpp @@ -60,7 +60,7 @@ static const char* result2string(Reporter::Result result) { class DebugfReporter : public Reporter { public: - DebugfReporter(bool androidMode) : fAndroidMode(androidMode) {} + DebugfReporter() : fIndex(0), fTotal(0) {} void setIndexOfTotal(int index, int total) { fIndex = index; @@ -68,42 +68,18 @@ public: } protected: virtual void onStart(Test* test) { - this->dumpState(test, kStarting_State); + SkDebugf("[%d/%d] %s...\n", fIndex+1, fTotal, test->getName()); } virtual void onReport(const char desc[], Reporter::Result result) { - if (!fAndroidMode) { - SkDebugf("\t%s: %s\n", result2string(result), desc); - } + SkDebugf("\t%s: %s\n", result2string(result), desc); } virtual void onEnd(Test* test) { - this->dumpState(test, this->getCurrSuccess() ? - kSucceeded_State : kFailed_State); - } -private: - enum State { - kStarting_State = 1, - kSucceeded_State = 0, - kFailed_State = -2 - }; - - void dumpState(Test* test, State state) { - if (fAndroidMode) { - SkDebugf("INSTRUMENTATION_STATUS: test=%s\n", test->getName()); - SkDebugf("INSTRUMENTATION_STATUS: class=com.skia\n"); - SkDebugf("INSTRUMENTATION_STATUS: current=%d\n", fIndex+1); - SkDebugf("INSTRUMENTATION_STATUS: numtests=%d\n", fTotal); - SkDebugf("INSTRUMENTATION_STATUS_CODE: %d\n", state); - } else { - if (kStarting_State == state) { - SkDebugf("[%d/%d] %s...\n", fIndex+1, fTotal, test->getName()); - } else if (kFailed_State == state) { - SkDebugf("---- FAILED\n"); - } + if (!this->getCurrSuccess()) { + SkDebugf("---- FAILED\n"); } } - +private: int fIndex, fTotal; - bool fAndroidMode; }; int tool_main(int argc, char** argv); @@ -113,15 +89,11 @@ int tool_main(int argc, char** argv) { #endif SkGraphics::Init(); - bool androidMode = false; const char* matchStr = NULL; char* const* stop = argv + argc; for (++argv; argv < stop; ++argv) { - if (strcmp(*argv, "-android") == 0) { - androidMode = true; - - } else if (strcmp(*argv, "--match") == 0) { + if (strcmp(*argv, "--match") == 0) { ++argv; if (argv < stop && **argv) { matchStr = *argv; @@ -144,12 +116,10 @@ int tool_main(int argc, char** argv) { #else header.append(" SK_SCALAR_IS_FLOAT"); #endif - if (!androidMode) { - SkDebugf("%s\n", header.c_str()); - } + SkDebugf("%s\n", header.c_str()); } - DebugfReporter reporter(androidMode); + DebugfReporter reporter; Iter iter(&reporter); Test* test; @@ -170,10 +140,8 @@ int tool_main(int argc, char** argv) { index += 1; } - if (!androidMode) { - SkDebugf("Finished %d tests, %d failures, %d skipped.\n", - count, failCount, skipCount); - } + SkDebugf("Finished %d tests, %d failures, %d skipped.\n", + count, failCount, skipCount); #if SK_SUPPORT_GPU -- 2.7.4