| # 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/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":shortcut", |
| ":shortcut_integration_test_pkg", |
| ":shortcut_test_pkg", |
| ] |
| } |
| |
| group("configs") { |
| deps = [ ":ui_sysmgr.config" ] |
| } |
| |
| config_data("ui_sysmgr.config") { |
| for_pkg = "sysmgr" |
| sources = [ "config/ui_sysmgr.config" ] |
| } |
| |
| rustc_binary("bin") { |
| name = "shortcut" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.input:fuchsia.input-rustc", |
| "//sdk/fidl/fuchsia.ui.focus:fuchsia.ui.focus-rustc", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc", |
| "//sdk/fidl/fuchsia.ui.shortcut:fuchsia.ui.shortcut-rustc", |
| "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/ui/fuchsia-scenic", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/main.rs", |
| "src/registry.rs", |
| "src/router.rs", |
| "src/service.rs", |
| ] |
| } |
| |
| # Unit tests for the shortcut manager binary. |
| fuchsia_unittest_component("shortcut_bin_test") { |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_test_package("shortcut_test_pkg") { |
| test_components = [ ":shortcut_bin_test" ] |
| } |
| |
| # The shortcut manager component. |
| fuchsia_component("shortcut_manager") { |
| deps = [ ":bin" ] |
| manifest = "meta/shortcut_manager.cml" |
| } |
| |
| # The shortcut manager package. |
| fuchsia_package("shortcut") { |
| deps = [ ":shortcut_manager" ] |
| } |
| |
| # The integration test for the shortcut manager. |
| rustc_test("shortcut_integration_test_bin") { |
| output_name = "shortcut_integration_test" |
| edition = "2021" |
| |
| deps = [ |
| ":bin", |
| "//sdk/fidl/fuchsia.input:fuchsia.input-rustc", |
| "//sdk/fidl/fuchsia.ui.focus:fuchsia.ui.focus-rustc", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc", |
| "//sdk/fidl/fuchsia.ui.shortcut:fuchsia.ui.shortcut-rustc", |
| "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/ui/fuchsia-scenic", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| source_root = "tests/tests.rs" |
| |
| sources = [ |
| "tests/test_helpers.rs", |
| "tests/tests.rs", |
| ] |
| } |
| |
| # The component and package for the integration test above. |
| fuchsia_component("shortcut_integration_test") { |
| testonly = true |
| deps = [ |
| ":shortcut_integration_test_bin", |
| ":shortcut_manager", |
| ] |
| manifest = "meta/shortcut_integration_test.cml" |
| } |
| |
| fuchsia_test_package("shortcut_integration_test_pkg") { |
| test_components = [ ":shortcut_integration_test" ] |
| deps = [ ":shortcut_manager" ] |
| |
| test_specs = { |
| # Test cases manipulate the global focus chain, which will confuse the |
| # shortcut manager if ran in parallel. |
| parallel = 1 |
| } |
| } |