|  | # 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/test.gni") | 
|  |  | 
|  | source_set("launcher") { | 
|  | visibility = [ ":*" ] | 
|  | sources = [ "fdio.cc" ] | 
|  | deps = [ | 
|  | "//sdk/lib/fdio", | 
|  | "//zircon/public/lib/fbl", | 
|  | "//zircon/public/lib/fidl", | 
|  | "//zircon/public/lib/zircon-internal", | 
|  | "//zircon/public/lib/zx", | 
|  | ] | 
|  | } | 
|  |  | 
|  | source_set("fshost-registry") { | 
|  | configs += [ "//build/unification/config:zircon-migrated" ] | 
|  | sources = [ | 
|  | "admin-server.cc", | 
|  | "fs-manager.cc", | 
|  | "lifecycle.cc", | 
|  | "registry.cc", | 
|  | "registry_vnode.cc", | 
|  | ] | 
|  | public_deps = [ | 
|  | ":inspect", | 
|  | ":launcher", | 
|  | ":metrics", | 
|  | "//sdk/fidl/fuchsia.fshost:fuchsia.fshost_llcpp", | 
|  | "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_llcpp", | 
|  | "//sdk/lib/vfs/cpp", | 
|  | "//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/fs", | 
|  | "//zircon/system/ulib/memfs", | 
|  | ] | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", | 
|  | "//sdk/lib/fdio", | 
|  | "//zircon/public/lib/fbl", | 
|  | "//zircon/public/lib/zircon-internal", | 
|  | "//zircon/system/ulib/fidl-async:fidl-async-cpp", | 
|  | "//zircon/system/ulib/loader-service", | 
|  | "//zircon/system/ulib/memfs:memfs-cpp", | 
|  | ] | 
|  | } | 
|  |  | 
|  | source_set("inspect") { | 
|  | configs += [ "//build/unification/config:zircon-migrated" ] | 
|  | sources = [ | 
|  | "inspect-manager.cc", | 
|  | "inspect-manager.h", | 
|  | ] | 
|  | public_deps = [ | 
|  | "//sdk/lib/sys/inspect/cpp", | 
|  | "//src/lib/fsl", | 
|  | "//zircon/public/lib/fbl", | 
|  | "//zircon/public/lib/fdio", | 
|  | "//zircon/system/ulib/fs", | 
|  | "//zircon/system/ulib/memfs", | 
|  | ] | 
|  | } | 
|  |  | 
|  | source_set("metrics") { | 
|  | configs += [ "//build/unification/config:zircon-migrated" ] | 
|  | sources = [ | 
|  | "metrics.cc", | 
|  | "metrics.h", | 
|  | ] | 
|  | public_deps = [ | 
|  | "//zircon/public/lib/async-cpp", | 
|  | "//zircon/system/ulib/cobalt-client", | 
|  | "//zircon/system/ulib/fs/metrics:metrics-cobalt", | 
|  | ] | 
|  | deps = [ | 
|  | "//zircon/system/ulib/cobalt-client", | 
|  | "//zircon/system/ulib/fs/metrics:metrics-cobalt", | 
|  | ] | 
|  | } | 
|  |  | 
|  | source_set("block-watcher") { | 
|  | configs += [ "//build/unification/config:zircon-migrated" ] | 
|  | sources = [ | 
|  | "block-device.cc", | 
|  | "block-watcher.cc", | 
|  | "encrypted-volume.cc", | 
|  | "filesystem-mounter.cc", | 
|  | "fshost-fs-provider.cc", | 
|  | "pkgfs-launcher.cc", | 
|  | ] | 
|  | public_deps = [ | 
|  | ":fshost-registry", | 
|  | ":launcher", | 
|  | ":metrics", | 
|  | "//sdk/fidl/fuchsia.fshost:fuchsia.fshost_llcpp", | 
|  | "//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/fdio-caller", | 
|  | "//zircon/system/ulib/fs", | 
|  | "//zircon/system/ulib/memfs", | 
|  | ] | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_c", | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", | 
|  | "//sdk/fidl/fuchsia.device:fuchsia.device_c", | 
|  | "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", | 
|  | "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_c", | 
|  | "//sdk/fidl/fuchsia.hardware.block.encrypted:fuchsia.hardware.block.encrypted_c", | 
|  | "//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition_c", | 
|  | "//sdk/lib/fdio", | 
|  | "//src/security/zxcrypt:zxcrypt-fdio", | 
|  | "//zircon/public/lib/fbl", | 
|  | "//zircon/public/lib/fidl", | 
|  | "//zircon/public/lib/fit", | 
|  | "//zircon/public/lib/zircon-internal", | 
|  | "//zircon/public/lib/zx", | 
|  | "//zircon/system/ulib/fidl-async:fidl-async-cpp", | 
|  | "//zircon/system/ulib/fs", | 
|  | "//zircon/system/ulib/fs-management", | 
|  | "//zircon/system/ulib/gpt", | 
|  | "//zircon/system/ulib/loader-service", | 
|  | "//zircon/system/ulib/minfs", | 
|  | "//zircon/system/ulib/trace", | 
|  | "//zircon/system/ulib/trace-engine", | 
|  | ] | 
|  | } | 
|  |  | 
|  | executable("fshost") { | 
|  | 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 = [ | 
|  | ":block-watcher", | 
|  | ":fshost-registry", | 
|  | ":metrics", | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_c", | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", | 
|  | "//sdk/fidl/fuchsia.fshost:fuchsia.fshost_c", | 
|  | "//sdk/fidl/fuchsia.fshost:fuchsia.fshost_llcpp", | 
|  | "//sdk/fidl/fuchsia.ldsvc:fuchsia.ldsvc_c", | 
|  | "//src/sys/lib/stdout-to-debuglog/cpp", | 
|  | "//zircon/system/ulib/cobalt-client", | 
|  | "//zircon/system/ulib/fidl-async:fidl-async-cpp", | 
|  | "//zircon/system/ulib/fs-management", | 
|  | "//zircon/system/ulib/loader-service", | 
|  | "//zircon/system/ulib/ramdevice-client", | 
|  | "//zircon/system/ulib/zbi-bootfs", | 
|  | ] | 
|  | } | 
|  |  | 
|  | test("fshost-test") { | 
|  | # Dependent manifests unfortunately cannot be marked as `testonly`. | 
|  | # TODO(44278): Remove when converting this file to proper GN build idioms. | 
|  | if (is_fuchsia) { | 
|  | testonly = false | 
|  | } | 
|  | 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 = [ | 
|  | "delayed-outdir-test.cc", | 
|  | "fshost-boot-args-test.cc", | 
|  | "fshost-test.cc", | 
|  | ] | 
|  | deps = [ | 
|  | ":block-watcher", | 
|  | ":fshost-registry", | 
|  | ":metrics", | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", | 
|  | "//sdk/fidl/fuchsia.io:fuchsia.io_c", | 
|  | "//zircon/public/lib/zxtest", | 
|  | "//zircon/system/ulib/cobalt-client", | 
|  | "//zircon/system/ulib/cobalt-client:in-memory-logger", | 
|  | "//zircon/system/ulib/fidl-async", | 
|  | "//zircon/system/ulib/loader-service", | 
|  | "//zircon/system/ulib/mock-boot-arguments", | 
|  | ] | 
|  |  | 
|  | # TODO(46432): Fix the leaks and remove this. | 
|  | deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] | 
|  | } | 
|  |  | 
|  | test("fshost-inspect-test") { | 
|  | # Dependent manifests unfortunately cannot be marked as `testonly`. | 
|  | # TODO(44278): Remove when converting this file to proper GN build idioms. | 
|  | if (is_fuchsia) { | 
|  | testonly = false | 
|  | } | 
|  | 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 | 
|  | } | 
|  | } | 
|  | test_group = "ddk" | 
|  | sources = [ "inspect-manager-test.cc" ] | 
|  | deps = [ | 
|  | ":inspect", | 
|  | "//zircon/public/lib/async", | 
|  | "//zircon/public/lib/zxtest", | 
|  | "//zircon/system/ulib/async-loop:async-loop-cpp", | 
|  | "//zircon/system/ulib/async-loop:async-loop-default", | 
|  | "//zircon/system/ulib/inspect", | 
|  | ] | 
|  | } | 
|  |  | 
|  | test("fshost-metrics-test") { | 
|  | # Dependent manifests unfortunately cannot be marked as `testonly`. | 
|  | # TODO(44278): Remove when converting this file to proper GN build idioms. | 
|  | if (is_fuchsia) { | 
|  | testonly = false | 
|  | } | 
|  | 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 = [ "metrics-test.cc" ] | 
|  | deps = [ | 
|  | ":metrics", | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", | 
|  | "//sdk/lib/fdio", | 
|  | "//zircon/public/lib/zxtest", | 
|  | "//zircon/system/ulib/async-testing", | 
|  | "//zircon/system/ulib/cobalt-client:in-memory-logger", | 
|  | "//zircon/system/ulib/fs/metrics:metrics-cobalt", | 
|  | ] | 
|  | } | 
|  |  | 
|  | test("block-watcher-test") { | 
|  | # Dependent manifests unfortunately cannot be marked as `testonly`. | 
|  | # TODO(44278): Remove when converting this file to proper GN build idioms. | 
|  | if (is_fuchsia) { | 
|  | testonly = false | 
|  | } | 
|  | 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 = [ | 
|  | "block-device-test.cc", | 
|  | "block-watcher-test.cc", | 
|  | "filesystem-mounter-test.cc", | 
|  | ] | 
|  | deps = [ | 
|  | ":block-watcher", | 
|  | "//sdk/fidl/fuchsia.boot:fuchsia.boot_llcpp", | 
|  | "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", | 
|  | "//zircon/public/lib/zxtest", | 
|  | "//zircon/system/ulib/cobalt-client:in-memory-logger", | 
|  | "//zircon/system/ulib/fidl-async", | 
|  | "//zircon/system/ulib/fs-management", | 
|  | "//zircon/system/ulib/fs/metrics:metrics-cobalt", | 
|  | "//zircon/system/ulib/loader-service", | 
|  | "//zircon/system/ulib/minfs", | 
|  | "//zircon/system/ulib/ramdevice-client", | 
|  | ] | 
|  | } |