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 "SkRunnable.h" |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 12 | #include "SkTArray.h" |
| 13 | #include "SkTemplates.h" |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 14 | #include "SkThreadPool.h" |
| 15 | #include "SkTime.h" |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 16 | #include "Test.h" |
| 17 | |
robertphillips@google.com | bdb1be5 | 2012-09-07 18:24:43 +0000 | [diff] [blame] | 18 | #if SK_SUPPORT_GPU |
| 19 | #include "GrContext.h" |
| 20 | #endif |
| 21 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 22 | using namespace skiatest; |
| 23 | |
reed@android.com | d252db0 | 2009-04-01 18:31:44 +0000 | [diff] [blame] | 24 | // need to explicitly declare this, or we get some weird infinite loop llist |
| 25 | template TestRegistry* TestRegistry::gHead; |
| 26 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 27 | class Iter { |
| 28 | public: |
| 29 | Iter(Reporter* r) : fReporter(r) { |
| 30 | r->ref(); |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 31 | this->reset(); |
| 32 | } |
| 33 | |
| 34 | void reset() { |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 35 | fReg = TestRegistry::Head(); |
| 36 | } |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 37 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 38 | ~Iter() { |
| 39 | fReporter->unref(); |
| 40 | } |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 41 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 42 | Test* next() { |
| 43 | if (fReg) { |
| 44 | TestRegistry::Factory fact = fReg->factory(); |
| 45 | fReg = fReg->next(); |
| 46 | Test* test = fact(NULL); |
| 47 | test->setReporter(fReporter); |
| 48 | return test; |
| 49 | } |
| 50 | return NULL; |
| 51 | } |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 52 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 53 | private: |
| 54 | Reporter* fReporter; |
| 55 | const TestRegistry* fReg; |
| 56 | }; |
| 57 | |
reed@android.com | d252db0 | 2009-04-01 18:31:44 +0000 | [diff] [blame] | 58 | class DebugfReporter : public Reporter { |
reed@android.com | 57b799e | 2009-04-01 20:26:42 +0000 | [diff] [blame] | 59 | public: |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 60 | DebugfReporter(bool allowExtendedTest, bool allowThreaded) |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 61 | : fNextIndex(0) |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 62 | , fPending(0) |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 63 | , fTotal(0) |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 64 | , fAllowExtendedTest(allowExtendedTest) |
| 65 | , fAllowThreaded(allowThreaded) { |
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 | |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 80 | protected: |
| 81 | virtual void onStart(Test* test) { |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 82 | const int index = sk_atomic_inc(&fNextIndex); |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 83 | sk_atomic_inc(&fPending); |
| 84 | SkDebugf("[%3d/%3d] (%d) %s\n", index+1, fTotal, fPending, test->getName()); |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 85 | } |
commit-bot@chromium.org | 1f79286 | 2013-06-18 20:50:34 +0000 | [diff] [blame] | 86 | virtual void onReportFailed(const SkString& desc) { |
| 87 | SkDebugf("\tFAILED: %s\n", desc.c_str()); |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 88 | } |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 89 | |
| 90 | virtual void onEnd(Test* test) { |
| 91 | if (!test->passed()) { |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 92 | SkDebugf("---- %s FAILED\n", test->getName()); |
| 93 | } |
| 94 | |
| 95 | sk_atomic_dec(&fPending); |
| 96 | if (fNextIndex == fTotal) { |
| 97 | // Just waiting on straggler tests. Shame them by printing their name and runtime. |
| 98 | SkDebugf(" (%d) %5.1fs %s\n", |
| 99 | fPending, test->elapsedMs() / 1e3, test->getName()); |
reed@android.com | eeb3b7f | 2009-04-09 04:06:54 +0000 | [diff] [blame] | 100 | } |
| 101 | } |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 102 | |
djsollen@google.com | f4d1b39 | 2012-11-29 16:29:58 +0000 | [diff] [blame] | 103 | private: |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 104 | int32_t fNextIndex; |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 105 | int32_t fPending; |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 106 | int fTotal; |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 107 | bool fAllowExtendedTest; |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 108 | bool fAllowThreaded; |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 109 | }; |
| 110 | |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 111 | DEFINE_string2(match, m, NULL, "[~][^]substring[$] [...] of test name to run.\n" \ |
| 112 | "Multiple matches may be separated by spaces.\n" \ |
| 113 | "~ causes a matching test to always be skipped\n" \ |
| 114 | "^ requires the start of the test to match\n" \ |
| 115 | "$ requires the end of the test to match\n" \ |
| 116 | "^ and $ requires an exact match\n" \ |
| 117 | "If a test does not match any list entry,\n" \ |
| 118 | "it is skipped unless some list entry starts with ~"); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 119 | DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); |
| 120 | DEFINE_string2(resourcePath, i, NULL, "directory for test resources."); |
| 121 | DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 122 | DEFINE_bool2(threaded, z, false, "allow tests to use multiple threads internally."); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 123 | DEFINE_bool2(verbose, v, false, "enable verbose output."); |
commit-bot@chromium.org | 44c661f | 2013-04-22 15:23:14 +0000 | [diff] [blame] | 124 | DEFINE_int32(threads, SkThreadPool::kThreadPerCore, |
| 125 | "Run threadsafe tests on a threadpool with this many threads."); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 126 | |
scroggo@google.com | c76218d | 2013-06-06 14:59:56 +0000 | [diff] [blame] | 127 | SkString Test::GetTmpDir() { |
| 128 | const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; |
| 129 | return SkString(tmpDir); |
| 130 | } |
| 131 | |
| 132 | SkString Test::GetResourcePath() { |
| 133 | const char* resourcePath = FLAGS_resourcePath.isEmpty() ? NULL : FLAGS_resourcePath[0]; |
| 134 | return SkString(resourcePath); |
| 135 | } |
| 136 | |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 137 | // Deletes self when run. |
| 138 | class SkTestRunnable : public SkRunnable { |
| 139 | public: |
| 140 | // Takes ownership of test. |
| 141 | SkTestRunnable(Test* test, int32_t* failCount) : fTest(test), fFailCount(failCount) {} |
| 142 | |
| 143 | virtual void run() { |
| 144 | fTest->run(); |
| 145 | if(!fTest->passed()) { |
| 146 | sk_atomic_inc(fFailCount); |
| 147 | } |
| 148 | SkDELETE(this); |
| 149 | } |
| 150 | |
| 151 | private: |
| 152 | SkAutoTDelete<Test> fTest; |
| 153 | int32_t* fFailCount; |
| 154 | }; |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 155 | |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 156 | /* Takes a list of the form [~][^]match[$] |
| 157 | ~ causes a matching test to always be skipped |
| 158 | ^ requires the start of the test to match |
| 159 | $ requires the end of the test to match |
| 160 | ^ and $ requires an exact match |
| 161 | If a test does not match any list entry, it is skipped unless some list entry starts with ~ |
| 162 | */ |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 163 | static bool shouldSkip(const char* testName) { |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 164 | int count = FLAGS_match.count(); |
| 165 | size_t testLen = strlen(testName); |
caryclark@google.com | 89d1827 | 2013-05-02 14:23:07 +0000 | [diff] [blame] | 166 | bool anyExclude = count == 0; |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 167 | for (int index = 0; index < count; ++index) { |
| 168 | const char* matchName = FLAGS_match[index]; |
| 169 | size_t matchLen = strlen(matchName); |
| 170 | bool matchExclude, matchStart, matchEnd; |
| 171 | if ((matchExclude = matchName[0] == '~')) { |
| 172 | anyExclude = true; |
| 173 | matchName++; |
| 174 | matchLen--; |
| 175 | } |
| 176 | if ((matchStart = matchName[0] == '^')) { |
| 177 | matchName++; |
| 178 | matchLen--; |
| 179 | } |
| 180 | if ((matchEnd = matchName[matchLen - 1] == '$')) { |
| 181 | matchLen--; |
| 182 | } |
| 183 | if (matchStart ? (!matchEnd || matchLen == testLen) |
| 184 | && strncmp(testName, matchName, matchLen) == 0 |
| 185 | : matchEnd ? matchLen <= testLen |
| 186 | && strncmp(testName + testLen - matchLen, matchName, matchLen) == 0 |
| 187 | : strstr(testName, matchName) != 0) { |
| 188 | return matchExclude; |
| 189 | } |
| 190 | } |
| 191 | return !anyExclude; |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 192 | } |
| 193 | |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 194 | int tool_main(int argc, char** argv); |
| 195 | int tool_main(int argc, char** argv) { |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 196 | SkCommandLineFlags::SetUsage(""); |
| 197 | SkCommandLineFlags::Parse(argc, argv); |
| 198 | |
bsalomon@google.com | 4e23068 | 2013-01-15 20:37:04 +0000 | [diff] [blame] | 199 | #if SK_ENABLE_INST_COUNT |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 200 | gPrintInstCount = true; |
| 201 | #endif |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 202 | |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 203 | SkGraphics::Init(); |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 204 | |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 205 | { |
| 206 | SkString header("Skia UnitTests:"); |
reed@google.com | 9aff148 | 2013-04-11 18:27:52 +0000 | [diff] [blame] | 207 | if (!FLAGS_match.isEmpty()) { |
caryclark@google.com | b631eec | 2013-05-02 13:14:40 +0000 | [diff] [blame] | 208 | header.appendf(" --match"); |
| 209 | for (int index = 0; index < FLAGS_match.count(); ++index) { |
| 210 | header.appendf(" %s", FLAGS_match[index]); |
| 211 | } |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 212 | } |
scroggo@google.com | c76218d | 2013-06-06 14:59:56 +0000 | [diff] [blame] | 213 | SkString tmpDir = Test::GetTmpDir(); |
| 214 | if (!tmpDir.isEmpty()) { |
| 215 | header.appendf(" --tmpDir %s", tmpDir.c_str()); |
djsollen@google.com | cb62650 | 2013-03-20 13:48:20 +0000 | [diff] [blame] | 216 | } |
scroggo@google.com | c76218d | 2013-06-06 14:59:56 +0000 | [diff] [blame] | 217 | SkString resourcePath = Test::GetResourcePath(); |
| 218 | if (!resourcePath.isEmpty()) { |
| 219 | header.appendf(" --resourcePath %s", resourcePath.c_str()); |
reed@google.com | 789c6f2 | 2013-02-25 20:24:24 +0000 | [diff] [blame] | 220 | } |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 221 | #ifdef SK_DEBUG |
| 222 | header.append(" SK_DEBUG"); |
| 223 | #else |
| 224 | header.append(" SK_RELEASE"); |
| 225 | #endif |
| 226 | #ifdef SK_SCALAR_IS_FIXED |
| 227 | header.append(" SK_SCALAR_IS_FIXED"); |
| 228 | #else |
| 229 | header.append(" SK_SCALAR_IS_FLOAT"); |
| 230 | #endif |
djsollen@google.com | f4d1b39 | 2012-11-29 16:29:58 +0000 | [diff] [blame] | 231 | SkDebugf("%s\n", header.c_str()); |
reed@google.com | 91d449e | 2011-10-26 15:25:18 +0000 | [diff] [blame] | 232 | } |
| 233 | |
caryclark@google.com | 16cfe40 | 2013-04-18 18:47:37 +0000 | [diff] [blame] | 234 | DebugfReporter reporter(FLAGS_extendedTest, FLAGS_threaded); |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 235 | Iter iter(&reporter); |
reed@android.com | 80e39a7 | 2009-04-02 16:59:40 +0000 | [diff] [blame] | 236 | |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 237 | // Count tests first. |
| 238 | int total = 0; |
| 239 | int toRun = 0; |
| 240 | Test* test; |
| 241 | while ((test = iter.next()) != NULL) { |
| 242 | SkAutoTDelete<Test> owned(test); |
| 243 | if(!shouldSkip(test->getName())) { |
| 244 | toRun++; |
| 245 | } |
| 246 | total++; |
| 247 | } |
| 248 | reporter.setTotal(toRun); |
| 249 | |
| 250 | // Now run them. |
| 251 | iter.reset(); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 252 | int32_t failCount = 0; |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 253 | int skipCount = 0; |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 254 | |
| 255 | SkAutoTDelete<SkThreadPool> threadpool(SkNEW_ARGS(SkThreadPool, (FLAGS_threads))); |
| 256 | SkTArray<Test*> unsafeTests; // Always passes ownership to an SkTestRunnable |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 257 | for (int i = 0; i < total; i++) { |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 258 | SkAutoTDelete<Test> test(iter.next()); |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 259 | if (shouldSkip(test->getName())) { |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 260 | ++skipCount; |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 261 | } else if (!test->isThreadsafe()) { |
| 262 | unsafeTests.push_back() = test.detach(); |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 263 | } else { |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 264 | threadpool->add(SkNEW_ARGS(SkTestRunnable, (test.detach(), &failCount))); |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 265 | } |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 266 | } |
reed@android.com | 57b799e | 2009-04-01 20:26:42 +0000 | [diff] [blame] | 267 | |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 268 | // Run the tests that aren't threadsafe. |
| 269 | for (int i = 0; i < unsafeTests.count(); i++) { |
| 270 | SkNEW_ARGS(SkTestRunnable, (unsafeTests[i], &failCount))->run(); |
| 271 | } |
| 272 | |
| 273 | // Blocks until threaded tests finish. |
| 274 | threadpool.free(); |
| 275 | |
djsollen@google.com | f4d1b39 | 2012-11-29 16:29:58 +0000 | [diff] [blame] | 276 | SkDebugf("Finished %d tests, %d failures, %d skipped.\n", |
commit-bot@chromium.org | 0506b9d | 2013-04-22 16:43:07 +0000 | [diff] [blame] | 277 | toRun, failCount, skipCount); |
commit-bot@chromium.org | 197845a | 2013-04-19 13:24:28 +0000 | [diff] [blame] | 278 | const int testCount = reporter.countTests(); |
commit-bot@chromium.org | ba59d64 | 2013-04-11 16:54:09 +0000 | [diff] [blame] | 279 | if (FLAGS_verbose && testCount > 0) { |
caryclark@google.com | d54e1e9 | 2013-04-10 15:57:31 +0000 | [diff] [blame] | 280 | SkDebugf("Ran %d Internal tests.\n", testCount); |
| 281 | } |
robertphillips@google.com | bdb1be5 | 2012-09-07 18:24:43 +0000 | [diff] [blame] | 282 | #if SK_SUPPORT_GPU |
| 283 | |
| 284 | #if GR_CACHE_STATS |
| 285 | GrContext *gr = GpuTest::GetContext(); |
| 286 | |
| 287 | gr->printCacheStats(); |
| 288 | #endif |
| 289 | |
| 290 | #endif |
| 291 | |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 292 | SkGraphics::Term(); |
bsalomon@google.com | 67b915d | 2013-02-04 16:13:32 +0000 | [diff] [blame] | 293 | GpuTest::DestroyContexts(); |
reed@google.com | a276975 | 2012-07-22 22:33:05 +0000 | [diff] [blame] | 294 | |
bungeman@google.com | 5af16f8 | 2011-09-02 15:06:44 +0000 | [diff] [blame] | 295 | return (failCount == 0) ? 0 : 1; |
reed@android.com | ed67331 | 2009-02-27 16:24:51 +0000 | [diff] [blame] | 296 | } |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 297 | |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 298 | #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 299 | int main(int argc, char * const argv[]) { |
| 300 | return tool_main(argc, (char**) argv); |
| 301 | } |
| 302 | #endif |