| # 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 |
| public_deps = [ ":fuchsia-component-test-lib" ] |
| deps = [ ":includes" ] |
| } |
| |
| # TODO(fxbug.dev/74645): Merge with "fuchsia-component-test" once out of tree |
| # targets are migrated to //src/lib/fuchsia-component-test. |
| rustc_library("fuchsia-component-test-lib") { |
| testonly = true |
| name = "fuchsia_component_test" |
| with_unit_tests = true |
| edition = "2018" |
| visibility = [ |
| ":*", |
| "//src/sys/lib/fuchsia-component-test", |
| ] |
| |
| deps = [ |
| "fidl:fuchsia.realm.builder-rustc", |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.component:fuchsia.component-rustc", |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner-rustc", |
| "//sdk/fidl/fuchsia.data:fuchsia.data-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.io2:fuchsia.io2-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/cm_fidl_validator", |
| "//src/sys/lib/cm_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/builder.rs", |
| "src/error.rs", |
| "src/lib.rs", |
| "src/mock.rs", |
| ] |
| |
| test_deps = [ |
| "//examples/components/routing/fidl:echo-rustc", |
| "//third_party/rust_crates:matches", |
| ] |
| } |
| |
| expect_includes("includes") { |
| includes = [ "meta/fuchsia_component_test.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", |
| "framework_intermediary:fuchsia-component-test", |
| "tests", |
| ] |
| } |