[Open Screen] Some BUILD.gn cleanups.

- Ensure all source_set and executable targets are part of gn_all
- Give various demo executables unique names
- Consistent naming for unittests

This will mean we only need to build gn_all and openscreen_unittests in our build recipe.

Change-Id: Ie0095f900471bfcea02c3f2c708424f463772414
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1809004
Reviewed-by: Max Yakimakha <yakimakha@chromium.org>
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 08fa796..4ce21ff 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -10,10 +10,17 @@
 group("gn_all") {
   deps = [
     "cast/common:mdns",
+    "cast/common/certificate",
+    "cast/sender/channel",
     "osp",
     "osp/msgs",
     "platform",
+    "platform:default_logger",
+    "streaming/cast:receiver",
+    "streaming/cast:sender",
     "third_party/abseil",
+    "third_party/boringssl",
+    "third_party/jsoncpp",
     "third_party/protobuf:protoc",
     "third_party/tinycbor",
     "third_party/zlib",
@@ -22,41 +29,45 @@
   ]
 
   if (use_mdns_responder) {
-    deps += [ "osp/impl/discovery/mdns:embedder_demo" ]
+    deps += [ "osp/impl/discovery/mdns:mdns_demo" ]
   }
 
   if (use_chromium_quic) {
     deps += [
       "third_party/chromium_quic",
-      "third_party/chromium_quic:demo_client",
-      "third_party/chromium_quic:demo_server",
+      "third_party/chromium_quic:quic_demo_client",
+      "third_party/chromium_quic:quic_demo_server",
     ]
   }
+
+  if (use_chromium_quic && use_mdns_responder) {
+    deps += [ "osp:osp_demo" ]
+  }
 }
 
 executable("openscreen_unittests") {
   testonly = true
   deps = [
-    "cast/common:mdns_unittests",
+    "cast/common:unittests",
     "cast/common/certificate:unittests",
     "cast/sender/channel:unittests",
-    "osp:osp_unittests",
-    "osp/impl/discovery/mdns:mdns_unittests",
+    "osp:unittests",
+    "osp/impl/discovery/mdns:unittests",
     "osp/msgs:unittests",
-    "platform:platform_unittests",
-    "streaming/cast:cast_unittests",
+    "platform:unittests",
+    "streaming/cast:unittests",
     "third_party/abseil",
     "third_party/googletest:gtest_main",
-    "util:util_unittests",
+    "util:unittests",
   ]
 }
 
