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

Side by Side Diff: dm/DMTestTask.cpp

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note 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 | « dm/DMTestTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMTestTask.h" 1 #include "DMTestTask.h"
2 #include "DMUtil.h" 2 #include "DMUtil.h"
3 #include "SkCommandLineFlags.h" 3 #include "SkCommandLineFlags.h"
4 4
5 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); 5 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests.");
6 DEFINE_bool2(pathOpsSingleThread, z, false, "Disallow pathOps tests from using t hreads."); 6 DEFINE_bool2(pathOpsSingleThread, z, false, "Disallow pathOps tests from using t hreads.");
7 DEFINE_bool2(pathOpsVerbose, V, false, "Tell pathOps tests to be verbose.") ; 7 DEFINE_bool2(pathOpsVerbose, V, false, "Tell pathOps tests to be verbose.") ;
8 8
9 namespace DM { 9 namespace DM {
10 10
11 static SkString test_name(const char* name) {
12 SkString result("test ");
13 result.append(name);
14 return result;
15 }
16
11 TestTask::TestTask(Reporter* reporter, 17 TestTask::TestTask(Reporter* reporter,
12 TaskRunner* taskRunner, 18 TaskRunner* taskRunner,
13 skiatest::TestRegistry::Factory factory) 19 skiatest::TestRegistry::Factory factory)
14 : Task(reporter, taskRunner) 20 : Task(reporter, taskRunner)
15 , fTaskRunner(taskRunner)
16 , fTest(factory(NULL)) 21 , fTest(factory(NULL))
17 , fName(UnderJoin("test", fTest->getName())) {} 22 , fName(test_name(fTest->getName())) {}
18 23
19 void TestTask::draw() { 24 void TestTask::draw() {
20 if (this->usesGpu()) { 25 if (this->usesGpu()) {
21 fTest->setGrContextFactory(fTaskRunner->getGrContextFactory()); 26 fTest->setGrContextFactory(this->getGrContextFactory());
22 } 27 }
23 fTest->setReporter(&fTestReporter); 28 fTest->setReporter(&fTestReporter);
24 fTest->run(); 29 fTest->run();
25 if (!fTest->passed()) { 30 if (!fTest->passed()) {
26 this->fail(fTestReporter.failure()); 31 this->fail(fTestReporter.failure());
27 } 32 }
28 } 33 }
29 34
30 bool TestTask::TestReporter::allowExtendedTest() const { return FLAGS_pathOpsExt ended; } 35 bool TestTask::TestReporter::allowExtendedTest() const { return FLAGS_pathOpsExt ended; }
31 bool TestTask::TestReporter::allowThreaded() const { return !FLAGS_pathOpsSi ngleThread; } 36 bool TestTask::TestReporter::allowThreaded() const { return !FLAGS_pathOpsSi ngleThread; }
32 bool TestTask::TestReporter::verbose() const { return FLAGS_pathOpsVer bose; } 37 bool TestTask::TestReporter::verbose() const { return FLAGS_pathOpsVer bose; }
33 38
34 } // namespace DM 39 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMTestTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698