| # Copyright 2019 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/dist/component_manifest_resources.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/fuchsia_unittest_package.gni") |
| |
| executable("console") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ "main.cc" ] |
| deps = [ |
| ":common", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", |
| "//sdk/lib/fdio", |
| "//src/sys/lib/stdout-to-debuglog/cpp", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/fs-pty", |
| "//zircon/system/ulib/svc", |
| ] |
| } |
| |
| source_set("common") { |
| visibility = [ ":*" ] |
| sources = [ |
| "console.cc", |
| "console.h", |
| "fifo.cc", |
| "fifo.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.pty:fuchsia.hardware.pty_llcpp", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_llcpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/cmdline", |
| "//zircon/system/ulib/fs", |
| "//zircon/system/ulib/syslog:syslog-headers", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//sdk/lib/fdio", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| ] |
| } |
| |
| test("console-test") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| |
| sources = [ |
| "console-test.cc", |
| "fifo-test.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| component_manifest_resources("bootfs") { |
| sources = [ "meta/console.cml" ] |
| } |
| |
| fuchsia_unittest_package("console-test-pkg") { |
| package_name = "console-test" |
| executable_path = "test/console-test" |
| deps = [ ":console-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":console-test-pkg" ] |
| } |