blob: 6be3456d915e86bf1ed5cb2f92120b561745cd3c [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("//src/storage/testing/decompressor_wrapper.gni")
group("test") {
testonly = true
deps = [
":blobfs-fuzzers",
":blobfs-unittest-package",
":blobfs_host($host_toolchain)",
"integration:tests",
]
}
# test_binary.zstd results from building this target under core.x64-release and compressing with
# zstd. For now, this is a manual process, which should be fine since it shouldn't need to change
# very often.
executable("test_binary") {
testonly = true
sources = [ "test_binary_main.cc" ]
visibility = [ ":*" ]
}
resource("test_binary_resource") {
testonly = true
sources = [ "test_binary.zstd" ]
outputs = [ "data/test_binary.zstd" ]
visibility = [ ":*" ]
}
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 = [
":test_binary_resource",
"//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 = [
"//src/storage/blobfs",
"//src/storage/blobfs:decompressor_impl",
"//src/storage/lib/block_client/cpp:fake_device",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/id_allocator",
]
}
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_inspector_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/health_check_test.cc",
"unit/metrics_test.cc",
"unit/node_populator_test.cc",
"unit/node_reserver_test.cc",
"unit/parser_test.cc",
"unit/seekable_compressor_test.cc",
"unit/streaming_decompressor_test.cc",
"unit/vector_extent_iterator_test.cc",
]
deps = [
":test_utils",
"//sdk/lib/inspect/component/cpp",
"//src/lib/chunked-compression",
"//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_hlcpp",
"//src/storage/lib/block_client/cpp:fake_device",
"//src/storage/lib/fs_management",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/storage/operation",
"//zircon/system/ulib/sync",
"//zircon/third_party/ulib/cksum",
"//zircon/third_party/ulib/safemath",
]
# TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
# TODO(https://fxbug.dev/42085293): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-vla-cxx-extension" ]
}
fuchsia_unittest_component("blobfs-unittest") {
manifest = "meta/blobfs_unittest.cml"
deps = [
":blobfs_unittest",
":test_binary_resource",
]
}
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: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",
"//src/storage/blobfs",
"//src/storage/lib/block_client/cpp:fake_device",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
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" ]
}