| # 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_binary.gni") | |
| import("//build/testing/run_target_test_and_host_script.gni") | |
| # Create a test wrapper that drives example apps either by connecting to | |
| # ViewProvider implemented by the app, or by starting the app via Binder | |
| # when the app presents itself via GraphicalPresenter. | |
| rustc_binary("bin") { | |
| name = "ui_app_instrumentor" | |
| testonly = true | |
| edition = "2024" | |
| source_root = "src/ui_app_instrumentor.rs" | |
| sources = [ "src/ui_app_instrumentor.rs" ] | |
| deps = [ | |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", | |
| "//sdk/fidl/fuchsia.session.scene:fuchsia.session.scene_rust", | |
| "//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_rust", | |
| "//src/lib/fidl/rust/fidl", | |
| "//src/lib/fuchsia", | |
| "//src/lib/fuchsia-async", | |
| "//src/lib/fuchsia-component", | |
| "//src/lib/ui/fuchsia-scenic", | |
| "//src/testing/system-validation:system_validation_lib", | |
| "//third_party/rust_crates:argh", | |
| "//third_party/rust_crates:log", | |
| ] | |
| } | |
| fuchsia_test_component("flatland_view_provider_system_validation_component") { | |
| component_name = "flatland_view_provider_system_validation" | |
| manifest = "tests/meta/flatland_view_provider_system_validation.cml" | |
| deps = [ ":bin" ] | |
| test_type = "system_validation" | |
| } | |
| fuchsia_test_component("simplest_sysmem_system_validation_component") { | |
| component_name = "simplest_sysmem_system_validation" | |
| manifest = "tests/meta/simplest_sysmem_system_validation.cml" | |
| deps = [ ":bin" ] | |
| test_type = "system_validation" | |
| } | |
| fuchsia_test_component("spinning_square_system_validation_component") { | |
| component_name = "spinning_square_system_validation" | |
| manifest = "tests/meta/spinning_square_system_validation.cml" | |
| deps = [ ":bin" ] | |
| test_type = "system_validation" | |
| } | |
| # To run tests: | |
| # fx test simplest_sysmem_system_validation | |
| # fx test spinning_square_system_validation | |
| # fx test flatland_view_provider_system_validation --ffx-output-directory /path/to/output/dir | |
| fuchsia_test_package("system_validation_test_pkg") { | |
| package_name = "system_validation" | |
| test_components = [ | |
| ":simplest_sysmem_system_validation_component", | |
| ":flatland_view_provider_system_validation_component", | |
| ":spinning_square_system_validation_component", | |
| ] | |
| deps = [ | |
| "//src/lib/ui/carnelian:spinning-square-rs_component", | |
| "//src/ui/examples/flatland-rainbow", | |
| "//src/ui/examples/simplest_sysmem:simplest_sysmem_component", | |
| ] | |
| } | |
| # fx set workstation_eng_paused.x64 --release --with-base //sdk/bundles:tools \ | |
| # --with-base //src/testing/system-validation:tests \ --with-host | |
| # //src/testing/system-validation/ui:flatland_view_provider_with_host_script | |
| # | |
| # fx test --e2e flatland_view_provider_with_host_script | |
| if (is_host && target_cpu == "x64" && !is_asan) { | |
| run_target_test_and_host_script("flatland_view_provider_with_host_script") { | |
| test_url = "fuchsia-pkg://fuchsia.com/system_validation#meta/flatland_view_provider_system_validation.cm" | |
| test_package = "//src/testing/system-validation/ui:system_validation_test_pkg(${target_toolchain})" | |
| host_script = "//src/performance/trace2json:bin" | |
| host_script_args = [ | |
| "--input-file=" + "{test_artifact_dir}/custom-0/trace.fxt", | |
| "--output-file=" + "{test_artifact_dir}/custom-0/trace.json", | |
| ] | |
| environments = [ emu_env ] | |
| } | |
| } else { | |
| group("flatland_view_provider_with_host_script") { | |
| } | |
| } |