OLD | NEW |
1 #include "CrashHandler.h" | 1 #include "CrashHandler.h" |
2 #include "DMJsonWriter.h" | 2 #include "DMJsonWriter.h" |
3 #include "DMSrcSink.h" | 3 #include "DMSrcSink.h" |
4 #include "DMSrcSinkAndroid.h" | 4 #include "DMSrcSinkAndroid.h" |
5 #include "OverwriteLine.h" | 5 #include "OverwriteLine.h" |
6 #include "ProcStats.h" | 6 #include "ProcStats.h" |
7 #include "SkBBHFactory.h" | 7 #include "SkBBHFactory.h" |
8 #include "SkChecksum.h" | 8 #include "SkChecksum.h" |
9 #include "SkCommonFlags.h" | 9 #include "SkCommonFlags.h" |
10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
11 #include "SkGraphics.h" | 11 #include "SkGraphics.h" |
12 #include "SkInstCnt.h" | 12 #include "SkInstCnt.h" |
13 #include "SkMD5.h" | 13 #include "SkMD5.h" |
14 #include "SkOSFile.h" | 14 #include "SkOSFile.h" |
15 #include "SkTHash.h" | 15 #include "SkTHash.h" |
16 #include "SkTaskGroup.h" | 16 #include "SkTaskGroup.h" |
| 17 #include "SkThreadUtils.h" |
17 #include "Test.h" | 18 #include "Test.h" |
18 #include "Timer.h" | 19 #include "Timer.h" |
19 | 20 |
20 DEFINE_string(src, "tests gm skp image subset", "Source types to test."); | 21 DEFINE_string(src, "tests gm skp image subset", "Source types to test."); |
21 DEFINE_bool(nameByHash, false, | 22 DEFINE_bool(nameByHash, false, |
22 "If true, write to FLAGS_writePath[0]/<hash>.png instead of " | 23 "If true, write to FLAGS_writePath[0]/<hash>.png instead of " |
23 "to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png"); | 24 "to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png"); |
24 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); | 25 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); |
25 DEFINE_string(matrix, "1 0 0 1", | 26 DEFINE_string(matrix, "1 0 0 1", |
26 "2x2 scale+skew matrix to apply or upright when using " | 27 "2x2 scale+skew matrix to apply or upright when using " |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 509 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
509 | 510 |
510 // If we're isolating all GPU-bound work to one thread (the default), this funct
ion runs all that. | 511 // If we're isolating all GPU-bound work to one thread (the default), this funct
ion runs all that. |
511 static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) { | 512 static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) { |
512 run_enclave(tasks); | 513 run_enclave(tasks); |
513 for (int i = 0; i < gGPUTests.count(); i++) { | 514 for (int i = 0; i < gGPUTests.count(); i++) { |
514 run_test(&gGPUTests[i]); | 515 run_test(&gGPUTests[i]); |
515 } | 516 } |
516 } | 517 } |
517 | 518 |
| 519 // Some runs (mostly, Valgrind) are so slow that the bot framework thinks we've
hung. |
| 520 // This prints something every once in a while so that it knows we're still work
ing. |
| 521 static void keep_alive(void*) { |
| 522 for (;;) { |
| 523 static const int kSec = 300; |
| 524 #if defined(SK_BUILD_FOR_WIN) |
| 525 Sleep(kSec * 1000); |
| 526 #else |
| 527 sleep(kSec); |
| 528 #endif |
| 529 SkDebugf("\nStill alive: doing science, reticulating splines...\n"); |
| 530 } |
| 531 } |
| 532 |
518 int dm_main(); | 533 int dm_main(); |
519 int dm_main() { | 534 int dm_main() { |
520 SetupCrashHandler(); | 535 SetupCrashHandler(); |
521 SkAutoGraphics ag; | 536 SkAutoGraphics ag; |
522 SkTaskGroup::Enabler enabled(FLAGS_threads); | 537 SkTaskGroup::Enabler enabled(FLAGS_threads); |
523 if (FLAGS_leaks) { | 538 if (FLAGS_leaks) { |
524 SkInstCountPrintLeaksOnExit(); | 539 SkInstCountPrintLeaksOnExit(); |
525 } | 540 } |
526 | 541 |
| 542 SkThread keepAlive(keep_alive); // This thread will just be killed by proce
sses shutdown. |
| 543 keepAlive.start(); |
| 544 |
527 gather_gold(); | 545 gather_gold(); |
528 | 546 |
529 gather_srcs(); | 547 gather_srcs(); |
530 gather_sinks(); | 548 gather_sinks(); |
531 gather_tests(); | 549 gather_tests(); |
532 | 550 |
533 gPending = gSrcs.count() * gSinks.count() + gThreadedTests.count() + gGPUTes
ts.count(); | 551 gPending = gSrcs.count() * gSinks.count() + gThreadedTests.count() + gGPUTes
ts.count(); |
534 SkDebugf("%d srcs * %d sinks + %d tests == %d tasks\n", | 552 SkDebugf("%d srcs * %d sinks + %d tests == %d tasks\n", |
535 gSrcs.count(), gSinks.count(), gThreadedTests.count() + gGPUTests.c
ount(), gPending); | 553 gSrcs.count(), gSinks.count(), gThreadedTests.count() + gGPUTests.c
ount(), gPending); |
536 | 554 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 } | 596 } |
579 return 0; | 597 return 0; |
580 } | 598 } |
581 | 599 |
582 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 600 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
583 int main(int argc, char** argv) { | 601 int main(int argc, char** argv) { |
584 SkCommandLineFlags::Parse(argc, argv); | 602 SkCommandLineFlags::Parse(argc, argv); |
585 return dm_main(); | 603 return dm_main(); |
586 } | 604 } |
587 #endif | 605 #endif |
OLD | NEW |