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 "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 #include "OverwriteLine.h" | 9 #include "OverwriteLine.h" |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int test_main(); | 118 int test_main(); |
119 int test_main() { | 119 int test_main() { |
120 SetupCrashHandler(); | 120 SetupCrashHandler(); |
121 | 121 |
122 #if SK_ENABLE_INST_COUNT | 122 #if SK_ENABLE_INST_COUNT |
123 if (FLAGS_leaks) { | 123 if (FLAGS_leaks) { |
124 gPrintInstCount = true; | 124 gPrintInstCount = true; |
125 } | 125 } |
126 #endif | 126 #endif |
127 | 127 |
128 SkGraphics::Init(); | 128 SkAutoGraphics ag; |
129 | 129 |
130 { | 130 { |
131 SkString header("Skia UnitTests:"); | 131 SkString header("Skia UnitTests:"); |
132 if (!FLAGS_match.isEmpty()) { | 132 if (!FLAGS_match.isEmpty()) { |
133 header.appendf(" --match"); | 133 header.appendf(" --match"); |
134 for (int index = 0; index < FLAGS_match.count(); ++index) { | 134 for (int index = 0; index < FLAGS_match.count(); ++index) { |
135 header.appendf(" %s", FLAGS_match[index]); | 135 header.appendf(" %s", FLAGS_match[index]); |
136 } | 136 } |
137 } | 137 } |
138 SkString tmpDir = Test::GetTmpDir(); | 138 SkString tmpDir = Test::GetTmpDir(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 SkNEW_ARGS(SkTestRunnable, (gpuTests[i], &failCount))->run(); | 204 SkNEW_ARGS(SkTestRunnable, (gpuTests[i], &failCount))->run(); |
205 } | 205 } |
206 | 206 |
207 // Block until threaded tests finish. | 207 // Block until threaded tests finish. |
208 cpuTests.wait(); | 208 cpuTests.wait(); |
209 | 209 |
210 if (FLAGS_verbose) { | 210 if (FLAGS_verbose) { |
211 SkDebugf("\nFinished %d tests, %d failures, %d skipped. (%d internal tes
ts)", | 211 SkDebugf("\nFinished %d tests, %d failures, %d skipped. (%d internal tes
ts)", |
212 toRun, failCount, skipCount, reporter.countTests()); | 212 toRun, failCount, skipCount, reporter.countTests()); |
213 } | 213 } |
214 SkGraphics::Term(); | |
215 | 214 |
216 SkDebugf("\n"); | 215 SkDebugf("\n"); |
217 return (failCount == 0) ? 0 : 1; | 216 return (failCount == 0) ? 0 : 1; |
218 } | 217 } |
219 | 218 |
220 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 219 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
221 int main(int argc, char** argv) { | 220 int main(int argc, char** argv) { |
222 SkCommandLineFlags::Parse(argc, argv); | 221 SkCommandLineFlags::Parse(argc, argv); |
223 return test_main(); | 222 return test_main(); |
224 } | 223 } |
225 #endif | 224 #endif |
OLD | NEW |