blob: ba8195bb28c952d1cd256f80df06b4106c279d4a [file] [log] [blame]
# 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/testing/cc_test_executable.gni")
group("tests") {
testonly = true
deps = [
":memory_monitor_inspect_integration_tests",
":memory_monitor_tests",
]
}
cc_test_executable("memory_monitor_unittests") {
testonly = true
output_name = "memory_monitor_unittests"
sources = [
"high_water_unittest.cc",
"logger_unittest.cc",
"metrics_unittest.cc",
"monitor_fidl_unittest.cc",
"monitor_pressure_unittest.cc",
]
deps = [
"//sdk/lib/inspect/testing/cpp",
"//sdk/lib/sys/cpp/testing:unit",
"//src/cobalt/bin/testing:stub_metric_event_logger_lib",
"//src/developer/memory/metrics/tests:utils",
"//src/developer/memory/monitor:lib",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//zircon/system/ulib/fbl",
]
}
fuchsia_unittest_package("memory_monitor_tests") {
manifest = "meta/memory_monitor_unittests.cml"
deps = [ ":memory_monitor_unittests" ]
test_type = "system"
}
executable("bin-monitor") {
output_name = "memory_monitor_test_app"
sources = [ "monitor_test_app.cc" ]
testonly = true
deps = [
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//sdk/lib/sys/cpp",
"//src/developer/memory/metrics/tests:utils",
"//src/developer/memory/monitor:lib",
]
}
cc_test_executable("test-inspect") {
testonly = true
output_name = "memory_monitor_inspect_integration_tests"
sources = [ "monitor_inspect_test.cc" ]
deps = [
"//sdk/fidl/fuchsia.component:fuchsia.component_hlcpp",
"//sdk/lib/diagnostics/reader/cpp:archive_reader",
"//sdk/lib/sys/cpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//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.cml"
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.cml"
deps = [ ":test-inspect" ]
test_type = "system"
}
fuchsia_test_package("memory_monitor_inspect_integration_tests") {
test_components = [ ":memory_monitor_inspect_integration_tests_component" ]
deps = [
":memory_monitor_test_app_component",
"//src/storage/memfs:memfs_component",
]
}