blob: b5d477cb702f0354b42cf0e846ceeca879b80e8e [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("lib") {
testonly = true
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 = [
# https://fxbug.dev/42055686 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:*",
"//vendor/google/factory/framework:*",
]
}
rustc_library("fuchsia-component-test-lib") {
name = "fuchsia_component_test"
with_unit_tests = true
edition = "2021"
visibility = [
":*",
"//src/sys/test_runners/component_test:*",
]
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.process:fuchsia.process_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/zircon/rust:fuchsia-zircon",
"//src/storage/lib/vfs/rust:vfs",
"//src/sys/lib/cm_rust",
"//src/sys/lib/cm_types",
"//src/sys/lib/component-events",
"//src/sys/lib/runner",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//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",
"//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:realm_builder_server_unit_tests",
"tests",
]
}