| # Copyright 2018 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/config.gni") |
| import("//build/fidl/fidl.gni") |
| import("//src/sys/build/components.gni") |
| |
| fidl("interface") { |
| # TODO(fxbug.dev/35879): Remove lint exclusions by fixing known FIDL lint violations in this target |
| excluded_checks = [ "string-bounds-not-specified" ] |
| |
| testonly = true |
| |
| name = "test.sysmgr" |
| sources = [ "interface.test.fidl" ] |
| } |
| |
| executable("test_sysmgr_service_bin") { |
| testonly = true |
| output_name = "test_sysmgr_service" |
| |
| sources = [ "test_sysmgr_service.cc" ] |
| |
| deps = [ |
| ":interface", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("test_sysmgr_service") { |
| testonly = true |
| manifest = "meta/test_sysmgr_service.cmx" |
| deps = [ ":test_sysmgr_service_bin" ] |
| } |
| |
| executable("mock_resolver_bin") { |
| testonly = true |
| output_name = "mock_resolver" |
| |
| sources = [ "mock_resolver.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.pkg", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("mock_resolver") { |
| testonly = true |
| manifest = "meta/mock_resolver.cmx" |
| deps = [ ":mock_resolver_bin" ] |
| } |
| |
| executable("service_startup_test_bin") { |
| testonly = true |
| output_name = "service_startup_test" |
| sources = [ "service_startup_test.cc" ] |
| |
| deps = [ |
| ":interface", |
| "//garnet/examples/fidl/services:echo", |
| "//garnet/public/lib/gtest", |
| "//sdk/fidl/fuchsia.logger", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| ] |
| } |
| |
| fuchsia_component("service_startup_test") { |
| testonly = true |
| manifest = "meta/service_startup_test.cmx" |
| deps = [ |
| ":service_startup_test_bin", |
| ":sysmgr_integration_test_observer_config", |
| ] |
| } |
| |
| executable("package_updating_loader_test_bin") { |
| testonly = true |
| output_name = "package_updating_loader_test" |
| |
| sources = [ "package_updating_loader_test.cc" ] |
| |
| deps = [ |
| ":interface", |
| "//garnet/examples/fidl/services:echo", |
| "//garnet/public/lib/gtest", |
| "//sdk/lib/sys/cpp/testing:integration", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/sys/sysmgr:lib", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fs", |
| ] |
| } |
| |
| fuchsia_component("package_updating_loader_test") { |
| testonly = true |
| manifest = "meta/package_updating_loader_test.cmx" |
| deps = [ ":package_updating_loader_test_bin" ] |
| } |
| |
| config_data("sysmgr_integration_test_observer_config") { |
| for_pkg = "sysmgr-integration-tests" |
| outputs = [ "service_startup_test.config" ] |
| sources = [ "config/service_startup_test.config" ] |
| } |
| |
| resource("echo_server_bin") { |
| sources = [ "$root_out_dir/echo_server_rust" ] |
| outputs = [ "bin/echo_server" ] |
| } |
| |
| fuchsia_component("echo_server_rust") { |
| testonly = true |
| manifest = rebase_path("//garnet/examples/fidl/meta/echo_server.cmx") |
| deps = [ |
| ":echo_server_bin", |
| "//garnet/examples/fidl/echo_server_rust:echo_server_rust_bin", |
| ] |
| } |
| |
| fuchsia_test_package("sysmgr-integration-tests") { |
| test_components = [ |
| ":service_startup_test", |
| ":package_updating_loader_test", |
| ] |
| deps = [ |
| ":echo_server_rust", |
| ":mock_resolver", |
| ":test_sysmgr_service", |
| "//src/sys/sysmgr:sysmgr_component", |
| ] |
| } |
| |
| group("integration_tests") { |
| testonly = true |
| deps = [ ":sysmgr-integration-tests" ] |
| } |