blob: 6005bda11bc104ab3b12b9a1aa0a927b6ca72bff [file]
# 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")
import("//src/starnix/tests/starnix_test_subpackages.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
}
starnix_linux_executable("thread_group_leader_killed") {
output_name = "thread_group_leader_killed"
sources = [ "thread_group_leader_killed.c" ]
cflags = [
"-std=c11",
"-pthread",
]
ldflags = [ "-lpthread" ]
disable_syslog_backend = true
}
fuchsia_package_with_single_component("thread_group_leader_killed_package") {
component_name = "thread_group_leader_killed"
manifest = "meta/thread_group_leader_killed.cml"
deps = [ ":thread_group_leader_killed" ]
testonly = true
}
starnix_linux_executable("process_name_change") {
output_name = "process_name_change"
sources = [ "process_name_change.c" ]
cflags = [ "-std=c11" ]
disable_syslog_backend = true
}
fuchsia_package_with_single_component("process_name_change_package") {
component_name = "process_name_change"
manifest = "meta/process_name_change.cml"
deps = [ ":process_name_change" ]
testonly = true
}
# Integration test component
rustc_test("bin") {
name = "starnix_memory_attribution"
edition = "2024"
source_root = "main.rs"
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.memory.attribution:fuchsia.memory.attribution_rust",
"//sdk/fidl/fuchsia.process:fuchsia.process_rust",
"//sdk/fidl/fuchsia.starnix.container:fuchsia.starnix.container_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//sdk/rust/zx",
"//src/lib/diagnostics/reader/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component-test",
"//src/lib/fuchsia-runtime",
"//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",
":thread_group_leader_killed_package",
":process_name_change_package",
"//src/starnix/containers/debian:debian_package",
"//src/power/system-activity-governor/fake:package",
]
subpackages += starnix_test_subpackages
test_specs = {
# TODO(https://fxbug.dev/434146282): remove once test de-flaked
log_settings = {
max_severity = "ERROR"
}
package_resolution_timeout_secs = 660
}
}