| # Copyright 2020 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_binary.gni") | |
| rustc_binary("bin") { | |
| testonly = true | |
| name = "rust_test_runner" | |
| with_unit_tests = true | |
| edition = "2021" | |
| deps = [ | |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_rust", | |
| "//sdk/fidl/fuchsia.process:fuchsia.process_rust", | |
| "//sdk/fidl/fuchsia.test:fuchsia.test_rust", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-component", | |
| "//src/lib/fuchsia-runtime", | |
| "//src/lib/zircon/rust:fuchsia-zircon", | |
| "//src/sys/test_runners:lib", | |
| "//third_party/rust_crates:anyhow", | |
| "//third_party/rust_crates:async-trait", | |
| "//third_party/rust_crates:futures", | |
| "//third_party/rust_crates:lazy_static", | |
| "//third_party/rust_crates:regex", | |
| "//third_party/rust_crates:thiserror", | |
| "//third_party/rust_crates:tracing", | |
| ] | |
| test_deps = [ | |
| "//src/sys/test_runners:test_lib", | |
| "//third_party/rust_crates:assert_matches", | |
| "//third_party/rust_crates:itertools", | |
| "//third_party/rust_crates:pretty_assertions", | |
| ] | |
| sources = [ | |
| "src/main.rs", | |
| "src/test_server.rs", | |
| ] | |
| } | |
| fuchsia_component("rust_test_runner") { | |
| testonly = true | |
| manifest = "meta/rust-test-runner.cml" | |
| component_name = "rust-test-runner" | |
| deps = [ ":bin" ] | |
| } | |
| fuchsia_package("rust-test-runner") { | |
| testonly = true | |
| deps = [ ":rust_test_runner" ] | |
| } | |
| fuchsia_component("rust_test_next_vdso_runner") { | |
| testonly = true | |
| manifest = "meta/rust-test-next-vdso-runner.cml" | |
| component_name = "rust-test-next-vdso-runner" | |
| deps = [ ":bin" ] | |
| } | |
| fuchsia_package("rust-test-next-vdso-runner") { | |
| testonly = true | |
| deps = [ ":rust_test_next_vdso_runner" ] | |
| } | |
| group("rust") { | |
| testonly = true | |
| deps = [ | |
| ":rust-test-next-vdso-runner", | |
| ":rust-test-runner", | |
| ] | |
| } | |
| fuchsia_unittest_component("test-component") { | |
| deps = [ | |
| ":bin_test", | |
| "//src/sys/test_runners:test-with-process-launcher", | |
| ] | |
| } | |
| fuchsia_test_package("rust-test-runner-test") { | |
| test_components = [ ":test-component" ] | |
| deps = [ | |
| "test_data/huge-rust-tests", | |
| "test_data/no-rust-tests", | |
| "test_data/sample-rust-tests", | |
| "//src/sys/test_runners/lib_loader_cache:lib_loader_runner_cache_cmp", | |
| ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":rust-test-runner-test", | |
| "tests", | |
| ] | |
| } |