epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 7 | |
scroggo@google.com | 5a6324e | 2013-04-11 20:11:40 +0000 | [diff] [blame] | 8 | #include "SkCommandLineFlags.h" |
reed@android.com | 5e5adfd | 2009-03-07 03:39:23 +0000 | [diff] [blame] | 9 | #include "SkGraphics.h" |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 10 | #include "SkOSFile.h" |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 11 | #include "SkTArray.h" |
| 12 | #include "SkTemplates.h" |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 13 | #include "SkThreadPool.h" |
| 14 | #include "SkTime.h" |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 15 | #include "Test.h" |
| 16 | |
robertphillips@google.com | bdb1be5 | 2012-09-07 18:24:43 +0000 | [diff] [blame] | 17 | #if SK_SUPPORT_GPU |
| 18 | #include "GrContext.h" |
| 19 | #endif |
| 20 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 21 | using namespace skiatest; |
| 22 | |
reed@android.com | d252db0 | 2009-04-01 18:31:44 +0000 | [diff] [blame] | 23 | // need to explicitly declare this, or we get some weird infinite loop llist |
| 24 | template TestRegistry* TestRegistry::gHead; |
| 25 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 26 | class Iter { |
| 27 | public: |
| 28 | Iter(Reporter* r) : fReporter(r) { |
| 29 | r->ref(); |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 30 | this->reset(); |
| 31 | } |
| 32 | |
| 33 | void reset() { |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 34 | fReg = TestRegistry::Head(); |
| 35 | } |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 36 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 37 | ~Iter() { |
| 38 | fReporter->unref(); |
| 39 | } |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 40 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 41 | Test* next() { |
| 42 | if (fReg) { |
| 43 | TestRegistry::Factory fact = fReg->factory(); |
| 44 | fReg = fReg->next(); |
| 45 | Test* test = fact(NULL); |
| 46 | test->setReporter(fReporter); |
| 47 | return test; |
| 48 | } |
| 49 | return NULL; |
| 50 | } |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 51 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 52 | private: |
| 53 | Reporter* fReporter; |
| 54 | const TestRegistry* fReg; |
| 55 | }; |
| 56 | |
reed@android.com | d252db0 | 2009-04-01 18:31:44 +0000 | [diff] [blame] | 57 | class DebugfReporter : public Reporter { |
reed@android.com | 57b799e | 2009-04-01 20:26:42 +0000 | [diff] [blame] | 58 | public: |
caryclark@google.com | 07e97fc | 2013-07-08 17:17:02 +0000 | [diff] [blame] | 59 | DebugfReporter(bool allowExtendedTest, bool allowThreaded, bool verbose) |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 60 | : fNextIndex(0) |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 61 | , fPending(0) |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 62 | , fTotal(0) |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 63 | , fAllowExtendedTest(allowExtendedTest) |
caryclark@google.com | 07e97fc | 2013-07-08 17:17:02 +0000 | [diff] [blame] | 64 | , fAllowThreaded(allowThreaded) |
| 65 | , fVerbose(verbose) { |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 66 | } |
reed@android.com | eeb3b7f | 2009-04-09 04:06:54 +0000 | [diff] [blame] | 67 | |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 68 | void setTotal(int total) { |
reed@android.com | 57b799e | 2009-04-01 20:26:42 +0000 | [diff] [blame] | 69 | fTotal = total; |
| 70 | } |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 71 | |
commit-bot@chromium.org | e1c5429 | 2013-04-22 17:35:55 +0000 | [diff] [blame] | 72 | virtual bool allowExtendedTest() const SK_OVERRIDE { |
skia.committer@gmail.com | 391ca66 | 2013-04-11 07:01:45 +0000 | [diff] [blame] | 73 | return fAllowExtendedTest; |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 74 | } |
| 75 | |
commit-bot@chromium.org | e1c5429 | 2013-04-22 17:35:55 +0000 | [diff] [blame] | 76 | virtual bool allowThreaded() const SK_OVERRIDE { |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 77 | return fAllowThreaded; |
| 78 | } |
| 79 | |
caryclark@google.com | 07e97fc | 2013-07-08 17:17:02 +0000 | [diff] [blame] | 80 | virtual bool verbose() const SK_OVERRIDE { |
| 81 | return fVerbose; |
| 82 | } |
| 83 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 84 | protected: |
| 85 | virtual void onStart(Test* test) { |
commit-bot@chromium.org | f6842e7 | 2013-10-01 18:43:50 +0000 | [diff] [blame] | 86 | SkAutoMutexAcquire lock(fStartEndMutex); |
| 87 | fNextIndex++; |
| 88 | fPending++; |
| 89 | SkDebugf("[%3d/%3d] (%d) %s\n", fNextIndex, fTotal, fPending, test->getName()); |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 90 | } |
commit-bot@chromium.org | f6842e7 | 2013-10-01 18:43:50 +0000 | [diff] [blame] | 91 | |
commit-bot@chromium.org | 1f79286 | 2013-06-18 20:50:34 +0000 | [diff] [blame] | 92 | virtual void onReportFailed(const SkString& desc) { |
| 93 | SkDebugf("\tFAILED: %s\n", desc.c_str()); |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 94 | } |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 95 | |
| 96 | virtual void onEnd(Test* test) { |
commit-bot@chromium.org | f6842e7 | 2013-10-01 18:43:50 +0000 | [diff] [blame] | 97 | SkAutoMutexAcquire lock(fStartEndMutex); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 98 | if (!test->passed()) { |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 99 | SkDebugf("---- %s FAILED\n", test->getName()); |
| 100 | } |
| 101 | |
commit-bot@chromium.org | f6842e7 | 2013-10-01 18:43:50 +0000 | [diff] [blame] | 102 | fPending--; |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 103 | if (fNextIndex == fTotal) { |
| 104 | // Just waiting on straggler tests. Shame them by printing their name and runtime. |
| 105 | SkDebugf(" (%d) %5.1fs %s\n", |
| 106 | fPending, test->elapsedMs() / 1e3, test->getName()); |
reed@android.com | eeb3b7f | 2009-04-09 04:06:54 +0000 | [diff] [blame] | 107 | } |
| 108 | } |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 109 | |
djsollen@google.com | f4d1b39 | 2012-11-29 16:29:58 +0000 | [diff] [blame] | 110 | private: |
commit-bot@chromium.org | f6842e7 | 2013-10-01 18:43:50 +0000 | [diff] [blame] | 111 | SkMutex fStartEndMutex; // Guards fNextIndex and fPending. |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 112 | int32_t fNextIndex; |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 113 | int32_t fPending; |
commit-bot@chromium.org | f6842e7 | 2013-10-01 18:43:50 +0000 | [diff] [blame] | 114 | |
| 115 | // Once the tests get going, these are logically const. |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 116 | int fTotal; |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 117 | bool fAllowExtendedTest; |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 118 | bool fAllowThreaded; |
caryclark@google.com | 07e97fc | 2013-07-08 17:17:02 +0000 | [diff] [blame] | 119 | bool fVerbose; |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 120 | }; |
| 121 | |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 122 | DEFINE_string2(match, m, NULL, "[~][^]substring[$] [...] of test name to run.\n" \ |
| 123 | "Multiple matches may be separated by spaces.\n" \ |
| 124 | "~ causes a matching test to always be skipped\n" \ |
| 125 | "^ requires the start of the test to match\n" \ |
| 126 | "$ requires the end of the test to match\n" \ |
| 127 | "^ and $ requires an exact match\n" \ |
| 128 | "If a test does not match any list entry,\n" \ |
| 129 | "it is skipped unless some list entry starts with ~"); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 130 | DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); |
commit-bot@chromium.org | f9a2759 | 2013-10-29 19:50:39 +0000 | [diff] [blame] | 131 | DEFINE_string2(resourcePath, i, "resources", "directory for test resources."); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 132 | DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); |
caryclark@google.com | 8d0a524 | 2013-07-16 16:11:16 +0000 | [diff] [blame] | 133 | DEFINE_bool2(single, z, false, "run tests on a single thread internally."); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 134 | DEFINE_bool2(verbose, v, false, "enable verbose output."); |
commit-bot@chromium.org | 44c661f | 2013-04-22 15:23:14 +0000 | [diff] [blame] | 135 | DEFINE_int32(threads, SkThreadPool::kThreadPerCore, |
| 136 | "Run threadsafe tests on a threadpool with this many threads."); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 137 | |
scroggo@google.com | c76218d | 2013-06-06 14:59:56 +0000 | [diff] [blame] | 138 | SkString Test::GetTmpDir() { |
| 139 | const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; |
| 140 | return SkString(tmpDir); |
| 141 | } |
| 142 | |
| 143 | SkString Test::GetResourcePath() { |
| 144 | const char* resourcePath = FLAGS_resourcePath.isEmpty() ? NULL : FLAGS_resourcePath[0]; |
| 145 | return SkString(resourcePath); |
| 146 | } |
| 147 | |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 148 | // Deletes self when run. |
| 149 | class SkTestRunnable : public SkRunnable { |
| 150 | public: |
| 151 | // Takes ownership of test. |
| 152 | SkTestRunnable(Test* test, int32_t* failCount) : fTest(test), fFailCount(failCount) {} |
| 153 | |
| 154 | virtual void run() { |
| 155 | fTest->run(); |
| 156 | if(!fTest->passed()) { |
| 157 | sk_atomic_inc(fFailCount); |
| 158 | } |
| 159 | SkDELETE(this); |
| 160 | } |
| 161 | |
| 162 | private: |
| 163 | SkAutoTDelete<Test> fTest; |
| 164 | int32_t* fFailCount; |
| 165 | }; |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 166 | |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 167 | int tool_main(int argc, char** argv); |
| 168 | int tool_main(int argc, char** argv) { |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 169 | SkCommandLineFlags::SetUsage(""); |
| 170 | SkCommandLineFlags::Parse(argc, argv); |
| 171 | |
bsalomon@google.com | 4e23068 | 2013-01-15 20:37:04 +0000 | [diff] [blame] | 172 | #if SK_ENABLE_INST_COUNT |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 173 | gPrintInstCount = true; |
| 174 | #endif |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 175 | |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 176 | SkGraphics::Init(); |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 177 | |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 178 | { |
| 179 | SkString header("Skia UnitTests:"); |
reed@google.com | 9aff148 | 2013-04-11 18:27:52 +0000 | [diff] [blame] | 180 | if (!FLAGS_match.isEmpty()) { |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 181 | header.appendf(" --match"); |
| 182 | for (int index = 0; index < FLAGS_match.count(); ++index) { |
| 183 | header.appendf(" %s", FLAGS_match[index]); |
| 184 | } |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 185 | } |
scroggo@google.com | c76218d | 2013-06-06 14:59:56 +0000 | [diff] [blame] | 186 | SkString tmpDir = Test::GetTmpDir(); |
| 187 | if (!tmpDir.isEmpty()) { |
| 188 | header.appendf(" --tmpDir %s", tmpDir.c_str()); |
djsollen@google.com | cb62650 | 2013-03-20 13:48:20 +0000 | [diff] [blame] | 189 | } |
scroggo@google.com | c76218d | 2013-06-06 14:59:56 +0000 | [diff] [blame] | 190 | SkString resourcePath = Test::GetResourcePath(); |
| 191 | if (!resourcePath.isEmpty()) { |
| 192 | header.appendf(" --resourcePath %s", resourcePath.c_str()); |
reed@google.com | 789c6f2 | 2013-02-25 20:24:24 +0000 | [diff] [blame] | 193 | } |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 194 | #ifdef SK_DEBUG |
| 195 | header.append(" SK_DEBUG"); |
| 196 | #else |
| 197 | header.append(" SK_RELEASE"); |
| 198 | #endif |
reed@google.com | 5696baa | 2013-08-29 20:20:39 +0000 | [diff] [blame] | 199 | header.appendf(" skia_arch_width=%d", (int)sizeof(void*) * 8); |
djsollen@google.com | f4d1b39 | 2012-11-29 16:29:58 +0000 | [diff] [blame] | 200 | SkDebugf("%s\n", header.c_str()); |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 201 | } |
| 202 | |
caryclark@google.com | 8d0a524 | 2013-07-16 16:11:16 +0000 | [diff] [blame] | 203 | DebugfReporter reporter(FLAGS_extendedTest, !FLAGS_single, FLAGS_verbose); |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 204 | Iter iter(&reporter); |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 205 | |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 206 | // Count tests first. |
| 207 | int total = 0; |
| 208 | int toRun = 0; |
| 209 | Test* test; |
sglez@google.com | 586db93 | 2013-07-24 17:24:23 +0000 | [diff] [blame] | 210 | |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 211 | while ((test = iter.next()) != NULL) { |
| 212 | SkAutoTDelete<Test> owned(test); |
sglez@google.com | 586db93 | 2013-07-24 17:24:23 +0000 | [diff] [blame] | 213 | |
commit-bot@chromium.org | a6f37e7 | 2013-08-30 15:52:46 +0000 | [diff] [blame] | 214 | if(!SkCommandLineFlags::ShouldSkip(FLAGS_match, test->getName())) { |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 215 | toRun++; |
| 216 | } |
| 217 | total++; |
| 218 | } |
| 219 | reporter.setTotal(toRun); |
| 220 | |
| 221 | // Now run them. |
| 222 | iter.reset(); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 223 | int32_t failCount = 0; |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 224 | int skipCount = 0; |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 225 | |
commit-bot@chromium.org | a7538ba | 2013-10-10 18:49:04 +0000 | [diff] [blame] | 226 | SkThreadPool threadpool(FLAGS_threads); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 227 | SkTArray<Test*> unsafeTests; // Always passes ownership to an SkTestRunnable |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 228 | for (int i = 0; i < total; i++) { |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 229 | SkAutoTDelete<Test> test(iter.next()); |
commit-bot@chromium.org | a6f37e7 | 2013-08-30 15:52:46 +0000 | [diff] [blame] | 230 | if (SkCommandLineFlags::ShouldSkip(FLAGS_match, test->getName())) { |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 231 | ++skipCount; |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 232 | } else if (!test->isThreadsafe()) { |
| 233 | unsafeTests.push_back() = test.detach(); |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 234 | } else { |
commit-bot@chromium.org | a7538ba | 2013-10-10 18:49:04 +0000 | [diff] [blame] | 235 | threadpool.add(SkNEW_ARGS(SkTestRunnable, (test.detach(), &failCount))); |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 236 | } |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 237 | } |
reed@android.com | 57b799e | 2009-04-01 20:26:42 +0000 | [diff] [blame] | 238 | |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 239 | // Run the tests that aren't threadsafe. |
| 240 | for (int i = 0; i < unsafeTests.count(); i++) { |
| 241 | SkNEW_ARGS(SkTestRunnable, (unsafeTests[i], &failCount))->run(); |
| 242 | } |
| 243 | |
commit-bot@chromium.org | a7538ba | 2013-10-10 18:49:04 +0000 | [diff] [blame] | 244 | // Block until threaded tests finish. |
| 245 | threadpool.wait(); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 246 | |
djsollen@google.com | f4d1b39 | 2012-11-29 16:29:58 +0000 | [diff] [blame] | 247 | SkDebugf("Finished %d tests, %d failures, %d skipped.\n", |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 248 | toRun, failCount, skipCount); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 249 | const int testCount = reporter.countTests(); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 250 | if (FLAGS_verbose && testCount > 0) { |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 251 | SkDebugf("Ran %d Internal tests.\n", testCount); |
| 252 | } |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 253 | SkGraphics::Term(); |
bsalomon@google.com | 67b915d | 2013-02-04 16:13:32 +0000 | [diff] [blame] | 254 | GpuTest::DestroyContexts(); |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 255 | |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 256 | return (failCount == 0) ? 0 : 1; |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 257 | } |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 258 | |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 259 | #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 260 | int main(int argc, char * const argv[]) { |
| 261 | return tool_main(argc, (char**) argv); |
| 262 | } |
| 263 | #endif |