blob: cba212fc529f52e5ad7fa8865f1b6cc367129217 [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 = "gtest_runner_lib"
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fuchsia-fs",
"//src/sys/test_runners:lib",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
]
sources = [
"src/lib.rs",
"src/parser.rs",
]
}
common_deps = [
":lib",
"//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_rust",
"//sdk/fidl/fuchsia.io:fuchsia.io_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-fs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/namespace",
"//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:rand",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:uuid",
]
common_test_deps = [
"//src/lib/fuchsia",
"//src/sys/test_runners:test_lib",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:pretty_assertions",
]
common_sources = [
"src/main.rs",
"src/test_server.rs",
]
rustc_binary("gtest_bin") {
testonly = true
name = "gtest_runner"
with_unit_tests = true
edition = "2021"
features = [ "gtest" ]
deps = common_deps
test_deps = common_test_deps
sources = common_sources
}
rustc_binary("gunit_bin") {
testonly = true
name = "gunit_runner"
with_unit_tests = true
edition = "2021"
features = [ "gunit" ]
deps = common_deps
test_deps = common_test_deps
sources = common_sources
}
fuchsia_component("gtest-runner-component") {
testonly = true
manifest = "meta/gtest_runner.cml"
component_name = "gtest-runner"
deps = [ ":gtest_bin" ]
}
fuchsia_package("gtest-runner") {
testonly = true
visibility = [
":*",
"//bundles/assembly/*",
"//sdk/ctf/*",
"//src/sys/test_manager:*",
]
deps = [ ":gtest-runner-component" ]
}
fuchsia_unittest_package("gtest-runner-tests") {
deps = [
":gtest_bin_test",
"test_data:gtest_all_bins",
"//src/sys/test_runners/lib_loader_cache:lib_loader_runner_cache_cmp",
]
manifest = "meta/gtest_runner_bin_test.cml"
}
group("tests") {
testonly = true
deps = [
":gtest-runner-tests",
"tests",
]
}
# Depend on this if your test uses ASSERT_DEATH or EXPECT_DEATH
# and your test component's cml is generated.
group("death_test") {
testonly = true
metadata = {
# Used by the fuchsia_test_component_manifest() template.
test_component_manifest_cml = [
{
include = [ "//src/sys/test_runners/gtest/death_test.shard.cml" ]
},
]
}
}