Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: tests/skia_test.cpp

Issue 143943009: add leaks flag to show unref'd insts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« bench/benchmain.cpp ('K') | « gm/gmmain.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 "Multiple matches may be separated by spaces.\n" \ 25 "Multiple matches may be separated by spaces.\n" \
26 "~ causes a matching test to always be skipped\n" \ 26 "~ causes a matching test to always be skipped\n" \
27 "^ requires the start of the test to match\n" \ 27 "^ requires the start of the test to match\n" \
28 "$ requires the end of the test to match\n" \ 28 "$ requires the end of the test to match\n" \
29 "^ and $ requires an exact match\n" \ 29 "^ and $ requires an exact match\n" \
30 "If a test does not match any list entry,\n" \ 30 "If a test does not match any list entry,\n" \
31 "it is skipped unless some list entry starts with ~"); 31 "it is skipped unless some list entry starts with ~");
32 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); 32 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use.");
33 DEFINE_string2(resourcePath, i, "resources", "directory for test resources."); 33 DEFINE_string2(resourcePath, i, "resources", "directory for test resources.");
34 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); 34 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps.");
35 DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects.");
35 DEFINE_bool2(single, z, false, "run tests on a single thread internally."); 36 DEFINE_bool2(single, z, false, "run tests on a single thread internally.");
36 DEFINE_bool2(verbose, v, false, "enable verbose output."); 37 DEFINE_bool2(verbose, v, false, "enable verbose output.");
37 DEFINE_int32(threads, SkThreadPool::kThreadPerCore, 38 DEFINE_int32(threads, SkThreadPool::kThreadPerCore,
38 "Run threadsafe tests on a threadpool with this many threads."); 39 "Run threadsafe tests on a threadpool with this many threads.");
39 40
40 // need to explicitly declare this, or we get some weird infinite loop llist 41 // need to explicitly declare this, or we get some weird infinite loop llist
41 template TestRegistry* TestRegistry::gHead; 42 template TestRegistry* TestRegistry::gHead;
42 43
43 class Iter { 44 class Iter {
44 public: 45 public:
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 SkAutoTDelete<Test> fTest; 123 SkAutoTDelete<Test> fTest;
123 int32_t* fFailCount; 124 int32_t* fFailCount;
124 }; 125 };
125 126
126 int tool_main(int argc, char** argv); 127 int tool_main(int argc, char** argv);
127 int tool_main(int argc, char** argv) { 128 int tool_main(int argc, char** argv) {
128 SkCommandLineFlags::SetUsage(""); 129 SkCommandLineFlags::SetUsage("");
129 SkCommandLineFlags::Parse(argc, argv); 130 SkCommandLineFlags::Parse(argc, argv);
130 131
131 #if SK_ENABLE_INST_COUNT 132 #if SK_ENABLE_INST_COUNT
132 gPrintInstCount = true; 133 if (FLAGS_leaks) {
134 gPrintInstCount = true;
135 }
133 #endif 136 #endif
134 137
135 SkGraphics::Init(); 138 SkGraphics::Init();
136 139
137 { 140 {
138 SkString header("Skia UnitTests:"); 141 SkString header("Skia UnitTests:");
139 if (!FLAGS_match.isEmpty()) { 142 if (!FLAGS_match.isEmpty()) {
140 header.appendf(" --match"); 143 header.appendf(" --match");
141 for (int index = 0; index < FLAGS_match.count(); ++index) { 144 for (int index = 0; index < FLAGS_match.count(); ++index) {
142 header.appendf(" %s", FLAGS_match[index]); 145 header.appendf(" %s", FLAGS_match[index]);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 215
213 SkDebugf("\n"); 216 SkDebugf("\n");
214 return (failCount == 0) ? 0 : 1; 217 return (failCount == 0) ? 0 : 1;
215 } 218 }
216 219
217 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 220 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
218 int main(int argc, char * const argv[]) { 221 int main(int argc, char * const argv[]) {
219 return tool_main(argc, (char**) argv); 222 return tool_main(argc, (char**) argv);
220 } 223 }
221 #endif 224 #endif
OLDNEW
« bench/benchmain.cpp ('K') | « gm/gmmain.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698