Index: dm/DMTestTask.cpp |
diff --git a/dm/DMTestTask.cpp b/dm/DMTestTask.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9fbe1538bd17e8cff9aff7b744239cd314f0423e |
--- /dev/null |
+++ b/dm/DMTestTask.cpp |
@@ -0,0 +1,30 @@ |
+#include "DMTestTask.h" |
+#include "DMUtil.h" |
+#include "SkCommandLineFlags.h" |
+ |
+DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); |
+DEFINE_bool2(pathOpsSingleThread, z, false, "Disallow pathOps tests from using threads."); |
+DEFINE_bool2(pathOpsVerbose, V, false, "Tell pathOps tests to be verbose."); |
+ |
+namespace DM { |
+ |
+TestTask::TestTask(Reporter* reporter, |
+ TaskRunner* tasks, |
+ skiatest::TestRegistry::Factory factory) |
+ : Task(reporter, tasks) |
+ , fTest(factory(NULL)) |
+ , fName(UnderJoin("test", fTest->getName())) {} |
+ |
+void TestTask::draw() { |
+ fTest->setReporter(&fTestReporter); |
+ fTest->run(); |
+ if (!fTest->passed()) { |
+ this->fail(fTestReporter.failure()); |
+ } |
+} |
+ |
+bool TestTask::TestReporter::allowExtendedTest() const { return FLAGS_pathOpsExtended; } |
+bool TestTask::TestReporter::allowThreaded() const { return !FLAGS_pathOpsSingleThread; } |
+bool TestTask::TestReporter::verbose() const { return FLAGS_pathOpsVerbose; } |
+ |
+} // namespace DM |