| # 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", |
| ":virtcon-setup-test", |
| ] |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "autorun.cc", |
| "autorun.h", |
| "console_launcher.cc", |
| "console_launcher.h", |
| "virtcon-setup.cc", |
| "virtcon-setup.h", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.boot", |
| "//sdk/fidl/fuchsia.hardware.virtioconsole:fuchsia.hardware.virtioconsole_llcpp", |
| "//sdk/fidl/fuchsia.kernel", |
| "//sdk/lib/fdio", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/fidl/fuchsia.virtualconsole:fuchsia.virtualconsole_llcpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/system/ulib/zxc", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| executable("bin") { |
| output_name = "console-launcher" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//sdk/lib/syslog/cpp:backend_legacy", |
| "//src/sys/lib/stdout-to-debuglog/cpp", |
| "//zircon/public/lib/zx", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| 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/public/lib/zxtest", |
| "//zircon/system/ulib/async-default", |
| "//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", |
| ] |
| } |
| |
| # 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/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| bootfs_test("shell-permissions-bootfs-test") { |
| name = "shell-permissions-test" |
| deps = [ ":shell-permissions-test" ] |
| } |
| |
| test("virtcon-setup-unittests") { |
| sources = [ "virtcon-setup-unittests.cc" ] |
| deps = [ |
| ":lib", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/mock-boot-arguments", |
| ] |
| } |
| |
| fuchsia_unittest_package("virtcon-setup-test") { |
| deps = [ ":virtcon-setup-unittests" ] |
| } |