blob: 67a42e2404b5acbbdf921082c70de0d793731f8a [file] [log] [blame]
# 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/components.gni")
import("//build/fuzz.gni")
import("//build/test.gni")
import("//build/testing/cc_test_executable.gni")
group("test") {
testonly = true
deps = [
":blobfs-fuzzers",
":blobfs-unittest-package",
":blobfs_host($host_toolchain)",
"integration:tests",
]
}
source_set("test_utils") {
testonly = true
sources = [
"blob_utils.cc",
"blob_utils.h",
"blobfs_test_setup.cc",
"blobfs_test_setup.h",
"test_scoped_vnode_open.h",
"unit/local_decompressor_creator.cc",
"unit/local_decompressor_creator.h",
"unit/utils.cc",
"unit/utils.h",
]
deps = [
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//src/lib/digest",
"//third_party/googletest:gtest",
"//third_party/zstd",
"//zircon/system/ulib/fbl",
"//zircon/third_party/ulib/safemath",
]
public_deps = [
"//sdk/lib/async-loop",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//sdk/lib/fidl/cpp/wire",
"//src/storage/blobfs",
"//src/storage/blobfs:decompressor_impl",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_cpp",
"//src/storage/lib/block_client/cpp:fake_device",
"//zircon/system/ulib/id_allocator",
"//zircon/system/ulib/sync:sync-cpp",
]
data_deps = [ "//src/storage/blobfs/test/testdata:test_binary_resource" ]
}
test("blobfs_unittest") {
sources = [
"unit/allocated_extent_iterator_test.cc",
"unit/allocator_test.cc",
"unit/base_allocator_test.cc",
"unit/blob_cache_test.cc",
"unit/blob_layout_test.cc",
"unit/blob_loader_test.cc",
"unit/blob_test.cc",
"unit/blob_verifier_test.cc",
"unit/blobfs_checker_test.cc",
"unit/blobfs_migration_test.cc",
"unit/blobfs_revision_test.cc",
"unit/blobfs_test.cc",
"unit/common_test.cc",
"unit/compression_settings_test.cc",
"unit/compressor_test.cc",
"unit/create_tests.cc",
"unit/decompressor_sandbox_test.cc",
"unit/delivery_blob_test.cc",
"unit/extent_reserver_test.cc",
"unit/format_test.cc",
"unit/fsck_test.cc",
"unit/get_allocated_regions_test.cc",
"unit/metrics_test.cc",
"unit/node_populator_test.cc",
"unit/node_reserver_test.cc",
"unit/ota_health_check_test.cc",
"unit/seekable_compressor_test.cc",
"unit/streaming_decompressor_test.cc",
"unit/vector_extent_iterator_test.cc",
]
deps = [
":test_utils",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/inspect/component/cpp",
"//src/lib/chunked-compression",
"//src/lib/files",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//src/lib/testing/predicates",
"//src/storage/blobfs",
"//src/storage/blobfs:decompressor_impl",
"//src/storage/blobfs:fuchsia.blobfs.internal_cpp",
"//src/storage/lib/block_client/cpp:fake_device",
"//src/storage/lib/fs_management",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//third_party/zstd",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/storage/operation",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
"//zircon/third_party/ulib/cksum",
"//zircon/third_party/ulib/safemath",
]
data_deps = [ "//src/storage/blobfs/test/testdata:blobfs_images" ]
# TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
fuchsia_unittest_component("blobfs-unittest") {
manifest = "meta/blobfs_unittest.cml"
deps = [ ":blobfs_unittest" ]
}
fuchsia_test_package("blobfs-unittest-package") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
package_name = "blobfs-unittest"
test_components = [ ":blobfs-unittest" ]
}
test("blobfs_host") {
sources = [ "host/host_test.cc" ]
deps = [
"//src/lib/chunked-compression",
"//src/lib/fxl/test:gtest_main",
"//src/storage/blobfs",
"//third_party/googletest:gtest",
]
}
fuchsia_library_fuzzer("blob-fuzzer") {
sources = [ "unit/blob_fuzzer.cc" ]
deps = [
":test_utils",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//src/storage/blobfs",
"//src/storage/lib/block_client/cpp:fake_device",
]
}
fuchsia_fuzzer_component("blob-fuzzer-component") {
manifest = "meta/blob_fuzzer.cml"
deps = [ ":blob-fuzzer" ]
}
fuchsia_fuzzer_package("blobfs-fuzzers") {
cpp_fuzzer_components = [ ":blob-fuzzer-component" ]
}