| # 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/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("text") { |
| testonly = true |
| deps = [ |
| ":tests", |
| ":text_manager", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":keyboard_test", |
| ":keyboard_test_parallel", |
| ":text_manager", |
| ":text_manager_test", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "text_manager" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.input:fuchsia.input_rust", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_rust", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3_rust", |
| "//sdk/fidl/fuchsia.ui.keyboard.focus:fuchsia.ui.keyboard.focus_rust", |
| "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/ui/fuchsia-scenic", |
| "//src/lib/ui/keymaps", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:unicode-normalization", |
| "//third_party/rust_crates:unicode-segmentation", |
| ] |
| |
| test_deps = [ |
| ":test_helpers", |
| "//third_party/rust_crates:maplit", |
| ] |
| |
| sources = [ |
| "src/fidl_helpers.rs", |
| "src/index_convert.rs", |
| "src/keyboard/events.rs", |
| "src/keyboard/keyboard3.rs", |
| "src/keyboard/mod.rs", |
| "src/keyboard/service.rs", |
| "src/legacy_ime/handler.rs", |
| "src/legacy_ime/mod.rs", |
| "src/legacy_ime/position.rs", |
| "src/legacy_ime/state.rs", |
| "src/main.rs", |
| "src/text_manager.rs", |
| ] |
| } |
| |
| fuchsia_component("text_manager_comp") { |
| component_name = "text_manager" |
| manifest = "meta/text_manager.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("text_manager") { |
| deps = [ ":text_manager_comp" ] |
| } |
| |
| fuchsia_component("text_manager_bin_test") { |
| testonly = true |
| component_name = "text_manager_bin_test" |
| manifest = "meta/text_manager_bin_test.cml" |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_test_package("text_manager_test") { |
| test_components = [ ":text_manager_bin_test" ] |
| } |
| |
| rustc_test("keyboard3_integration_test_bin") { |
| output_name = "keyboard3_integration_test" |
| edition = "2021" |
| |
| deps = [ |
| ":bin", |
| ":test_helpers", |
| "//sdk/fidl/fuchsia.input:fuchsia.input_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_rust", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3_rust", |
| "//sdk/fidl/fuchsia.ui.keyboard.focus:fuchsia.ui.keyboard.focus_rust", |
| "//sdk/fidl/fuchsia.ui.views:fuchsia.ui.views_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/ui/fuchsia-scenic", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:test-case", |
| "//third_party/rust_crates:tracing", |
| ] |
| source_root = "tests/keyboard3.rs" |
| |
| sources = [ "tests/keyboard3.rs" ] |
| } |
| |
| rustc_test("text_manager_integration_test_bin") { |
| output_name = "text_manager_integration_test" |
| edition = "2021" |
| |
| deps = [ |
| ":bin", |
| ":test_helpers", |
| "//sdk/fidl/fuchsia.input:fuchsia.input_rust", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_rust", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3_rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/ui/keymaps", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| source_root = "tests/text_manager.rs" |
| |
| sources = [ "tests/text_manager.rs" ] |
| } |
| |
| rustc_test("legacy_ime_integration_test_bin") { |
| output_name = "legacy_ime_integration_test" |
| edition = "2021" |
| |
| deps = [ |
| ":bin", |
| ":test_helpers", |
| "//sdk/fidl/fuchsia.input:fuchsia.input_rust", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| ] |
| source_root = "tests/legacy_ime.rs" |
| |
| sources = [ "tests/legacy_ime.rs" ] |
| } |
| |
| rustc_library("test_helpers") { |
| testonly = true |
| edition = "2021" |
| |
| source_root = "tests/test_helpers.rs" |
| sources = [ "tests/test_helpers.rs" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.input:fuchsia.input_rust", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input_rust", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| ] |
| } |
| |
| fuchsia_component("keyboard3_integration_test") { |
| testonly = true |
| deps = [ |
| ":keyboard3_integration_test_bin", |
| ":text_manager_comp", |
| ] |
| manifest = "meta/keyboard3_integration_test.cml" |
| } |
| |
| fuchsia_component("text_manager_integration_test") { |
| testonly = true |
| deps = [ |
| ":text_manager_comp", |
| ":text_manager_integration_test_bin", |
| ] |
| manifest = "meta/text_manager_integration_test.cml" |
| } |
| |
| fuchsia_component("legacy_ime_integration_test") { |
| testonly = true |
| deps = [ |
| ":legacy_ime_integration_test_bin", |
| ":text_manager_comp", |
| ] |
| manifest = "meta/legacy_ime_integration_test.cml" |
| } |
| |
| fuchsia_test_package("keyboard_test") { |
| test_components = [ |
| ":text_manager_integration_test", |
| ":legacy_ime_integration_test", |
| ] |
| |
| # These tests use a single instance of the text manager, and since they set |
| # up conflicting test cases, they can not run in parallel. |
| test_specs = { |
| parallel = 1 |
| } |
| } |
| |
| fuchsia_test_package("keyboard_test_parallel") { |
| test_components = [ ":keyboard3_integration_test" ] |
| } |