aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Test.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-25 20:02:09 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-25 20:02:09 +0000
commit79e13260cf94427e6ccbfff8242bf85ed4c8187b (patch)
treedecbb335453684fcbe0c9dff854c2b1968226d8a /tests/Test.cpp
parent6bd250a2a340348434b7b16bd4e4b5da0f598e3e (diff)
Revert of Let DM run unit tests. (https://codereview.chromium.org/178273002/)
Reason for revert: broke tests Original issue's description: > Let DM run unit tests. > - refactor GYPs and a few flags > - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs > - add a few more UI features to make DM more like tests > > I believe this makes the program 'tests' obsolete. > > It should be somewhat faster to run the two sets together than running the old binaries serially: > - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU) > - together: 27s (6m21s CPU) > > Next up is to incorporate benches. I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet. > > Tested: out/Debug/tests && out/Debug/dm && echo ok > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=13586 R=bsalomon@google.com, mtklein@google.com, tfarina@chromium.org, mtklein@chromium.org TBR=bsalomon@google.com, mtklein@chromium.org, mtklein@google.com, tfarina@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@google.com Review URL: https://codereview.chromium.org/179403010 git-svn-id: http://skia.googlecode.com/svn/trunk@13587 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/Test.cpp')
-rw-r--r--tests/Test.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/Test.cpp b/tests/Test.cpp
index 95b2f91c0c..daa23b132c 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -7,7 +7,6 @@
*/
#include "Test.h"
-#include "SkCommandLineFlags.h"
#include "SkError.h"
#include "SkString.h"
#include "SkTArray.h"
@@ -20,8 +19,6 @@
class GrContext;
#endif
-DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use.");
-
using namespace skiatest;
Reporter::Reporter() : fTestCount(0) {
@@ -117,15 +114,23 @@ void Test::run() {
}
-SkString Test::GetTmpDir() {
- const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0];
- return SkString(tmpDir);
-}
+///////////////////////////////////////////////////////////////////////////////
-static const char* gResourcePath = NULL;
-void Test::SetResourcePath(const char* resourcePath) { gResourcePath = resourcePath; }
+#if SK_SUPPORT_GPU
+#include "GrContextFactory.h"
+GrContextFactory gGrContextFactory;
+#endif
-SkString Test::GetResourcePath() {
- return SkString(gResourcePath);
+GrContextFactory* GpuTest::GetGrContextFactory() {
+#if SK_SUPPORT_GPU
+ return &gGrContextFactory;
+#else
+ return NULL;
+#endif
}
+void GpuTest::DestroyContexts() {
+#if SK_SUPPORT_GPU
+ gGrContextFactory.destroyContexts();
+#endif
+}