| # 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/test.gni") |
| |
| source_set("factoryfs") { |
| sources = [ |
| "admin_service.cc", |
| "admin_service.h", |
| "directory.cc", |
| "directory_entry.cc", |
| "factoryfs.cc", |
| "file.cc", |
| "format.cc", |
| "fsck.cc", |
| "mount.cc", |
| "runner.cc", |
| "superblock.cc", |
| ] |
| public_deps = [ |
| "//src/lib/storage/vfs/cpp", |
| "//src/lib/storage/vfs/cpp/transaction", |
| "//zircon/system/ulib/bitmap", |
| "//zircon/system/ulib/storage/buffer", |
| "//zircon/system/ulib/zx", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.fs:fuchsia.fs_cpp_wire", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_wire", |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/storage/block_client/cpp", |
| "//src/lib/storage/vfs/cpp", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/trace-engine", |
| "//zircon/system/ulib/trace-provider", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| test("factoryfs_unit") { |
| testonly = true |
| sources = [ |
| "create_tests.cc", |
| "format_test.cc", |
| "fsck_test.cc", |
| "utils.cc", |
| ] |
| deps = [ |
| ":factoryfs", |
| "//src/lib/storage/block_client/cpp:fake_device", |
| "//src/lib/storage/fs_management", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/storage/buffer", |
| "//zircon/system/ulib/storage/operation", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zxtest", |
| "//zircon/third_party/ulib/safemath", |
| ] |
| } |
| |
| fuchsia_unittest_component("factoryfs-unit") { |
| deps = [ ":factoryfs_unit" ] |
| } |
| |
| test("integration_test") { |
| sources = [ "integration_test.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.block.driver:fuchsia.hardware.block.driver_banjo_cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/storage/fs_management", |
| "//src/storage/testing:storage_driver_test_support", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| fuchsia_component("factoryfs-integration-test") { |
| testonly = true |
| manifest = "meta/factory_integration_tests.cml" |
| deps = [ |
| ":integration_test", |
| "//src/storage/bin/factoryfs", |
| "//src/storage/factory/export_ffs:bin", |
| "//src/storage/testing:storage_driver_test_realm", |
| ] |
| } |
| |
| fuchsia_test_package("factoryfs-tests") { |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| test_components = [ |
| ":factoryfs-unit", |
| ":factoryfs-integration-test", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":factoryfs-tests" ] |
| } |