| # 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/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| rustc_test("fuchsia_component_test_tests_bin") { |
| name = "fuchsia_component_test_tests_bin" |
| edition = "2018" |
| |
| #source_root = "src/main.rs" |
| sources = [ "src/lib.rs" ] |
| |
| deps = [ |
| "..:fuchsia-component-test", |
| "//examples/components/routing/fidl:echo-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/sys/lib/cm_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| } |
| |
| fuchsia_test_component("fuchsia_component_test_tests_component") { |
| manifest = "meta/fuchsia-component-test-tests.cml" |
| component_name = "fuchsia-component-test-tests" |
| deps = [ ":fuchsia_component_test_tests_bin" ] |
| } |
| |
| rustc_test("scoped-instance-test") { |
| edition = "2018" |
| source_root = "scoped_instance/lib.rs" |
| deps = [ |
| ":fuchsia.component.client.test-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/syslog/rust:syslog", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| sources = [ "scoped_instance/lib.rs" ] |
| } |
| |
| rustc_binary("realm") { |
| edition = "2018" |
| source_root = "scoped_instance/realm.rs" |
| testonly = true |
| deps = [ |
| ":fuchsia.component.client.test-rustc", |
| "//examples/components/routing/fidl:echo-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/syslog/rust:syslog", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| |
| sources = [ "scoped_instance/realm.rs" ] |
| } |
| |
| fidl("fuchsia.component.client.test") { |
| sources = [ "client.test.fidl" ] |
| } |
| |
| fuchsia_test_component("scoped_instance_test_component") { |
| component_name = "scoped_instance_test" |
| manifest = "meta/scoped_instance_test.cmx" |
| deps = [ ":scoped-instance-test" ] |
| } |
| |
| fuchsia_test_component("realm_component") { |
| component_name = "realm" |
| manifest = "meta/realm.cml" |
| deps = [ ":realm" ] |
| } |
| |
| fuchsia_test_component("realm_with_wait_component") { |
| component_name = "realm_with_wait" |
| manifest = "meta/realm_with_wait.cml" |
| deps = [ ":realm" ] |
| } |
| |
| fuchsia_test_package("fuchsia-component-test-tests") { |
| deps = [ |
| ":fuchsia_component_test_tests_component", |
| ":realm_component", |
| ":realm_with_wait_component", |
| "//examples/components/routing/echo_client:echo_client_component", |
| "//examples/components/routing/echo_server:echo_server_component", |
| ] |
| test_components = [ |
| ":fuchsia_component_test_tests_component", |
| ":scoped_instance_test_component", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fuchsia-component-test-tests" ] |
| } |