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 "SkOSFile.h" | 10 #include "SkOSFile.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 "Multiple matches may be separated by spaces.\n"
\ | 118 "Multiple matches may be separated by spaces.\n"
\ |
119 "~ causes a matching test to always be skipped\n"
\ | 119 "~ causes a matching test to always be skipped\n"
\ |
120 "^ requires the start of the test to match\n" \ | 120 "^ requires the start of the test to match\n" \ |
121 "$ requires the end of the test to match\n" \ | 121 "$ requires the end of the test to match\n" \ |
122 "^ and $ requires an exact match\n" \ | 122 "^ and $ requires an exact match\n" \ |
123 "If a test does not match any list entry,\n" \ | 123 "If a test does not match any list entry,\n" \ |
124 "it is skipped unless some list entry starts with
~"); | 124 "it is skipped unless some list entry starts with
~"); |
125 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); | 125 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); |
126 DEFINE_string2(resourcePath, i, NULL, "directory for test resources."); | 126 DEFINE_string2(resourcePath, i, NULL, "directory for test resources."); |
127 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); | 127 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); |
128 DEFINE_bool2(threaded, z, false, "allow tests to use multiple threads internally
."); | 128 DEFINE_bool2(single, z, false, "run tests on a single thread internally."); |
129 DEFINE_bool2(verbose, v, false, "enable verbose output."); | 129 DEFINE_bool2(verbose, v, false, "enable verbose output."); |
130 DEFINE_int32(threads, SkThreadPool::kThreadPerCore, | 130 DEFINE_int32(threads, SkThreadPool::kThreadPerCore, |
131 "Run threadsafe tests on a threadpool with this many threads."); | 131 "Run threadsafe tests on a threadpool with this many threads."); |
132 | 132 |
133 SkString Test::GetTmpDir() { | 133 SkString Test::GetTmpDir() { |
134 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; | 134 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; |
135 return SkString(tmpDir); | 135 return SkString(tmpDir); |
136 } | 136 } |
137 | 137 |
138 SkString Test::GetResourcePath() { | 138 SkString Test::GetResourcePath() { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 header.append(" SK_RELEASE"); | 230 header.append(" SK_RELEASE"); |
231 #endif | 231 #endif |
232 #ifdef SK_SCALAR_IS_FIXED | 232 #ifdef SK_SCALAR_IS_FIXED |
233 header.append(" SK_SCALAR_IS_FIXED"); | 233 header.append(" SK_SCALAR_IS_FIXED"); |
234 #else | 234 #else |
235 header.append(" SK_SCALAR_IS_FLOAT"); | 235 header.append(" SK_SCALAR_IS_FLOAT"); |
236 #endif | 236 #endif |
237 SkDebugf("%s\n", header.c_str()); | 237 SkDebugf("%s\n", header.c_str()); |
238 } | 238 } |
239 | 239 |
240 DebugfReporter reporter(FLAGS_extendedTest, FLAGS_threaded, FLAGS_verbose); | 240 DebugfReporter reporter(FLAGS_extendedTest, !FLAGS_single, FLAGS_verbose); |
241 Iter iter(&reporter); | 241 Iter iter(&reporter); |
242 | 242 |
243 // Count tests first. | 243 // Count tests first. |
244 int total = 0; | 244 int total = 0; |
245 int toRun = 0; | 245 int toRun = 0; |
246 Test* test; | 246 Test* test; |
247 while ((test = iter.next()) != NULL) { | 247 while ((test = iter.next()) != NULL) { |
248 SkAutoTDelete<Test> owned(test); | 248 SkAutoTDelete<Test> owned(test); |
249 if(!shouldSkip(test->getName())) { | 249 if(!shouldSkip(test->getName())) { |
250 toRun++; | 250 toRun++; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 GpuTest::DestroyContexts(); | 299 GpuTest::DestroyContexts(); |
300 | 300 |
301 return (failCount == 0) ? 0 : 1; | 301 return (failCount == 0) ? 0 : 1; |
302 } | 302 } |
303 | 303 |
304 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 304 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
305 int main(int argc, char * const argv[]) { | 305 int main(int argc, char * const argv[]) { |
306 return tool_main(argc, (char**) argv); | 306 return tool_main(argc, (char**) argv); |
307 } | 307 } |
308 #endif | 308 #endif |
OLD | NEW |