blob: 6dc617caeb3aa120f8935dab1519eb145cc7df70 [file] [log] [blame]
# Copyright 2021 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/rust/rustc_library.gni")
import("//tools/cmc/build/expect_includes.gni")
group("fuchsia-component-test") {
testonly = true
deps = [
":includes",
"realm_builder_server:realm_builder_server_component",
]
public_deps = [ ":fuchsia-component-test-lib" ]
}
group("prod-fuchsia-component-test") {
deps = [
":includes",
"realm_builder_server:realm_builder_server_component",
]
public_deps = [ ":fuchsia-component-test-lib" ]
visibility = [
# fxbug.dev/104520 V2 Factory Runin needs RealmBuilder.
# Factory Runin is a non-test component that runs on
# userfacing builds to validate hardware. It does this
# by executing profiles of "plugin" components which
# are responsible for interacting with real hardware.
"//vendor/google/bin/factory:*",
]
}
rustc_library("fuchsia-component-test-lib") {
name = "fuchsia_component_test"
with_unit_tests = true
edition = "2021"
visibility = [ ":*" ]
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component_rust",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_rust",
"//sdk/fidl/fuchsia.component.test:fuchsia.component.test_rust",
"//sdk/fidl/fuchsia.data:fuchsia.data_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/cm_rust",
"//src/sys/lib/component-events",
"//src/sys/lib/runner",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
]
sources = [
"src/error.rs",
"src/lib.rs",
"src/local_component_runner.rs",
"src/mock.rs",
]
test_deps = [
"realm_builder_server:realm_builder_server_component",
"//sdk/fidl/fuchsia.component.config:fuchsia.component.config_rust",
"//src/lib/fuchsia",
"//third_party/rust_crates:assert_matches",
]
}
expect_includes("includes") {
includes = [ "//sdk/lib/sys/component/realm_builder.shard.cml" ]
}
fuchsia_unittest_package("fuchsia_component_test_unittests") {
manifest = "meta/fuchsia_component_test_tests.cml"
deps = [ ":fuchsia-component-test-lib_test" ]
}
group("tests") {
testonly = true
deps = [
":fuchsia_component_test_unittests",
"realm_builder_server:fuchsia-component-test",
"realm_builder_server:realm_builder_server_unit_tests",
"tests",
]
}