| # 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/fidl/fidl.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/testing/environments.gni") |
| import("//sdk/ctf/build/ctf.gni") |
| |
| # The canonical "all tests" target. |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ctf-tests", |
| ":timekeeper_integration", |
| ] |
| } |
| |
| # CTF archive deps only. |
| group("ctf-tests") { |
| testonly = true |
| deps = [ |
| ":faketime-integration_archive", |
| ":timekeeper-integration_archive", |
| ] |
| } |
| |
| # Other test-only targets. |
| group("timekeeper_integration") { |
| testonly = true |
| deps = [ |
| ":faketime-integration-test-root", |
| ":timekeeper-integration-test-root", |
| ] |
| } |
| |
| rustc_test("integration_test_bin") { |
| name = "timekeeper_integration_test" |
| edition = "2021" |
| |
| sources = [ "tests/timekeeper/integration.rs" ] |
| |
| source_root = "tests/timekeeper/integration.rs" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", |
| "//sdk/fidl/fuchsia.metrics.test:fuchsia.metrics.test_rust", |
| "//sdk/fidl/fuchsia.testing.harness:fuchsia.testing.harness_rust", |
| "//sdk/fidl/fuchsia.time:fuchsia.time_rust", |
| "//sdk/fidl/fuchsia.time.external:fuchsia.time.external_rust", |
| "//src/lib/cobalt/rust/builders", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/test_util", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/time/lib/time_metrics_registry", |
| "//src/sys/time/testing:timekeeper_integration", |
| "//src/sys/time/testing/fidl/test.time.realm:fidl_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| } |
| |
| # Component |
| fuchsia_component("timekeeper_integration_test") { |
| testonly = true |
| component_name = "timekeeper_integration_test" |
| |
| manifest = "meta/timekeeper_integration_test.cml" |
| deps = [ ":integration_test_bin" ] |
| } |
| |
| # Package - test suite |
| ctf_fuchsia_package("timekeeper-integration") { |
| package_name = "timekeeper-integration" |
| testonly = true |
| deps = [ |
| ":timekeeper_integration_test", |
| "//src/lib/fake-clock/svc", |
| ] |
| } |
| |
| # The TTRF-based timekeeper integration test. |
| fuchsia_test_component("timekeeper-integration-test-root-component") { |
| testonly = true |
| manifest = "meta/timekeeper-test-root.cml" |
| } |
| |
| # The root component for the TTRF-based tests. |
| fuchsia_test_package("timekeeper-integration-test-root") { |
| test_components = [ ":timekeeper-integration-test-root-component" ] |
| subpackages = [ |
| ":timekeeper-integration", |
| |
| # The Timekeeper test realm factory (TTRF) package. |
| "//src/sys/time/testing/realm-proxy:pkg", |
| ] |
| |
| test_specs = { |
| environments = [ nuc_env ] |
| log_settings = { |
| # Some tests produce "error" level logs as part of the test execution. |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| # Faketime tests |
| rustc_test("faketime_integration_test_bin") { |
| name = "faketime_integration_test" |
| edition = "2021" |
| |
| sources = [ "tests/faketime/integration.rs" ] |
| |
| source_root = "tests/faketime/integration.rs" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.metrics.test:fuchsia.metrics.test_rust", |
| "//sdk/fidl/fuchsia.testing.harness:fuchsia.testing.harness_rust", |
| "//sdk/fidl/fuchsia.time:fuchsia.time_rust", |
| "//sdk/fidl/fuchsia.time.external:fuchsia.time.external_rust", |
| "//src/lib/fake-clock/fidl:fidl_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/test_util", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/time/lib/time_metrics_registry", |
| "//src/sys/time/testing:timekeeper_integration", |
| "//src/sys/time/testing/fidl/test.time.realm:fidl_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| } |
| |
| # Component |
| fuchsia_component("faketime_integration_test") { |
| testonly = true |
| component_name = "faketime_integration_test" |
| |
| manifest = "meta/faketime_integration_test.cml" |
| deps = [ ":faketime_integration_test_bin" ] |
| } |
| |
| # Package - test suite |
| ctf_fuchsia_package("faketime-integration") { |
| package_name = "faketime-integration" |
| testonly = true |
| deps = [ |
| ":faketime_integration_test", |
| "//src/lib/fake-clock/svc", |
| ] |
| } |
| |
| # The TTRF-based faketime integration test. |
| fuchsia_test_component("faketime-integration-test-root-component") { |
| testonly = true |
| manifest = "meta/faketime-test-root.cml" |
| } |
| |
| # The package for the top level component for the faketime integration tests |
| # based on TTRF. |
| fuchsia_test_package("faketime-integration-test-root") { |
| test_components = [ ":faketime-integration-test-root-component" ] |
| subpackages = [ |
| ":faketime-integration", |
| |
| # The Timekeeper test realm factory (TTRF) package. |
| "//src/sys/time/testing/realm-proxy:pkg", |
| ] |
| |
| test_specs = { |
| environments = [ nuc_env ] |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |