| # 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/components.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 = [ |
| "//examples/fidl/fuchsia.examples", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/inspect/cpp", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "example_server" |
| |
| sources = [ "example_server.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| executable("client") { |
| output_name = "example_client" |
| |
| sources = [ "example_client.cc" ] |
| |
| deps = [ |
| "//examples/fidl/fuchsia.examples", |
| "//sdk/lib/fdio", |
| "//src/lib/files", |
| ] |
| } |
| |
| fuchsia_shell_package("example_client") { |
| deps = [ ":client" ] |
| } |
| |
| fuchsia_package_with_single_component("example_server") { |
| deps = [ ":bin" ] |
| manifest = "meta/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", |
| "//sdk/lib/inspect/testing/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| ] |
| } |
| |
| fuchsia_unittest_package("example_server_unittests") { |
| deps = [ ":example_server_cpp_unittests" ] |
| test_specs = { |
| environments = [ emu_env ] |
| } |
| } |
| |
| group("cpp") { |
| testonly = true |
| public_deps = [ |
| ":example_client", |
| ":example_server", |
| ":tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":example_server_unittests" ] |
| } |