| # Copyright 2022 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/fidl/fidl.gni") |
| import("//build/test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":component_cpp_incoming_tests", |
| ":component_cpp_outgoing_directory_tests", |
| ":component_cpp_service_server_tests", |
| ] |
| } |
| |
| fidl("fidl.service.test") { |
| testonly = true |
| visibility = [ |
| ":*", |
| |
| # TODO(fxbug.dev/113114): Migrate all the remaining libs in //sdk/lib/sys/component/cpp |
| # and its tests to //sdk/lib/component and remove this visibility target. |
| "//sdk/lib/sys/component/cpp/tests:*", |
| ] |
| sources = [ "test.test.fidl" ] |
| excluded_checks = [ |
| "disallowed-library-name-component", |
| "string-bounds-not-specified", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.io", |
| "//sdk/fidl/fuchsia.unknown", |
| ] |
| enable_hlcpp = true |
| } |
| |
| test("incoming_test_bin") { |
| sources = [ "incoming_test.cc" ] |
| deps = [ |
| ":fidl.service.test_cpp", |
| ":fidl.service.test_cpp_wire", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//src/lib/testing/predicates", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_unittest_component("incoming_test") { |
| deps = [ ":incoming_test_bin" ] |
| } |
| |
| executable("incoming_integration_test_bin") { |
| testonly = true |
| |
| sources = [ "incoming_integration_test.cc" ] |
| |
| deps = [ |
| ":fidl.service.test_hlcpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/component/cpp/testing:cpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_component("incoming_integration_test") { |
| testonly = true |
| deps = [ ":incoming_integration_test_bin" ] |
| manifest = "meta/incoming_integration_test.cml" |
| } |
| |
| executable("echo_service_client_bin") { |
| testonly = true |
| |
| sources = [ "echo_service_client.cc" ] |
| |
| deps = [ |
| ":fidl.service.test_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/syslog/cpp", |
| ] |
| } |
| |
| fuchsia_component("echo_service_client") { |
| testonly = true |
| deps = [ ":echo_service_client_bin" ] |
| manifest = "meta/echo_service_client.cml" |
| } |
| |
| executable("echo_client_bin") { |
| testonly = true |
| |
| sources = [ "echo_client.cc" ] |
| |
| deps = [ |
| ":fidl.service.test_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/syslog/cpp", |
| ] |
| } |
| |
| fuchsia_component("echo_client") { |
| testonly = true |
| deps = [ ":echo_client_bin" ] |
| manifest = "meta/echo_client.cml" |
| } |
| |
| fuchsia_test_package("component_cpp_incoming_tests") { |
| test_components = [ |
| ":incoming_test", |
| ":incoming_integration_test", |
| ] |
| |
| deps = [ |
| ":echo_client", |
| ":echo_service_client", |
| ] |
| } |
| |
| executable("echo_service_server_bin") { |
| testonly = true |
| |
| sources = [ "echo_service_server.cc" ] |
| |
| deps = [ |
| "//examples/fidl/fuchsia.examples:fuchsia.examples_cpp_wire", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/fidl", |
| "//sdk/lib/syslog/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("echo_service_server") { |
| testonly = true |
| deps = [ ":echo_service_server_bin" ] |
| manifest = "meta/echo_service_server.cml" |
| } |
| |
| executable("cpp_outgoing_directory_test_bin") { |
| testonly = true |
| |
| sources = [ "outgoing_directory_test.cc" ] |
| |
| deps = [ |
| "//examples/fidl/fuchsia.examples:fuchsia.examples_cpp", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_wire", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/lib/fidl/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/storage/vfs/cpp", |
| "//src/lib/testing/loop_fixture", |
| "//src/lib/testing/predicates", |
| "//third_party/googletest:gmock", |
| "//zircon/system/ulib/sync:sync-cpp", |
| ] |
| } |
| |
| executable("cpp_outgoing_directory_integration_test_bin") { |
| testonly = true |
| |
| sources = [ "outgoing_directory_integration_test.cc" ] |
| |
| deps = [ |
| "//examples/fidl/fuchsia.examples:fuchsia.examples_hlcpp", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_hlcpp", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_hlcpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/component/cpp/testing:cpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/storage/vfs/cpp", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_component("outgoing_directory_test") { |
| testonly = true |
| deps = [ ":cpp_outgoing_directory_test_bin" ] |
| manifest = "meta/outgoing_directory_test.cml" |
| } |
| |
| fuchsia_component("outgoing_directory_integration_test") { |
| testonly = true |
| deps = [ ":cpp_outgoing_directory_integration_test_bin" ] |
| manifest = "meta/outgoing_directory_integration_test.cml" |
| } |
| |
| fuchsia_test_package("component_cpp_outgoing_directory_tests") { |
| test_components = [ |
| ":outgoing_directory_test", |
| ":outgoing_directory_integration_test", |
| ] |
| deps = [ ":echo_service_server" ] |
| } |
| |
| test("service_server_test") { |
| sources = [ "server_test.cc" ] |
| deps = [ |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/component/tests:fidl.service.test_cpp_wire", |
| "//sdk/lib/fdio", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("component_cpp_service_server_tests") { |
| deps = [ ":service_server_test" ] |
| } |