| # Copyright 2024 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/component/config.gni") |
| import("//build/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/testing/perf/test.gni") |
| |
| rustc_binary("bin") { |
| name = "component_lifecycle_benchmark" |
| edition = "2024" |
| |
| source_root = "src/main.rs" |
| testonly = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.process:fuchsia.process_rust", |
| "//sdk/rust/zx", |
| "//src/developer/fuchsia-criterion", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/fuchsia-sync", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:rand", |
| ] |
| |
| sources = [ source_root ] |
| } |
| |
| component_config("config") { |
| testonly = true |
| sources = [ "config.json5" ] |
| dest = "data/component_manager_config" |
| } |
| |
| fuchsia_component("component_manager") { |
| testonly = true |
| manifest = "meta/component_manager.cml" |
| deps = [ |
| ":config", |
| "//src/sys/component_manager:bin_with_tracing", |
| ] |
| } |
| |
| fuchsia_component("root_component") { |
| testonly = true |
| manifest = "meta/root_component.cml" |
| } |
| |
| fuchsia_package_with_single_component("component_lifecycle_benchmark") { |
| testonly = true |
| deps = [ |
| ":bin", |
| ":component_manager", |
| ":root_component", |
| "test_data:with_log", |
| "test_data:with_log_and_stdout", |
| "test_data:without_log", |
| "//src/sys/loopback_resolver:component", |
| ] |
| manifest = "meta/component_lifecycle_benchmark.cml" |
| } |
| |
| fuchsia_component_perf_test("component_lifecycle_benchmark-test") { |
| package = ":component_lifecycle_benchmark" |
| component_name = "component_lifecycle_benchmark" |
| expected_metric_names_filepath = "//src/tests/end_to_end/perf/expected_metric_names/fuchsia.component.lifecycle.txt" |
| |
| test_type = "component_framework" |
| } |
| |
| group("benchmark") { |
| testonly = true |
| deps = [ ":component_lifecycle_benchmark-test" ] |
| } |