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

Side by Side Diff: tests/Test.h

Issue 144343004: Add --skip_cpu and --skip_gpu options to tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove isThreadsafe() Created 6 years, 10 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
« no previous file with comments | « no previous file | tests/skia_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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 const char* getName(); 58 const char* getName();
59 void run(); 59 void run();
60 bool passed() const { return fPassed; } 60 bool passed() const { return fPassed; }
61 SkMSec elapsedMs() const { return fElapsed; } 61 SkMSec elapsedMs() const { return fElapsed; }
62 62
63 static SkString GetTmpDir(); 63 static SkString GetTmpDir();
64 64
65 static SkString GetResourcePath(); 65 static SkString GetResourcePath();
66 66
67 virtual bool isThreadsafe() const { return true; } 67 virtual bool isGPUTest() const { return false; }
68 68
69 protected: 69 protected:
70 virtual void onGetName(SkString*) = 0; 70 virtual void onGetName(SkString*) = 0;
71 virtual void onRun(Reporter*) = 0; 71 virtual void onRun(Reporter*) = 0;
72 72
73 private: 73 private:
74 Reporter* fReporter; 74 Reporter* fReporter;
75 SkString fName; 75 SkString fName;
76 bool fPassed; 76 bool fPassed;
77 SkMSec fElapsed; 77 SkMSec fElapsed;
78 }; 78 };
79 79
80 class GpuTest : public Test{ 80 class GpuTest : public Test{
81 public: 81 public:
82 GpuTest() : Test() {} 82 GpuTest() : Test() {}
83 static GrContextFactory* GetGrContextFactory(); 83 static GrContextFactory* GetGrContextFactory();
84 static void DestroyContexts(); 84 static void DestroyContexts();
85 virtual bool isThreadsafe() const { return false; } 85 virtual bool isGPUTest() const { return true; }
86 private: 86 private:
87 }; 87 };
88 88
89 typedef SkTRegistry<Test*(*)(void*)> TestRegistry; 89 typedef SkTRegistry<Test*(*)(void*)> TestRegistry;
90 } // namespace skiatest 90 } // namespace skiatest
91 91
92 /* 92 /*
93 Use the following macros to make use of the skiatest classes, e.g. 93 Use the following macros to make use of the skiatest classes, e.g.
94 94
95 #include "Test.h" 95 #include "Test.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } \ 163 } \
164 virtual void onRun(Reporter* r) SK_OVERRIDE { \ 164 virtual void onRun(Reporter* r) SK_OVERRIDE { \
165 name(r, GetGrContextFactory()); \ 165 name(r, GetGrContextFactory()); \
166 } \ 166 } \
167 }; \ 167 }; \
168 static TestRegistry gReg_##name##Class(name##Class::Factory); \ 168 static TestRegistry gReg_##name##Class(name##Class::Factory); \
169 } \ 169 } \
170 static void name(skiatest::Reporter* reporter, GrContextFactory* factory) 170 static void name(skiatest::Reporter* reporter, GrContextFactory* factory)
171 171
172 #endif 172 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/skia_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698