| # 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("//src/sys/core/build/core_shard.gni") |
| |
| group("packages") { |
| # Remove this once termina_guest_manager no longer sets "termina_extras_tests" to |
| # "true" by default. |
| testonly = true |
| |
| deps = [ |
| ":debian_guest_manager", |
| ":zircon_guest_manager", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":guest_manager_test" ] |
| } |
| |
| source_set("lib") { |
| visibility = [ "//src/virtualization/*" ] |
| |
| sources = [ |
| "guest_manager.cc", |
| "guest_manager.h", |
| "memory_pressure_handler.cc", |
| "memory_pressure_handler.h", |
| ] |
| |
| deps = [ "//zircon/system/ulib/virtio" ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_cpp", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_hlcpp", |
| "//sdk/fidl/fuchsia.virtualization:fuchsia.virtualization_cpp", |
| "//sdk/fidl/fuchsia.virtualization:fuchsia.virtualization_hlcpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| "//src/virtualization/lib/guest_config", |
| "//zircon/system/ulib/bitmap", |
| ] |
| |
| if (!defined(public_configs)) { |
| public_configs = [] |
| } |
| public_configs += [ "//src/virtualization/bin:args" ] |
| } |
| |
| executable("bin") { |
| output_name = "guest_manager" |
| |
| sources = [ "guest_manager_main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_package("zircon_guest_manager") { |
| testonly = true |
| deps = [ ":zircon_guest_manager_cmp" ] |
| subpackages = [ "//src/virtualization/packages/zircon_guest" ] |
| } |
| |
| fuchsia_component("zircon_guest_manager_cmp") { |
| visibility = [ ":*" ] |
| manifest = "meta/zircon_guest_manager.cml" |
| deps = [ |
| ":bin", |
| "//src/virtualization/bin/vmm:vmm_component", |
| ] |
| component_name = "zircon_guest_manager" |
| } |
| |
| fuchsia_package("debian_guest_manager") { |
| testonly = true |
| deps = [ ":debian_guest_manager_cmp" ] |
| subpackages = [ "//src/virtualization/packages/debian_guest" ] |
| } |
| |
| fuchsia_component("debian_guest_manager_cmp") { |
| visibility = [ ":*" ] |
| manifest = "meta/debian_guest_manager.cml" |
| deps = [ |
| ":bin", |
| "//src/virtualization/bin/vmm:vmm_component", |
| ] |
| component_name = "debian_guest_manager" |
| } |
| |
| executable("guest_manager_test_bin") { |
| testonly = true |
| |
| sources = [ |
| "guest_manager_test.cc", |
| "memory_pressure_handler_test.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_hlcpp", |
| "//sdk/fidl/fuchsia.virtualization.hardware:fuchsia.virtualization.hardware_hlcpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//src/testing/fidl:placeholders_hlcpp", |
| "//zircon/system/ulib/virtio", |
| ] |
| } |
| |
| resource("test_configs") { |
| sources = [ |
| "test_files/bad_schema_invalid_field.cfg", |
| "test_files/valid_guest.cfg", |
| ] |
| |
| outputs = [ "data/configs/{{source_file_part}}" ] |
| } |
| |
| fuchsia_unittest_package("guest_manager_test") { |
| deps = [ |
| ":guest_manager_test_bin", |
| ":test_configs", |
| ] |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |