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

Side by Side Diff: tests/Test.cpp

Issue 179403010: Revert of Let DM run unit tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « tests/Test.h ('k') | 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 #include "Test.h" 8 #include "Test.h"
9 9
10 #include "SkCommandLineFlags.h"
11 #include "SkError.h" 10 #include "SkError.h"
12 #include "SkString.h" 11 #include "SkString.h"
13 #include "SkTArray.h" 12 #include "SkTArray.h"
14 #include "SkTime.h" 13 #include "SkTime.h"
15 14
16 #if SK_SUPPORT_GPU 15 #if SK_SUPPORT_GPU
17 #include "GrContext.h" 16 #include "GrContext.h"
18 #include "gl/SkNativeGLContext.h" 17 #include "gl/SkNativeGLContext.h"
19 #else 18 #else
20 class GrContext; 19 class GrContext;
21 #endif 20 #endif
22 21
23 DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use.");
24
25 using namespace skiatest; 22 using namespace skiatest;
26 23
27 Reporter::Reporter() : fTestCount(0) { 24 Reporter::Reporter() : fTestCount(0) {
28 } 25 }
29 26
30 void Reporter::startTest(Test* test) { 27 void Reporter::startTest(Test* test) {
31 this->bumpTestCount(); 28 this->bumpTestCount();
32 this->onStart(test); 29 this->onStart(test);
33 } 30 }
34 31
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 fElapsed = SkTime::GetMSecs() - start; 107 fElapsed = SkTime::GetMSecs() - start;
111 108
112 // Now tell fReporter about any failures and wrap up. 109 // Now tell fReporter about any failures and wrap up.
113 for (int i = 0; i < local.numFailures(); i++) { 110 for (int i = 0; i < local.numFailures(); i++) {
114 fReporter->reportFailed(local.failure(i)); 111 fReporter->reportFailed(local.failure(i));
115 } 112 }
116 fReporter->endTest(this); 113 fReporter->endTest(this);
117 114
118 } 115 }
119 116
120 SkString Test::GetTmpDir() { 117 ///////////////////////////////////////////////////////////////////////////////
121 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; 118
122 return SkString(tmpDir); 119 #if SK_SUPPORT_GPU
120 #include "GrContextFactory.h"
121 GrContextFactory gGrContextFactory;
122 #endif
123
124 GrContextFactory* GpuTest::GetGrContextFactory() {
125 #if SK_SUPPORT_GPU
126 return &gGrContextFactory;
127 #else
128 return NULL;
129 #endif
123 } 130 }
124 131
125 static const char* gResourcePath = NULL; 132 void GpuTest::DestroyContexts() {
126 void Test::SetResourcePath(const char* resourcePath) { gResourcePath = resourceP ath; } 133 #if SK_SUPPORT_GPU
127 134 gGrContextFactory.destroyContexts();
128 SkString Test::GetResourcePath() { 135 #endif
129 return SkString(gResourcePath);
130 } 136 }
131
OLDNEW
« no previous file with comments | « tests/Test.h ('k') | tests/skia_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698