| # 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxb/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/test.gni") |
| import("//build/unification/images/migrated_manifest.gni") |
| |
| import("//build/fuzzing/fuzzer.gni") |
| |
| import("//zircon/system/ulib/blobfs/test/blobfs_large_integration_test.gni") |
| |
| group("test") { |
| testonly = true |
| deps = [ |
| ":blobfs-integration", |
| ":blobfs-integration-paged", |
| ":blobfs-unit", |
| ":large-test", |
| ":zstd-fuzzer", |
| ":zstd-seekable-fuzzer", |
| ":zstd-seekable-symmetric-fuzzer", |
| ] |
| } |
| |
| group("large-test") { |
| testonly = true |
| deps = [ |
| ":blobfs-large-integration-fragmentation", |
| ":blobfs-large-integration-fragmentation-paged", |
| ":blobfs-large-integration-no-space", |
| ":blobfs-large-integration-no-space-paged", |
| ":blobfs-large-integration-short", |
| ":blobfs-large-integration-short-paged", |
| ":blobfs-large-integration-use-second-bitmap", |
| ":blobfs-large-integration-use-second-bitmap-paged", |
| ] |
| } |
| |
| config("test-utils-headers") { |
| # blob_utils.h is referred to as test/blob_utils.h. |
| include_dirs = [ ".." ] |
| } |
| |
| source_set("test-utils") { |
| # TODO(44278): revert to true. |
| testonly = false |
| sources = [ |
| "blob_utils.cc", |
| "blob_utils.h", |
| ] |
| deps = [ |
| "//zircon/public/lib/digest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zxtest", |
| ] |
| public_deps = [ |
| "..:blobfs", |
| "..:private_headers", |
| ] |
| public_configs = [ ":test-utils-headers" ] |
| } |
| |
| test("blobfs-unit") { |
| # Dependent manifests unfortunately cannot be marked as `testonly`. |
| # TODO(44278): Remove when converting this file to proper GN build idioms. |
| testonly = false |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| test_group = "fs" |
| sources = [ |
| "unit/allocated-extent-iterator-test.cc", |
| "unit/allocator-test.cc", |
| "unit/blob-cache-test.cc", |
| "unit/blob-loader-test.cc", |
| "unit/blob-test.cc", |
| "unit/blob-verifier-test.cc", |
| "unit/blobfs-checker-test.cc", |
| "unit/blobfs-pager-test.cc", |
| "unit/blobfs-test.cc", |
| "unit/blobfs_inspector_test.cc", |
| "unit/compressor-test.cc", |
| "unit/create-tests.cc", |
| "unit/extent-reserver-test.cc", |
| "unit/format-test.cc", |
| "unit/fsck-test.cc", |
| "unit/get-allocated-regions-test.cc", |
| "unit/node-populator-test.cc", |
| "unit/node-reserver-test.cc", |
| "unit/parser_test.cc", |
| "unit/seekable-compressor-test.cc", |
| "unit/utils.cc", |
| "unit/vector-extent-iterator-test.cc", |
| "unit/zstd-compressed-block-collection-test.cc", |
| "unit/zstd-seekable-blob-test.cc", |
| ] |
| deps = [ |
| ":test-utils", |
| "//sdk/fidl/fuchsia.blobfs:fuchsia.blobfs_c", |
| "//zircon/public/lib/async-loop", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/cksum", |
| "//zircon/public/lib/lz4", |
| "//zircon/public/lib/operation", |
| "//zircon/public/lib/safemath", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zstd", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/block-client:fake-device", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/fs-management", |
| "//zircon/system/ulib/fs-test-utils", |
| "//zircon/system/ulib/fs/test_support", |
| "//zircon/system/ulib/id_allocator", |
| "//zircon/system/ulib/storage/buffer", |
| ] |
| } |
| |
| test("blobfs-host") { |
| sources = [ "host/host-test.cc" ] |
| deps = [ |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/blobfs", |
| ] |
| } |
| |
| source_set("integration-fixtures") { |
| # TODO(44278): revert to true. |
| testonly = false |
| sources = [ "integration/blobfs_fixtures.cc" ] |
| deps = [ |
| ":test-utils", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/fs-test-utils", |
| "//zircon/system/ulib/fs/test_support", |
| "//zircon/system/ulib/fvm", |
| ] |
| } |
| |
| test("blobfs-integration") { |
| # Dependent manifests unfortunately cannot be marked as `testonly`. |
| # TODO(44278): Remove when converting this file to proper GN build idioms. |
| testonly = false |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| test_group = "fs" |
| sources = [ |
| "integration/blobfs_integration_test.cc", |
| "integration/fdio_test.cc", |
| "integration/fdio_test.h", |
| "integration/integration_main.cc", |
| "integration/mount_test.cc", |
| "integration/query_service_test.cc", |
| "integration/superblock-test.cc", |
| "integration/sync_test.cc", |
| ] |
| deps = [ |
| ":integration-fixtures", |
| ":test-utils", |
| "//sdk/fidl/fuchsia.blobfs:fuchsia.blobfs_c", |
| "//sdk/fidl/fuchsia.fs:fuchsia.fs_llcpp", |
| "//zircon/public/lib/async-loop", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fzl", |
| "//zircon/public/lib/memfs", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/fidl/fuchsia-boot:llcpp", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/block-client:fake-device", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/fs-test-utils", |
| "//zircon/system/ulib/fs/test_support", |
| "//zircon/system/ulib/fvm", |
| "//zircon/system/ulib/id_allocator", |
| ] |
| } |
| |
| source_set("load-generator") { |
| # TODO(44278): revert to true. |
| testonly = false |
| sources = [ "integration/load_generator.cc" ] |
| deps = [ |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/fs-test-utils", |
| ] |
| public_deps = [ ":test-utils" ] |
| } |
| |
| blobfs_large_integration_test("fragmentation") { |
| sources = [ "integration/large/fragmentation.cc" ] |
| } |
| |
| blobfs_large_integration_test("no-space") { |
| sources = [ "integration/large/no-space.cc" ] |
| } |
| |
| blobfs_large_integration_test("short") { |
| sources = [ "integration/large/short.cc" ] |
| } |
| |
| blobfs_large_integration_test("use-second-bitmap") { |
| sources = [ "integration/large/use-second-bitmap.cc" ] |
| } |
| |
| test("blobfs-integration-paged") { |
| # Dependent manifests unfortunately cannot be marked as `testonly`. |
| # TODO(44278): Remove when converting this file to proper GN build idioms. |
| testonly = false |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| test_group = "fs" |
| sources = [ |
| "integration/blobfs_integration_paged_main.cc", |
| "integration/launch.cc", |
| ] |
| deps = [ |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| fuzzer("zstd-fuzzer") { |
| sources = [ "zstd-fuzzer.cc" ] |
| deps = [ |
| "//third_party/zstd", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/blobfs:private_headers", |
| ] |
| } |
| |
| fuzzer("lz4-fuzzer") { |
| sources = [ "lz4-fuzzer.cc" ] |
| deps = [ |
| "//zircon/public/lib/lz4", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/blobfs:private_headers", |
| ] |
| } |
| |
| fuzzer("zstd-seekable-symmetric-fuzzer") { |
| sources = [ "zstd-seekable-symmetric-fuzzer.cc" ] |
| deps = [ |
| "//third_party/zstd:zstdseek", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/blobfs:private_headers", |
| ] |
| } |
| |
| fuzzer("zstd-seekable-fuzzer") { |
| sources = [ "zstd-seekable-fuzzer.cc" ] |
| deps = [ |
| "//third_party/zstd:zstdseek", |
| "//zircon/system/ulib/blobfs", |
| "//zircon/system/ulib/blobfs:private_headers", |
| ] |
| } |
| |
| executable("blobfs-load-generator") { |
| testonly = true |
| sources = [ "integration/load_generator_main.cc" ] |
| deps = [ |
| ":load-generator", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/fs-test-utils", |
| ] |
| } |
| |
| migrated_manifest("blobfs-unit-manifest") { |
| deps = [ ":blobfs-unit" ] |
| } |
| |
| migrated_manifest("blobfs-integration-manifest") { |
| deps = [ ":blobfs-integration" ] |
| } |
| |
| migrated_manifest("blobfs-integration-paged-manifest") { |
| deps = [ ":blobfs-integration-paged" ] |
| } |