| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| source_set("lib") { |
| sources = [ |
| "echo_connection.cc", |
| "echo_connection.h", |
| "example_server_app.cc", |
| "example_server_app.h", |
| ] |
| |
| public_deps = [ |
| "//garnet/examples/fidl/services:echo", |
| "//garnet/public/lib/inspect:component", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "example_server" |
| |
| sources = [ |
| "example_server.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/public/lib/async-default", |
| "//zircon/public/lib/async-loop-cpp", |
| ] |
| } |
| |
| executable("client") { |
| output_name = "example_client" |
| |
| sources = [ |
| "example_client.cc", |
| ] |
| |
| deps = [ |
| "//garnet/examples/fidl/services:echo", |
| "//src/lib/files", |
| "//zircon/public/lib/fdio", |
| ] |
| } |
| |
| package("example_server") { |
| deps = [ |
| ":bin", |
| ":client", |
| ] |
| binaries = [ |
| { |
| name = "example_server" |
| }, |
| { |
| name = "example_client" |
| shell = true |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/example_server.cmx") |
| dest = "example_server.cmx" |
| }, |
| ] |
| } |
| |
| executable("example_server_cpp_unittests") { |
| output_name = "example_server_unittests" |
| testonly = true |
| |
| sources = [ |
| "echo_connection_unittest.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//garnet/public/lib/gtest", |
| "//garnet/public/lib/inspect:reader", |
| "//garnet/public/lib/inspect/testing", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| test_package("example_server_unittests") { |
| deps = [ |
| ":example_server_cpp_unittests", |
| ] |
| |
| tests = [ |
| { |
| name = "example_server_unittests" |
| environments = basic_envs |
| }, |
| ] |
| } |