| # Copyright 2020 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/dist/component_manifest_resources.gni") |
| import("//build/test.gni") |
| import("//build/testing/bootfs_test.gni") |
| |
| group("bootfs") { |
| deps = [ |
| ":bin", |
| ":meta", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":console-launcher-unittests" ] |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "console_launcher.cc", |
| "console_launcher.h", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_llcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/system/ulib/service:service-llcpp", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| |
| public_deps = [ |
| # console_launcher.h has #include <fidl/fuchsia.boot/cpp/wire.h> |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| |
| # console_launcher.h has #include <fidl/fuchsia.io/cpp/wire.h> |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| |
| # console_launcher.h has #include <fbl/unique_fd.h> |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "console-launcher" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.hardware.virtioconsole:fuchsia.hardware.virtioconsole_llcpp", |
| "//sdk/fidl/fuchsia.virtualconsole:fuchsia.virtualconsole_llcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| "//src/sys/lib/stdout-to-debuglog/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/service:service-llcpp", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| component_manifest_resources("meta") { |
| sources = [ "meta/console-launcher.cml" ] |
| } |
| |
| executable("unittests") { |
| output_name = "console-launcher_test" |
| testonly = true |
| |
| sources = [ "console_launcher_unittest.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/mock-boot-arguments", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| # Run with `fx test console-launcher-unittests`. |
| fuchsia_unittest_package("console-launcher-unittests") { |
| deps = [ ":unittests" ] |
| } |
| |
| test("shell-permissions-test") { |
| sources = [ "shell-permissions-test.cc" ] |
| |
| deps = [ |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| bootfs_test("shell-permissions-bootfs-test") { |
| name = "shell-permissions-test" |
| deps = [ ":shell-permissions-test" ] |
| } |