| # Copyright 2022 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_test.gni") |
| import("//tools/cmc/build/expect_includes.gni") |
| |
| rustc_library("lib") { |
| edition = "2021" |
| testonly = true |
| name = "netemul_runner_tests" |
| deps = [ |
| ":test_includes", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust", |
| "//src/lib/fuchsia-component", |
| "//src/sys/test_manager:test_lib", |
| "//src/sys/test_runners:test_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures-util", |
| ] |
| sources = [ "src/lib.rs" ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| disable_rustdoc = true |
| } |
| |
| expect_includes("test_includes") { |
| includes = [ "common.shard.cml" ] |
| } |
| |
| rustc_test("netemul_runner_test") { |
| edition = "2021" |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust", |
| "//src/lib/fuchsia-async", |
| "//src/sys/test_manager:test_lib", |
| "//third_party/rust_crates:test-case", |
| ] |
| source_root = "src/test.rs" |
| sources = [ "src/test.rs" ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_unittest_package("netemul-runner-tests") { |
| deps = [ |
| ":netemul_runner_test", |
| "test-data", |
| "//src/connectivity/network/testing/netemul/runner:component", |
| ] |
| subpackages = [ "//src/sys/test_manager:pkg" ] |
| test_type = "test_arch" |
| } |
| |
| rustc_test("netemul_runner_errors_test") { |
| edition = "2021" |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:test-case", |
| ] |
| source_root = "src/errors.rs" |
| sources = [ "src/errors.rs" ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_unittest_package("netemul-runner-errors-tests") { |
| deps = [ |
| ":netemul_runner_errors_test", |
| "test-data", |
| "//src/connectivity/network/testing/netemul/runner:component", |
| ] |
| |
| subpackages = [ "//src/sys/test_manager:pkg" ] |
| |
| # TODO(https://fxbug.dev/42144060): allowlist ERROR logs from netemul_test_runner |
| # when testing invalid test configurations that cause it to emit ERROR logs. |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| test_type = "test_arch" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":netemul-runner-tests" ] |
| |
| # TODO(https://fxbug.dev/42177092): deflake the following test on coverage bots and |
| # re-enable. |
| if (!is_coverage) { |
| deps += [ ":netemul-runner-errors-tests" ] |
| } |
| } |