coin debugging runs all tests in extended

This extends path ops concidence debugging
to find unused algorithms and determine the extent
of loops.

This verifies that all 140M tests run without error
in release and debug.

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2391733002

patch from issue 2391733002 at patchset 1 (http://crrev.com/2391733002#ps1)

Change-Id: I02ca29764405c5ac3e7ca3b2621fba28dbaaffc2
Reviewed-on: https://skia-review.googlesource.com/2923
Reviewed-by: Cary Clark <caryclark@google.com>
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 9783db8..6f02b0b 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -12,6 +12,7 @@
 #include "SkCommonFlags.h"
 #include "SkGraphics.h"
 #include "SkOSFile.h"
+#include "SkPathOpsDebug.h"
 #include "SkTArray.h"
 #include "SkTaskGroup.h"
 #include "SkTemplates.h"
@@ -27,6 +28,9 @@
 using namespace sk_gpu_test;
 
 DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps.");
+#if DEBUG_COIN
+DEFINE_bool2(coinTest, c, false, "detect unused coincidence algorithms.");
+#endif
 
 // need to explicitly declare this, or we get some weird infinite loop llist
 template TestRegistry* TestRegistry::gHead;
@@ -82,7 +86,7 @@
   void operator()() {
       struct TestReporter : public skiatest::Reporter {
       public:
-          TestReporter() : fError(false), fTestCount(0) {}
+          TestReporter() : fError(false), fTestCount(0), fStats(nullptr) {}
           void bumpTestCount() override { ++fTestCount; }
           bool allowExtendedTest() const override {
               return FLAGS_extendedTest;
@@ -92,6 +96,8 @@
               SkDebugf("\nFAILED: %s", failure.toString().c_str());
               fError = true;
           }
+          void* stats() { return fStats; }
+          void* fStats;
           bool fError;
           int fTestCount;
       } reporter;
@@ -219,6 +225,12 @@
     }
 
     SkDebugf("\n");
+#if DEBUG_COIN
+    if (FLAGS_coinTest) {
+        SkPathOpsDebug::DumpCoinDict();
+    }
+#endif
+
     return (status.failCount() == 0) ? 0 : 1;
 }