| # 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/test/test_package.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", |
| "../timestamp-server-dart:timestamp-server-dart", |
| ] |
| } |
| |
| rustc_library("lib") { |
| name = "tests_intl_timezone" |
| sources = [ "src/lib.rs" ] |
| edition = "2018" |
| deps = [ |
| "//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app-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 = "2018" |
| 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", |
| ] |
| } |
| |
| test_package("timezone-test") { |
| public_deps = [ |
| ":timezone_bin_test", |
| "../timestamp-server-dart:timestamp-server-dart", |
| ] |
| tests = [ |
| { |
| name = "timezone_bin_test" |
| }, |
| ] |
| resources = [ |
| { |
| path = rebase_path("//third_party/icu/common/icudtl.dat") |
| dest = "icudtl.dat" |
| }, |
| ] |
| } |
| |
| # 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", |
| ] |
| |
| # 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/fuchsia-async", |
| "//src/lib/syslog/rust:syslog", |
| "//third_party/rust_crates:anyhow", |
| ] |
| } |
| |
| test_package("timezone-flutter-test") { |
| public_deps = [ |
| ":timezone_flutter_bin_test", |
| "../timestamp-server-dart:timestamp-server-flutter", |
| ] |
| tests = [ |
| { |
| name = "timezone_flutter_bin_test" |
| }, |
| ] |
| resources = [ |
| { |
| path = rebase_path("//third_party/icu/common/icudtl.dat") |
| dest = "icudtl.dat" |
| }, |
| ] |
| } |