| # Copyright 2020 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/dart/config.gni") |
| import("//build/flutter/config.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("timezone") { |
| testonly = true |
| public_deps = [ ":tests" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":tests-for-dart", |
| # Intentionally omitted: not all devices can run flutter tests. |
| # ":tests-for-flutter", |
| ] |
| } |
| |
| group("tests-for-dart") { |
| testonly = true |
| public_deps = [ |
| ":timezone-test", |
| "//src/tests/intl/timestamp-server-dart:timestamp-server-dart", |
| ] |
| data_deps = [ |
| "//src/dart:dart_aot_product_runner", |
| "//src/dart:dart_aot_runner", |
| "//src/dart:dart_jit_product_runner", |
| "//src/dart:dart_jit_runner", |
| ] |
| } |
| |
| rustc_library("lib") { |
| name = "tests_intl_timezone" |
| sources = [ "src/lib.rs" ] |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics-rustc", |
| "//sdk/fidl/fuchsia.fonts:fuchsia.fonts-rustc", |
| "//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc", |
| "//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider-rustc", |
| "//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app-rustc", |
| "//sdk/fidl/fuchsia.ui.input:fuchsia.ui.input-rustc", |
| "//sdk/fidl/fuchsia.ui.input3:fuchsia.ui.input3-rustc", |
| "//sdk/fidl/fuchsia.ui.scenic:fuchsia.ui.scenic-rustc", |
| "//sdk/fidl/fuchsia.vulkan.loader:fuchsia.vulkan.loader-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/icu_data/rust/icu_data", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/ui/fuchsia-scenic", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/testing/fidl:placeholders-rustc", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:crossbeam", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:rust_icu_common", |
| "//third_party/rust_crates:rust_icu_ucal", |
| "//third_party/rust_crates:rust_icu_udat", |
| "//third_party/rust_crates:rust_icu_uloc", |
| "//third_party/rust_crates:rust_icu_ustring", |
| ] |
| } |
| |
| rustc_test("timezone_bin_test") { |
| edition = "2021" |
| source_root = "timezone_test.rs" |
| sources = [ "timezone_test.rs" ] |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/syslog/rust:syslog", |
| "//third_party/rust_crates:anyhow", |
| ] |
| } |
| |
| fuchsia_unittest_package("timezone-test") { |
| component_name = "timezone_bin_test" |
| manifest = "meta/timezone_bin_test.cml" |
| deps = [ |
| ":timezone_bin_test", |
| "../timestamp-server-dart:timestamp-server-dart", |
| "//src/dart:dart_aot_runner", |
| "//src/intl:icudtl", |
| "//src/intl/intl_services:intl_services_comp_v2", |
| "//src/settings/service:setui_service_v2", |
| "//src/sys/stash:stash_v2", |
| "//src/ui/bin/text:text_manager_comp_v2", |
| ] |
| } |
| |
| # Essentially same as above, but for flutter runner. |
| group("tests-for-flutter") { |
| testonly = true |
| public_deps = [ |
| ":timezone-flutter-test", |
| "../timestamp-server-dart:timestamp-server-flutter", |
| ] |
| |
| deps = [ |
| # The deps below are necessary on minimal product configs. |
| "//src/cobalt/bin/testing/mock_cobalt", |
| "//src/flutter", |
| "//src/graphics/bin/vulkan_loader", |
| "//src/testing/fidl/intl_property_manager", |
| "//src/ui/a11y/bin/a11y_manager:a11y-manager", |
| "//src/ui/bin/hardware_display_controller_provider:fake-hardware-display-controller-provider", |
| "//src/ui/bin/text:text_manager", |
| ] |
| |
| # Because we are using test_package instead of fuchsia_test_package, the |
| # flutter_*_runner will not be available if we're using fuchsia_component. |
| # This causes the test to crash because package-resolver cannot resolve the |
| # runner. This is a workaround to allow the flutter runners to be available |
| # during runtime. |
| data_deps = [ |
| "//src/flutter:flutter_aot_product_runner", |
| "//src/flutter:flutter_aot_runner", |
| "//src/flutter:flutter_jit_product_runner", |
| "//src/flutter:flutter_jit_runner", |
| ] |
| } |
| |
| rustc_test("timezone_flutter_bin_test") { |
| edition = "2018" |
| source_root = "timezone_flutter_test.rs" |
| sources = [ "timezone_flutter_test.rs" ] |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/syslog/rust:syslog", |
| "//third_party/rust_crates:anyhow", |
| ] |
| } |
| |
| config_data("scenic-test-config") { |
| for_pkg = "text-input-test" |
| sources = [ "data/scenic_config" ] |
| outputs = [ "scenic_config" ] |
| } |
| |
| fuchsia_unittest_package("timezone-flutter-test") { |
| component_name = "timezone_flutter_bin_test" |
| manifest = "meta/timezone_flutter_bin_test.cml" |
| deps = [ |
| ":scenic-test-config", |
| ":timezone_flutter_bin_test", |
| "//src/cobalt/bin/testing/mock_cobalt:component_v2", |
| "//src/dart:dart_aot_runner", |
| "//src/fonts/fake:fake-fonts-cm", |
| "//src/intl:icudtl", |
| "//src/intl/intl_services:intl_services_comp_v2", |
| "//src/settings/service:setui_service_v2", |
| "//src/sys/stash:stash_v2", |
| "//src/tests/intl/timestamp-server-dart:timestamp-server-flutter", |
| "//src/ui/a11y/bin/a11y_manager:component_v2", |
| "//src/ui/bin/hardware_display_controller_provider:fake-hardware-display-controller-provider-cmv2-component", |
| "//src/ui/bin/text:text_manager_comp_v2", |
| "//src/ui/scenic:component_v2_with_supplied_display_provider", |
| ] |
| |
| test_specs = { |
| log_settings = { |
| # #a11y is missing fuchsia.settings.Accessibility from #setui_service. |
| max_severity = "ERROR" |
| } |
| environments = [ |
| { |
| dimensions = { |
| # Ensure the device has Vulkan. |
| device_type = "AEMU" |
| } |
| }, |
| ] |
| } |
| } |