GN: add tests to DM

depends on https://codereview.chromium.org/2202203003 and https://codereview.chromium.org/2208433002

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2203143002

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-GN-Trybot,Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Debug-GN-Trybot,Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release-GN-Trybot,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-GN-Trybot

Review-Url: https://codereview.chromium.org/2203143002
diff --git a/BUILD.gn b/BUILD.gn
index 5ac22ad..3c5251e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -391,6 +391,7 @@
 test_lib("tool_utils") {
   public_include_dirs = [
     "tools",
+    "tools/debugger",
     "tools/timer",
   ]
   sources = [
@@ -400,6 +401,12 @@
     "tools/ProcStats.cpp",
     "tools/Resources.cpp",
     "tools/ThermalManager.cpp",
+    "tools/UrlDataManager.cpp",
+    "tools/debugger/SkDebugCanvas.cpp",
+    "tools/debugger/SkDrawCommand.cpp",
+    "tools/debugger/SkJsonWriteBuffer.cpp",
+    "tools/debugger/SkObjectParser.cpp",
+    "tools/debugger/SkOverdrawMode.cpp",
     "tools/picture_utils.cpp",
     "tools/random_parse_path.cpp",
     "tools/sk_tool_utils.cpp",
@@ -408,6 +415,10 @@
   ]
   deps = [
     ":flags",
+    "//third_party/libpng",
+  ]
+  public_deps = [
+    "//third_party/jsoncpp",
   ]
 }
 
@@ -428,6 +439,34 @@
   ]
 }
 
+tests_sources = exec_script("gyp/find.py",
+                            [
+                              "*.c*",
+                              rebase_path("tests"),
+                            ],
+                            "list lines",
+                            [])
+
+test_lib("tests") {
+  public_include_dirs = [ "tests" ]
+  sources = tests_sources - [
+              rebase_path("tests/FontMgrAndroidParserTest.cpp"),  # Android only
+              rebase_path("tests/PathOpsSkpClipTest.cpp"),  # alternate main
+              rebase_path("tests/RTConfRegistryTest.cpp"),  # TODO: delete
+              rebase_path("tests/SkSLErrorTest.cpp"),   # TODO: make work
+              rebase_path("tests/SkpSkGrTest.cpp"),  # doesn't compile
+              rebase_path("tests/skia_test.cpp"),  # alternate main
+            ]
+  deps = [
+    ":flags",
+    ":gpu_tool_utils",
+    ":skia",
+    ":tool_utils",
+    "//third_party/libpng",
+    "//third_party/zlib",
+  ]
+}
+
 bench_sources = exec_script("gyp/find.py",
                             [
                               "*.c*",
@@ -458,9 +497,6 @@
       "dm/DM.cpp",
       "dm/DMJsonWriter.cpp",
       "dm/DMSrcSink.cpp",
-
-      # TODO: tests for real
-      "tests/Test.cpp",
     ]
     include_dirs = [ "tests" ]
     deps = [
@@ -468,6 +504,7 @@
       ":gm",
       ":gpu_tool_utils",
       ":skia",
+      ":tests",
       ":tool_utils",
       "//third_party/jsoncpp",
       "//third_party/libpng",