blob: 3bcc2731da28312110a8d2cf8c68c1d5ff542f92 [file] [log] [blame]
# 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 = "2018"
# Only to be used by internal bin and tests.
visibility = [
":*",
"ffx/component_test/*",
"ffx/test/*",
"tests/*",
"//src/sys/test_runners/rust/tests/*",
]
deps = [
"directory",
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//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/diagnostics/data/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/test_diagnostics/rust:test_diagnostics",
"//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:serde_json",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:vte",
]
if (!is_host) {
deps += [ "//src/lib/zircon/rust:fuchsia-zircon" ]
}
test_deps = [
"//src/lib/storage/vfs/rust:vfs",
"//third_party/rust_crates:ansi_term",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/artifact.rs",
"src/diagnostics.rs",
"src/error.rs",
"src/lib.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.rs",
"src/stream_util.rs",
]
}
rustc_binary("bin") {
output_name = "run-test-suite"
with_unit_tests = true
edition = "2018"
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/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 = [
":run-test-suite-unit-tests",
"directory:tests",
"tests",
]
}