| # 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") |
| |
| common_deps = [ |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.process:fuchsia.process-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//sdk/fidl/fuchsia.test:fuchsia.test-rustc", |
| "//sdk/fidl/fuchsia.test:rust_measure_tape_for_case", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/runner", |
| "//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", |
| "//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 |
| deps = [ ":gtest-runner-component" ] |
| } |
| |
| group("gtest") { |
| testonly = true |
| deps = [ ":gtest-runner" ] |
| } |
| |
| 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" ] |
| }, |
| ] |
| } |
| } |