| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
| 9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
| 10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 "'--blacklist gpu skp _ _ 8888 gm _ aarects' will also blacklist the aar
ects GM on 8888."); | 41 "'--blacklist gpu skp _ _ 8888 gm _ aarects' will also blacklist the aar
ects GM on 8888."); |
| 42 | 42 |
| 43 DEFINE_string2(readPath, r, "", "If set check for equality with golden results i
n this directory."); | 43 DEFINE_string2(readPath, r, "", "If set check for equality with golden results i
n this directory."); |
| 44 | 44 |
| 45 DEFINE_string(uninterestingHashesFile, "", | 45 DEFINE_string(uninterestingHashesFile, "", |
| 46 "File containing a list of uninteresting hashes. If a result hashes to s
omething in " | 46 "File containing a list of uninteresting hashes. If a result hashes to s
omething in " |
| 47 "this list, no image is written for that result."); | 47 "this list, no image is written for that result."); |
| 48 | 48 |
| 49 DEFINE_int32(shards, 1, "We're splitting source data into this many shards."); | 49 DEFINE_int32(shards, 1, "We're splitting source data into this many shards."); |
| 50 DEFINE_int32(shard, 0, "Which shard do I run?"); | 50 DEFINE_int32(shard, 0, "Which shard do I run?"); |
| 51 DEFINE_bool2(pre_log, p, false, "Log before running each test. May be incomprehe
nsible when threading"); |
| 51 | 52 |
| 52 __SK_FORCE_IMAGE_DECODER_LINKING; | 53 __SK_FORCE_IMAGE_DECODER_LINKING; |
| 53 using namespace DM; | 54 using namespace DM; |
| 54 | 55 |
| 55 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 56 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
| 56 | 57 |
| 57 SK_DECLARE_STATIC_MUTEX(gFailuresMutex); | 58 SK_DECLARE_STATIC_MUTEX(gFailuresMutex); |
| 58 static SkTArray<SkString> gFailures; | 59 static SkTArray<SkString> gFailures; |
| 59 | 60 |
| 60 static void fail(ImplicitString err) { | 61 static void fail(ImplicitString err) { |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 task->src.options, name.c_str()
); | 460 task->src.options, name.c_str()
); |
| 460 if (!whyBlacklisted.isEmpty()) { | 461 if (!whyBlacklisted.isEmpty()) { |
| 461 note.appendf(" (--blacklist %s)", whyBlacklisted.c_str()); | 462 note.appendf(" (--blacklist %s)", whyBlacklisted.c_str()); |
| 462 } | 463 } |
| 463 SkString log; | 464 SkString log; |
| 464 WallTimer timer; | 465 WallTimer timer; |
| 465 timer.start(); | 466 timer.start(); |
| 466 if (!FLAGS_dryRun && whyBlacklisted.isEmpty()) { | 467 if (!FLAGS_dryRun && whyBlacklisted.isEmpty()) { |
| 467 SkBitmap bitmap; | 468 SkBitmap bitmap; |
| 468 SkDynamicMemoryWStream stream; | 469 SkDynamicMemoryWStream stream; |
| 470 if (FLAGS_pre_log) { |
| 471 SkDebugf("\nRunning %s->%s", name.c_str(), task->sink.tag); |
| 472 } |
| 469 start(task->sink.tag, task->src.tag, task->src.options, name.c_str()
); | 473 start(task->sink.tag, task->src.tag, task->src.options, name.c_str()
); |
| 470 Error err = task->sink->draw(*task->src, &bitmap, &stream, &log); | 474 Error err = task->sink->draw(*task->src, &bitmap, &stream, &log); |
| 471 if (!err.isEmpty()) { | 475 if (!err.isEmpty()) { |
| 472 timer.end(); | 476 timer.end(); |
| 473 if (err.isFatal()) { | 477 if (err.isFatal()) { |
| 474 fail(SkStringPrintf("%s %s %s %s: %s", | 478 fail(SkStringPrintf("%s %s %s %s: %s", |
| 475 task->sink.tag, | 479 task->sink.tag, |
| 476 task->src.tag, | 480 task->src.tag, |
| 477 task->src.options, | 481 task->src.options, |
| 478 name.c_str(), | 482 name.c_str(), |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 bool allowExtendedTest() const override { | 654 bool allowExtendedTest() const override { |
| 651 return FLAGS_pathOpsExtended; | 655 return FLAGS_pathOpsExtended; |
| 652 } | 656 } |
| 653 bool verbose() const override { return FLAGS_veryVerbose; } | 657 bool verbose() const override { return FLAGS_veryVerbose; } |
| 654 } reporter; | 658 } reporter; |
| 655 WallTimer timer; | 659 WallTimer timer; |
| 656 timer.start(); | 660 timer.start(); |
| 657 if (!FLAGS_dryRun) { | 661 if (!FLAGS_dryRun) { |
| 658 start("unit", "test", "", test->name); | 662 start("unit", "test", "", test->name); |
| 659 GrContextFactory factory; | 663 GrContextFactory factory; |
| 664 if (FLAGS_pre_log) { |
| 665 SkDebugf("\nRunning test %s", test->name); |
| 666 } |
| 660 test->proc(&reporter, &factory); | 667 test->proc(&reporter, &factory); |
| 661 } | 668 } |
| 662 timer.end(); | 669 timer.end(); |
| 663 done(timer.fWall, "unit", "test", "", test->name, "", ""); | 670 done(timer.fWall, "unit", "test", "", test->name, "", ""); |
| 664 } | 671 } |
| 665 | 672 |
| 666 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 673 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
| 667 | 674 |
| 668 // If we're isolating all GPU-bound work to one thread (the default), this funct
ion runs all that. | 675 // If we're isolating all GPU-bound work to one thread (the default), this funct
ion runs all that. |
| 669 static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) { | 676 static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 } | 773 } |
| 767 return 0; | 774 return 0; |
| 768 } | 775 } |
| 769 | 776 |
| 770 #if !defined(SK_BUILD_FOR_IOS) | 777 #if !defined(SK_BUILD_FOR_IOS) |
| 771 int main(int argc, char** argv) { | 778 int main(int argc, char** argv) { |
| 772 SkCommandLineFlags::Parse(argc, argv); | 779 SkCommandLineFlags::Parse(argc, argv); |
| 773 return dm_main(); | 780 return dm_main(); |
| 774 } | 781 } |
| 775 #endif | 782 #endif |
| OLD | NEW |