blob: 090a94100f02810e06830b95feceaeaa4f0b3237 [file] [log] [blame]
# Copyright 2022 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/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
rustc_library("common") {
testonly = true
edition = "2021"
source_root = "src/common.rs"
sources = [ "src/common.rs" ]
deps = [
"//sdk/fidl/fuchsia.settings:fuchsia.settings_rust",
"//sdk/fidl/fuchsia.ui.brightness:fuchsia.ui.brightness_rust",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/settings/service/integration_tests/utils",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
# These tests mock out the fuchsia.ui.brightness dependency.
rustc_test("bin") {
name = "display_integration_test"
edition = "2021"
source_root = "src/display_tests.rs"
sources = [ "src/display_tests.rs" ]
deps = [
"//sdk/fidl/fuchsia.settings:fuchsia.settings_rust",
"//src/lib/fuchsia",
"//src/settings/service/integration_tests/display_tests:common",
"//third_party/rust_crates:futures",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("display_integration_test") {
testonly = true
manifest = "meta/display_integration_test.cml"
deps = [ ":bin" ]
}
fuchsia_test_package("display_integration_test_pkg") {
package_name = "display_integration_test"
test_components = [ ":display_integration_test" ]
deps = [
":display_integration_test",
":tests_config",
"//src/settings/service:setui_service_v2",
"//src/sys/stash:pkg",
]
subpackages = [ "//src/sys/stash:pkg" ]
}
resource("tests_config") {
sources = [
"testdata/interface_configuration.json",
"testdata/service_flags.json",
]
outputs = [ "display_integration_test_pkg/{{source_file_part}}" ]
}
# These tests do not depend on any external dependencies.
rustc_test("internal_tests_bin") {
name = "internal_display_integration_test"
edition = "2021"
source_root = "src/internal_display_tests.rs"
sources = [ "src/internal_display_tests.rs" ]
deps = [
"//sdk/fidl/fuchsia.settings:fuchsia.settings_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/settings/service/integration_tests/display_tests:common",
"//src/settings/service/integration_tests/utils",
"//third_party/rust_crates:paste",
]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("internal_display_integration_test") {
testonly = true
manifest = "meta/internal_display_integration_test.cml"
deps = [ ":internal_tests_bin" ]
}
fuchsia_test_package("internal_display_integration_test_pkg") {
package_name = "internal_display_integration_test"
test_components = [ ":internal_display_integration_test" ]
deps = [
":internal_display_integration_test",
":internal_tests_config",
"//src/settings/service:setui_service_v2",
"//src/sys/stash:pkg",
]
subpackages = [ "//src/sys/stash:pkg" ]
}
resource("internal_tests_config") {
sources = [
"testdata/display_configuration.json",
"testdata/interface_configuration.json",
]
outputs = [ "internal_display_integration_test_pkg/{{source_file_part}}" ]
}
group("display_tests") {
testonly = true
public_deps = [
":display_integration_test_pkg",
":internal_display_integration_test_pkg",
]
}