| # 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_test.gni") |
| |
| rustc_test("test_manager_test_bin") { |
| edition = "2021" |
| name = "test_manager_test" |
| source_root = "src/tests.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/test_diagnostics/rust:test_diagnostics", |
| "//src/sys/test_manager:test_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:pretty_assertions", |
| ] |
| |
| sources = [ "src/tests.rs" ] |
| |
| inputs = [ |
| "//src/sys/test_runners/gtest/test_data/sample_tests_golden_events.rsf", |
| ] |
| } |
| |
| rustc_test("test_manager_stress_test_bin") { |
| edition = "2021" |
| name = "test_manager_stress_test" |
| source_root = "src/stress_tests.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/test_diagnostics/rust:test_diagnostics", |
| "//src/sys/test_manager:test_lib", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:pretty_assertions", |
| ] |
| |
| sources = [ "src/stress_tests.rs" ] |
| } |
| |
| rustc_test("test_manager_specified_realm_bin") { |
| edition = "2021" |
| name = "test_manager_specified_realm_test" |
| source_root = "src/specified_realm_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager_rust", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/test_diagnostics/rust:test_diagnostics", |
| "//src/sys/test_manager:test_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:pretty_assertions", |
| ] |
| |
| sources = [ "src/specified_realm_test.rs" ] |
| } |
| |
| fuchsia_test_component("test_manager_test_component") { |
| component_name = "test_manager_test" |
| manifest = "meta/test_manager_test.cml" |
| deps = [ ":test_manager_test_bin" ] |
| test_type = "test_arch" |
| } |
| |
| fuchsia_test_package("test_manager_test") { |
| test_components = [ ":test_manager_test_component" ] |
| deps = [ "test_data" ] |
| |
| subpackages = [ |
| "//src/sys/test_manager:pkg", |
| |
| # even though we don't use this as a sub-package (in the code), this will |
| # make sure that required blobs are in build graph and cached. |
| # TODO(b/301507292) : Remove these |
| "//examples/components/routing/integration_tests/cpp:subpackaged_echo_integration_test_cpp", |
| "//examples/components/routing/integration_tests/rust:subpackaged_echo_integration_test_rust", |
| "//src/sys/test_runners/gtest/test_data:gtest-runner-example-tests", |
| "diagnostics_tests:test-manager-diagnostics-tests", |
| ] |
| |
| # There's expected error logs that happen during the test such as not resolving an instance when |
| # testing that we fail to execute a test with an unknown URL. |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fuchsia_component("test_realm") { |
| testonly = true |
| manifest = "meta/test_realm.cml" |
| } |
| |
| fuchsia_test_component("test_manager_specified_realm_test_component") { |
| component_name = "test_manager_specified_realm_test" |
| manifest = "meta/test_manager_specified_realm_test.cml" |
| deps = [ ":test_manager_specified_realm_bin" ] |
| |
| test_type = "test_arch" |
| } |
| |
| fuchsia_test_package("test_manager_specified_realm_test") { |
| test_components = [ ":test_manager_specified_realm_test_component" ] |
| deps = [ |
| ":test_realm", |
| "test_data:custom_artifact_realm_test", |
| "test_data:debug_data_write_test", |
| "test_data:echo_test_client", |
| "test_data:echo_test_realm", |
| "//examples/components/routing/rust/echo_server:echo_server_cmp", |
| "//examples/tests/rust:custom_artifact_user_cmp", |
| "//src/lib/fuchsia-component-test/realm_builder_server:realm_builder_server_component", |
| ] |
| |
| subpackages = [ |
| "//src/sys/test_manager:pkg", |
| |
| # even though we don't use this as a sub-package (in the code), this will |
| # make sure that required blobs are in build graph and cached. |
| # TODO(b/301507292) : Remove this |
| "diagnostics_tests:test-manager-diagnostics-tests", |
| ] |
| } |
| |
| fuchsia_test_component("test_manager_stress_test_component") { |
| component_name = "test_manager_stress_test" |
| manifest = "meta/test_manager_stress_test.cml" |
| deps = [ |
| ":test_manager_stress_test_bin", |
| "test_data:debug_data_spam_test", |
| ] |
| |
| test_type = "test_arch" |
| } |
| |
| fuchsia_test_package("test_manager_stress_test") { |
| test_components = [ ":test_manager_stress_test_component" ] |
| deps = [ "test_data:debug_data_spam_test" ] |
| |
| subpackages = [ "//src/sys/test_manager:pkg" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":test_manager_specified_realm_test", |
| ":test_manager_stress_test", |
| ":test_manager_test", |
| "chromium_tests:tests", |
| "diagnostics_tests:tests", |
| "nonhermetic_packaged_tests:tests", |
| "test_data:debug-data-test", |
| |
| # test_manager_test launches these tests. |
| # TODO(b/301507292): consider reorganizing these tests so that these dependencies |
| # are not necessary. |
| "//examples/components/routing/integration_tests/cpp:subpackaged_echo_integration_test_cpp", |
| "//examples/components/routing/integration_tests/rust:subpackaged_echo_integration_test_rust", |
| "//src/sys/test_runners/gtest/test_data:gtest-runner-example-tests", |
| ] |
| } |