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

Side by Side Diff: tests/Test.h

Issue 13983011: Also proxy bumpTestCount. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/Test.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef skiatest_Test_DEFINED 8 #ifndef skiatest_Test_DEFINED
9 #define skiatest_Test_DEFINED 9 #define skiatest_Test_DEFINED
10 10
(...skipping 14 matching lines...) Expand all
25 SK_DECLARE_INST_COUNT(Reporter) 25 SK_DECLARE_INST_COUNT(Reporter)
26 Reporter(); 26 Reporter();
27 27
28 enum Result { 28 enum Result {
29 kPassed, // must begin with 0 29 kPassed, // must begin with 0
30 kFailed, 30 kFailed,
31 ///// 31 /////
32 kLastResult = kFailed 32 kLastResult = kFailed
33 }; 33 };
34 34
35 void bumpTestCount() { sk_atomic_inc(&fTestCount); }
36 int countTests() const { return fTestCount; } 35 int countTests() const { return fTestCount; }
37 36
38 void startTest(Test*); 37 void startTest(Test*);
39 void report(const char testDesc[], Result); 38 void report(const char testDesc[], Result);
40 void endTest(Test*); 39 void endTest(Test*);
40
41 virtual bool allowExtendedTest() const { return false; } 41 virtual bool allowExtendedTest() const { return false; }
42 virtual bool allowThreaded() const { return false; } 42 virtual bool allowThreaded() const { return false; }
43 virtual void bumpTestCount() { sk_atomic_inc(&fTestCount); }
44
43 // helpers for tests 45 // helpers for tests
44 void reportFailed(const char desc[]) { 46 void reportFailed(const char desc[]) {
45 this->report(desc, kFailed); 47 this->report(desc, kFailed);
46 } 48 }
47 void reportFailed(const SkString& desc) { 49 void reportFailed(const SkString& desc) {
48 this->report(desc.c_str(), kFailed); 50 this->report(desc.c_str(), kFailed);
49 } 51 }
50 52
51 53
52 protected: 54 protected:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 do { \ 117 do { \
116 if (!(cond)) { \ 118 if (!(cond)) { \
117 SkString desc; \ 119 SkString desc; \
118 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \ 120 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \
119 r->reportFailed(desc); \ 121 r->reportFailed(desc); \
120 } \ 122 } \
121 } while(0) 123 } while(0)
122 124
123 125
124 #endif 126 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698