blob: bbc1a1a0047c2d2a52b6ca791182d783b0c80f4e [file] [log] [blame]
# 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("tests") {
testonly = true
deps = [
":ime_service",
":keyboard_test",
":text_manager",
":text_manager_test",
# Needed for starting up the test suite fixture.
"//src/ui/testing/text:text_test_suite",
]
}
rustc_binary("bin") {
name = "text_manager"
with_unit_tests = true
edition = "2018"
deps = [
"//sdk/fidl/fuchsia.input:fuchsia.input-rustc",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc",
"//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc",
"//sdk/fidl/fuchsia.ui.keyboard.focus:fuchsia.ui.keyboard.focus-rustc",
"//sdk/fidl/fuchsia.ui.text:fuchsia.ui.text-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/ui/keymaps",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/ui/lib/text",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:unicode-normalization",
"//third_party/rust_crates:unicode-segmentation",
]
test_deps = [
":test_helpers",
"//sdk/fidl/fuchsia.ui.text.testing:fuchsia.ui.text.testing-rustc",
"//third_party/rust_crates:maplit",
]
sources = [
"src/fidl_helpers.rs",
"src/index_convert.rs",
"src/integration_tests.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/multiplex.rs",
"src/text_manager.rs",
]
}
# TODO(fxbug.dev/83213) Retain v1 component while out of tree tests depend on it
fuchsia_component("text_manager_comp") {
component_name = "text_manager"
manifest = "meta/text_manager.cmx"
deps = [ ":bin" ]
}
# This is the same component as `text_manager_comp`, with the legacy name.
# TODO(fxbug.dev/82822): Remove after out-of-tree tests migrate to text_manager.
fuchsia_component("ime_service_comp") {
component_name = "ime_service"
manifest = "meta/text_manager.cmx"
deps = [ ":bin" ]
}
fuchsia_component("default_hardware_ime_comp") {
component_name = "default_hardware_ime"
manifest = "//src/ui/bin/default_hardware_ime/meta/default_hardware_ime.cmx"
deps = [ "//src/ui/bin/default_hardware_ime:bin" ]
}
fuchsia_package("text_manager") {
deps = [
":default_hardware_ime_comp",
":text_manager_comp",
]
}
# This is the same package as `text_manager`, with the legacy name.
# TODO(fxbug.dev/82822): Remove after out-of-tree tests migrate to text_manager.
fuchsia_package("ime_service") {
deps = [
":default_hardware_ime_comp",
":ime_service_comp",
]
}
fuchsia_component("text_manager_bin_test") {
testonly = true
component_name = "text_manager_bin_test"
manifest = "meta/text_manager_bin_test.cmx"
deps = [
":bin_test",
"//src/ui/testing/text:text_test_suite",
]
}
fuchsia_test_package("text_manager_test") {
package_deps_for_infra_only = [ "//src/ui/testing/text:text_test_suite" ]
test_components = [ ":text_manager_bin_test" ]
}
rustc_test("keyboard3_integration_test_bin") {
output_name = "keyboard3_integration_test"
edition = "2018"
deps = [
":bin",
":test_helpers",
"//sdk/fidl/fuchsia.input:fuchsia.input-rustc",
"//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc",
"//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc",
"//sdk/fidl/fuchsia.ui.keyboard.focus:fuchsia.ui.keyboard.focus-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:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:test-case",
]
source_root = "tests/keyboard3.rs"
sources = [ "tests/keyboard3.rs" ]
}
rustc_test("text_manager_integration_test_bin") {
output_name = "text_manager_integration_test"
edition = "2018"
deps = [
":bin",
":test_helpers",
"//sdk/fidl/fuchsia.input:fuchsia.input-rustc",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc",
"//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc",
"//sdk/fidl/fuchsia.ui.keyboard.focus:fuchsia.ui.keyboard.focus-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/ui/keymaps",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:matches",
]
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 = "2018"
deps = [
":bin",
":test_helpers",
"//sdk/fidl/fuchsia.input:fuchsia.input-rustc",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc",
"//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc",
"//sdk/fidl/fuchsia.ui.keyboard.focus:fuchsia.ui.keyboard.focus-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/syslog/rust:syslog",
"//src/lib/ui/fuchsia-scenic",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:matches",
]
source_root = "tests/legacy_ime.rs"
sources = [ "tests/legacy_ime.rs" ]
}
rustc_library("test_helpers") {
testonly = true
edition = "2018"
source_root = "tests/test_helpers.rs"
sources = [ "tests/test_helpers.rs" ]
deps = [
"//sdk/fidl/fuchsia.input:fuchsia.input-rustc",
"//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc",
"//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc",
"//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.cmx"
}
fuchsia_component("text_manager_integration_test") {
testonly = true
deps = [ ":text_manager_integration_test_bin" ]
manifest = "meta/text_manager_integration_test.cmx"
}
fuchsia_component("legacy_ime_integration_test") {
testonly = true
deps = [ ":legacy_ime_integration_test_bin" ]
manifest = "meta/legacy_ime_integration_test.cmx"
}
fuchsia_test_package("keyboard_test") {
test_components = [
":keyboard3_integration_test",
":text_manager_integration_test",
":legacy_ime_integration_test",
]
}