Index: tests/Test.cpp |
diff --git a/tests/Test.cpp b/tests/Test.cpp |
index daa23b132cccbebd67e4ab1a7cde4983669a49d6..95b2f91c0cef974a23617c44fb64e46cee611dc2 100644 |
--- a/tests/Test.cpp |
+++ b/tests/Test.cpp |
@@ -7,6 +7,7 @@ |
*/ |
#include "Test.h" |
+#include "SkCommandLineFlags.h" |
#include "SkError.h" |
#include "SkString.h" |
#include "SkTArray.h" |
@@ -19,6 +20,8 @@ |
class GrContext; |
#endif |
+DEFINE_string2(tmpDir, t, NULL, "tmp directory for tests to use."); |
+ |
using namespace skiatest; |
Reporter::Reporter() : fTestCount(0) { |
@@ -114,23 +117,15 @@ void Test::run() { |
} |
-/////////////////////////////////////////////////////////////////////////////// |
+SkString Test::GetTmpDir() { |
+ const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; |
+ return SkString(tmpDir); |
+} |
-#if SK_SUPPORT_GPU |
-#include "GrContextFactory.h" |
-GrContextFactory gGrContextFactory; |
-#endif |
+static const char* gResourcePath = NULL; |
+void Test::SetResourcePath(const char* resourcePath) { gResourcePath = resourcePath; } |
-GrContextFactory* GpuTest::GetGrContextFactory() { |
-#if SK_SUPPORT_GPU |
- return &gGrContextFactory; |
-#else |
- return NULL; |
-#endif |
+SkString Test::GetResourcePath() { |
+ return SkString(gResourcePath); |
} |
-void GpuTest::DestroyContexts() { |
-#if SK_SUPPORT_GPU |
- gGrContextFactory.destroyContexts(); |
-#endif |
-} |