blob: 83f0b16be8a94c7370e056b044d51fcb9deaf4d2 [file]
# Copyright 2018 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/config.gni")
group("tests") {
testonly = true
deps = [
":memory_monitor_inspect_integration_tests",
":memory_monitor_tests",
]
}
executable("memory_monitor_unittests") {
testonly = true
output_name = "memory_monitor_unittests"
sources = [
"high_water_unittest.cc",
"metrics_unittest.cc",
"monitor_fidl_unittest.cc",
"pressure_notifier_unittest.cc",
"pressure_observer_unittest.cc",
]
deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot_c",
"//sdk/fidl/fuchsia.hardware.ram.metrics:fuchsia.hardware.ram.metrics",
"//sdk/lib/inspect/testing/cpp",
"//sdk/lib/sys/cpp/testing:unit",
"//src/cobalt/bin/testing:fake_logger_lib",
"//src/developer/memory/metrics/tests:utils",
"//src/developer/memory/monitor:lib",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//src/storage/memfs",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_unittest_package("memory_monitor_tests") {
manifest = "meta/memory_monitor_unittests.cml"
deps = [ ":memory_monitor_unittests" ]
}
executable("bin-monitor") {
output_name = "memory_monitor_test_app"
sources = [ "monitor_test_app.cc" ]
deps = [
"//sdk/lib/sys/cpp",
"//src/developer/memory/monitor:lib",
"//src/lib/fxl",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
executable("test-inspect") {
testonly = true
output_name = "memory_monitor_inspect_integration_tests"
sources = [ "monitor_inspect_test.cc" ]
deps = [
"//sdk/lib/inspect/contrib/cpp:archive_reader",
"//sdk/lib/sys/cpp",
"//sdk/lib/sys/cpp/testing:integration_fixture",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/lib/storage/vfs/cpp",
"//third_party/googletest:gmock",
"//zircon/system/ulib/inspect",
]
}
fuchsia_component("memory_monitor_test_app_component") {
testonly = true
component_name = "memory_monitor_test_app"
manifest = "meta/memory_monitor_test_app.cmx"
deps = [ ":bin-monitor" ]
}
fuchsia_test_component("memory_monitor_inspect_integration_tests_component") {
component_name = "memory_monitor_inspect_integration_tests"
manifest = "meta/memory_monitor_inspect_integration_tests.cmx"
deps = [ ":test-inspect" ]
}
fuchsia_test_package("memory_monitor_inspect_integration_tests") {
package_deps_for_infra_only =
[ "//src/diagnostics/archivist:archivist-for-embedding" ]
test_components = [ ":memory_monitor_inspect_integration_tests_component" ]
deps = [ ":memory_monitor_test_app_component" ]
}