| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
| 9 #include "SkGraphics.h" | 9 #include "SkGraphics.h" |
| 10 #include "SkRunnable.h" | 10 #include "SkRunnable.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 const SkString& Test::GetResourcePath() { | 134 const SkString& Test::GetResourcePath() { |
| 135 return gResourcePath; | 135 return gResourcePath; |
| 136 } | 136 } |
| 137 | 137 |
| 138 DEFINE_string2(match, m, NULL, "substring of test name to run."); | 138 DEFINE_string2(match, m, NULL, "substring of test name to run."); |
| 139 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); | 139 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); |
| 140 DEFINE_string2(resourcePath, i, NULL, "directory for test resources."); | 140 DEFINE_string2(resourcePath, i, NULL, "directory for test resources."); |
| 141 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); | 141 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); |
| 142 DEFINE_bool2(threaded, z, false, "allow tests to use multiple threads internally
."); | 142 DEFINE_bool2(threaded, z, false, "allow tests to use multiple threads internally
."); |
| 143 DEFINE_bool2(verbose, v, false, "enable verbose output."); | 143 DEFINE_bool2(verbose, v, false, "enable verbose output."); |
| 144 DEFINE_int32(threads, 8, | 144 DEFINE_int32(threads, SkThreadPool::kThreadPerCore, |
| 145 "If >0, run threadsafe tests on a threadpool with this many threads
."); | 145 "Run threadsafe tests on a threadpool with this many threads."); |
| 146 | 146 |
| 147 // Deletes self when run. | 147 // Deletes self when run. |
| 148 class SkTestRunnable : public SkRunnable { | 148 class SkTestRunnable : public SkRunnable { |
| 149 public: | 149 public: |
| 150 // Takes ownership of test. | 150 // Takes ownership of test. |
| 151 SkTestRunnable(Test* test, int32_t* failCount) : fTest(test), fFailCount(failC
ount) {} | 151 SkTestRunnable(Test* test, int32_t* failCount) : fTest(test), fFailCount(failC
ount) {} |
| 152 | 152 |
| 153 virtual void run() { | 153 virtual void run() { |
| 154 fTest->run(); | 154 fTest->run(); |
| 155 if(!fTest->passed()) { | 155 if(!fTest->passed()) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 GpuTest::DestroyContexts(); | 254 GpuTest::DestroyContexts(); |
| 255 | 255 |
| 256 return (failCount == 0) ? 0 : 1; | 256 return (failCount == 0) ? 0 : 1; |
| 257 } | 257 } |
| 258 | 258 |
| 259 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 259 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 260 int main(int argc, char * const argv[]) { | 260 int main(int argc, char * const argv[]) { |
| 261 return tool_main(argc, (char**) argv); | 261 return tool_main(argc, (char**) argv); |
| 262 } | 262 } |
| 263 #endif | 263 #endif |
| OLD | NEW |