| # 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/components.gni") |
| import("//src/starnix/build/starnix_linux_executable.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":starnix_memory_attribution_test" ] |
| } |
| |
| # Linux test programs that allocate memory |
| |
| starnix_linux_executable("mmap_anonymous_then_sleep") { |
| output_name = "mmap_anonymous_then_sleep" |
| sources = [ "mmap_anonymous_then_sleep.c" ] |
| cflags = [ "-std=c11" ] |
| |
| disable_syslog_backend = true |
| } |
| |
| fuchsia_package_with_single_component("mmap_anonymous_then_sleep_package") { |
| component_name = "mmap_anonymous_then_sleep" |
| manifest = "meta/mmap_anonymous_then_sleep.cml" |
| deps = [ ":mmap_anonymous_then_sleep" ] |
| testonly = true |
| } |
| |
| # Integration test component |
| |
| rustc_test("bin") { |
| name = "starnix_memory_attribution" |
| edition = "2021" |
| source_root = "main.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.memory.attribution:fuchsia.memory.attribution_rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/performance/memory/attribution/testing", |
| "//src/sys/lib/moniker", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:regex", |
| ] |
| |
| sources = [ "main.rs" ] |
| } |
| |
| fuchsia_component("realm") { |
| manifest = "meta/realm.cml" |
| testonly = true |
| } |
| |
| fuchsia_test_component("starnix_memory_attribution") { |
| manifest = "meta/integration_test.cml" |
| deps = [ ":bin" ] |
| test_type = "starnix" |
| } |
| |
| fuchsia_test_package("starnix_memory_attribution_test") { |
| test_components = [ ":starnix_memory_attribution" ] |
| deps = [ ":realm" ] |
| subpackages = [ |
| ":mmap_anonymous_then_sleep_package", |
| "//src/starnix/runner:starnix_package", |
| "//src/starnix/containers/debian:debian_package", |
| ] |
| } |