+# Note: Remove this after demo is removed from the build recipe.
 if (use_chromium_quic && use_mdns_responder) {
   executable("demo") {
     sources = [
-      "osp/demo/demo.cc",
+      "osp/demo/osp_demo.cc",
     ]
-
     deps = [
       "//osp:osp_with_chromium_quic",
       "//osp/impl/discovery/mdns",
diff --git a/cast/common/BUILD.gn b/cast/common/BUILD.gn
index e066017..465ac24 100644
--- a/cast/common/BUILD.gn
+++ b/cast/common/BUILD.gn
@@ -30,7 +30,7 @@
   configs += [ "../../build:allow_build_from_embedder" ]
 }
 
-source_set("mdns_unittests") {
+source_set("unittests") {
   testonly = true
 
   sources = [
diff --git a/osp/BUILD.gn b/osp/BUILD.gn
index 8bdca4e..d34b18b 100644
--- a/osp/BUILD.gn
+++ b/osp/BUILD.gn
@@ -25,7 +25,7 @@
   }
 }
 
-source_set("osp_unittests") {
+source_set("unittests") {
   testonly = true
 
   sources = [
@@ -52,7 +52,6 @@
     "impl",
     "impl/quic:test_support",
     "impl/testing",
-    "impl/testing:fakes_unittests",
     "public",
     "public:test_support",
   ]
@@ -61,3 +60,17 @@
     sources += [ "impl/mdns_responder_service_unittest.cc" ]
   }
 }
+
+if (use_chromium_quic && use_mdns_responder) {
+  executable("osp_demo") {
+    sources = [
+      "demo/osp_demo.cc",
+    ]
+    deps = [
+      ":osp_with_chromium_quic",
+      "//osp/impl/discovery/mdns",
+      "//platform",
+      "//util",
+    ]
+  }
+}
diff --git a/osp/demo/README.md b/osp/demo/README.md
index 96acd75..50637ca 100644
--- a/osp/demo/README.md
+++ b/osp/demo/README.md
@@ -10,7 +10,7 @@
 line options affect the behavior.  The command line options are:
 
 ``` bash
-    $ demo [-v] [friendly_name]
+    $ osp_demo [-v] [friendly_name]
 ```
 
  - `-v` enables verbose logging.
diff --git a/osp/demo/demo.cc b/osp/demo/osp_demo.cc
similarity index 99%
rename from osp/demo/demo.cc
rename to osp/demo/osp_demo.cc
index 3966bc4..7979f1b 100644
--- a/osp/demo/demo.cc
+++ b/osp/demo/osp_demo.cc
@@ -594,7 +594,7 @@
 int main(int argc, char** argv) {
   using openscreen::platform::LogLevel;
 
-  std::cout << "Usage: demo [-v] [friendly_name]" << std::endl
+  std::cout << "Usage: osp_demo [-v] [friendly_name]" << std::endl
             << "-v: enable more verbose logging" << std::endl
             << "friendly_name: server name, runs the publisher demo."
             << std::endl
diff --git a/osp/impl/discovery/mdns/BUILD.gn b/osp/impl/discovery/mdns/BUILD.gn
index 6da373f..ab9633c 100644
--- a/osp/impl/discovery/mdns/BUILD.gn
+++ b/osp/impl/discovery/mdns/BUILD.gn
@@ -18,7 +18,7 @@
   ]
 }
 
-source_set("mdns_unittests") {
+source_set("unittests") {
   testonly = true
 
   sources = [
@@ -38,9 +38,9 @@
 }
 
 if (use_mdns_responder) {
-  executable("embedder_demo") {
+  executable("mdns_demo") {
     sources = [
-      "embedder_demo.cc",
+      "mdns_demo.cc",
     ]
 
     deps = [
diff --git a/osp/impl/discovery/mdns/embedder_demo.cc b/osp/impl/discovery/mdns/mdns_demo.cc
similarity index 99%
rename from osp/impl/discovery/mdns/embedder_demo.cc
rename to osp/impl/discovery/mdns/mdns_demo.cc
index 10baacb..326cf7f 100644
--- a/osp/impl/discovery/mdns/embedder_demo.cc
+++ b/osp/impl/discovery/mdns/mdns_demo.cc
@@ -23,7 +23,7 @@
 // This file contains a demo of our mDNSResponder wrapper code.  It can both
 // listen for mDNS services and advertise an mDNS service.  The command-line
 // usage is:
-//   embedder_demo [service_type] [service_instance_name]
+//   mdns_demo [service_type] [service_instance_name]
 // service_type defaults to '_openscreen._udp' and service_instance_name
 // defaults to ''.  service_type determines services the program listens for and
 // when service_instance_name is not empty, a service of
diff --git a/osp/impl/testing/BUILD.gn b/osp/impl/testing/BUILD.gn
index 4c0f642..2917685 100644
--- a/osp/impl/testing/BUILD.gn
+++ b/osp/impl/testing/BUILD.gn
@@ -17,7 +17,7 @@
   ]
 }
 
-source_set("fakes_unittests") {
+source_set("unittests") {
   testonly = true
   sources = [
     "fake_mdns_platform_service_unittest.cc",
diff --git a/platform/BUILD.gn b/platform/BUILD.gn
index a5dc8bd..cad5288 100644
--- a/platform/BUILD.gn
+++ b/platform/BUILD.gn
@@ -147,7 +147,7 @@
   ]
 }
 
-source_set("platform_unittests") {
+source_set("unittests") {
   testonly = true
 
   sources = [
diff --git a/streaming/cast/BUILD.gn b/streaming/cast/BUILD.gn
index f4f9fa8..f8b9fcd 100644
--- a/streaming/cast/BUILD.gn
+++ b/streaming/cast/BUILD.gn
@@ -95,7 +95,7 @@
   ]
 }
 
-source_set("cast_unittests") {
+source_set("unittests") {
   testonly = true
 
   sources = [
@@ -206,7 +206,7 @@
 # standalone, non-embedder //platform implementation; since they *are* the whole
 # application.
 if (!build_with_chromium) {
-  executable("receiver_demo") {
+  executable("streaming_receiver_demo") {
     sources = [
       "receiver_demo/main.cc",
     ]
diff --git a/third_party/chromium_quic/BUILD.gn b/third_party/chromium_quic/BUILD.gn
index 9971472..c8506fc 100644
--- a/third_party/chromium_quic/BUILD.gn
+++ b/third_party/chromium_quic/BUILD.gn
@@ -56,7 +56,7 @@
   ]
 }
 
-executable("demo_client") {
+executable("quic_demo_client") {
   sources = [
     "demo/client.cc",
     "demo/delegates.cc",
@@ -69,7 +69,7 @@
   configs += [ ":chromium_quic_config" ]
 }
 
-executable("demo_server") {
+executable("quic_demo_server") {
   sources = [
     "demo/delegates.cc",
     "demo/delegates.h",
diff --git a/util/BUILD.gn b/util/BUILD.gn
index 95da0ce..288de0f 100644
--- a/util/BUILD.gn
+++ b/util/BUILD.gn
@@ -39,7 +39,7 @@
   configs += [ "../build:allow_build_from_embedder" ]
 }
 
-source_set("util_unittests") {
+source_set("unittests") {
   testonly = true
 
   sources = [