| # Copyright 2019 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") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("lib") { |
| name = "run_test_suite_lib" |
| with_unit_tests = true |
| edition = "2021" |
| |
| # Only to be used by internal bin and tests. |
| visibility = [ |
| ":*", |
| "tests/*", |
| "//src/developer/ffx/plugins/test/*", |
| "//src/sys/test_runners/rust/tests/*", |
| ] |
| |
| deps = [ |
| "directory", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/test_diagnostics/rust:test_diagnostics", |
| "//src/lib/testing/test_list", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//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:parking_lot", |
| "//third_party/rust_crates:pin-project", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:vte", |
| ] |
| |
| test_deps = [ |
| "//third_party/rust_crates:ansi_term", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| if (!is_host) { |
| deps += [ "//src/lib/trace/rust:trace" ] |
| |
| test_deps += [ |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| } |
| |
| sources = [ |
| "src/artifacts.rs", |
| "src/cancel.rs", |
| "src/diagnostics.rs", |
| "src/lib.rs", |
| "src/outcome.rs", |
| "src/output/directory.rs", |
| "src/output/directory_with_stdout.rs", |
| "src/output/line.rs", |
| "src/output/memory.rs", |
| "src/output/mod.rs", |
| "src/output/mux.rs", |
| "src/output/noop.rs", |
| "src/output/shell/mod.rs", |
| "src/output/shell/writer.rs", |
| "src/params.rs", |
| "src/stream_util.rs", |
| "src/trace.rs", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| output_name = "run-test-suite" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/trace/rust:trace-provider", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_shell_package("run_test_suite_pkg") { |
| testonly = true |
| package_name = "run_test_suite" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_unittest_component("run-test-suite-lib-test") { |
| manifest = "meta/run_test_suite_lib_test.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_unittest_component("run-test-suite-bin-test") { |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_test_package("run-test-suite-unit-tests") { |
| test_components = [ |
| ":run-test-suite-lib-test", |
| ":run-test-suite-bin-test", |
| ] |
| } |
| |
| # fxbug.dev/44251: Packages cannot include other packages, so making a group here for dependency. |
| group("run_test_suite") { |
| testonly = true |
| deps = [ |
| ":run_test_suite_pkg", |
| "//src/sys/test_manager", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| #":lib_test($host_toolchain)", |
| ":run-test-suite-unit-tests", |
| "directory:tests", |
| "tests", |
| ] |
| } |