blob: 4195e4394c65a6cb456e903184d3db0a44fd58fc [file] [log] [blame]
# 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")
group("timekeeper_integration") {
testonly = true
deps = [
":timekeeper-integration",
"//src/cobalt/bin/testing/mock_cobalt",
]
}
rustc_library("timekeeper_integration_lib") {
testonly = true
name = "timekeeper_integration_lib"
edition = "2021"
sources = [ "tests/lib/lib.rs" ]
source_root = "tests/lib/lib.rs"
deps = [
":test.time_rust",
"//sdk/fidl/fuchsia.hardware.rtc:fuchsia.hardware.rtc_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//sdk/fidl/fuchsia.metrics.test:fuchsia.metrics.test_rust",
"//sdk/fidl/fuchsia.time:fuchsia.time_rust",
"//sdk/fidl/fuchsia.time.external:fuchsia.time.external_rust",
"//src/lib/async-utils",
"//src/lib/fake-clock/fidl:fidl_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/time/lib/push-source",
"//src/sys/time/lib/time_metrics_registry",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:chrono",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:parking_lot",
]
}
rustc_test("integration_test_bin") {
name = "timekeeper_integration_test"
edition = "2021"
sources = [ "tests/timekeeper/integration.rs" ]
source_root = "tests/timekeeper/integration.rs"
deps = [
":timekeeper_integration_lib",
"//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust",
"//sdk/fidl/fuchsia.metrics.test:fuchsia.metrics.test_rust",
"//sdk/fidl/fuchsia.time.external:fuchsia.time.external_rust",
"//src/lib/cobalt/rust/builders",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/test_util",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/time/lib/time_metrics_registry",
"//third_party/rust_crates:futures",
]
}
rustc_test("faketime_integration_test_bin") {
name = "faketime_integration_test"
edition = "2021"
sources = [ "tests/faketime/integration.rs" ]
source_root = "tests/faketime/integration.rs"
deps = [
":timekeeper_integration_lib",
"//sdk/fidl/fuchsia.metrics.test:fuchsia.metrics.test_rust",
"//sdk/fidl/fuchsia.time.external:fuchsia.time.external_rust",
"//src/lib/fake-clock/fidl:fidl_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/test_util",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/time/lib/time_metrics_registry",
"//third_party/rust_crates:futures",
]
}
fuchsia_component("timekeeper_integration_test") {
testonly = true
component_name = "timekeeper_integration_test"
manifest = "meta/timekeeper_integration_test.cml"
deps = [ ":integration_test_bin" ]
}
fuchsia_component("faketime_integration_test") {
testonly = true
component_name = "faketime_integration_test"
manifest = "meta/faketime_integration_test.cml"
deps = [ ":faketime_integration_test_bin" ]
}
fuchsia_component_manifest("manifest_for_integration") {
testonly = true
component_name = "timekeeper_for_integration"
manifest = "meta/timekeeper_for_integration.cml"
}
fuchsia_component_manifest("manifest_with_fake_time") {
testonly = true
component_name = "timekeeper_with_fake_time"
manifest = "meta/timekeeper_with_fake_time.cml"
}
fuchsia_component("timekeeper_for_integration") {
testonly = true
cm_label = ":manifest_for_integration"
deps = [ "//src/sys/time/timekeeper:bin" ]
}
fuchsia_component("timekeeper_with_fake_time") {
testonly = true
cm_label = ":manifest_with_fake_time"
deps = [ "//src/sys/time/timekeeper:bin_with_fake_time" ]
}
fuchsia_structured_config_values("config-values-faketime") {
testonly = true
cm_label = ":timekeeper_with_fake_time"
values_source = "config/values.json5"
}
fuchsia_structured_config_values("config-values-integration") {
testonly = true
cm_label = ":timekeeper_for_integration"
values_source = "config/values.json5"
}
fidl("test.time") {
testonly = true
sources = [ "fidl/test.fidl" ]
public_deps = [ "//sdk/fidl/fuchsia.time.external" ]
}
fuchsia_test_package("timekeeper-integration") {
test_components = [
":faketime_integration_test",
":timekeeper_integration_test",
]
deps = [
":config-values-faketime",
":config-values-integration",
":timekeeper_for_integration",
":timekeeper_with_fake_time",
"dev_time_source",
"//src/cobalt/bin/testing/mock_cobalt:component_v2",
"//src/lib/fake-clock/svc",
]
test_specs = {
environments = [ nuc_env ]
log_settings = {
max_severity = "ERROR"
}
}
}