blob: 635bbd6b762061008f244bdefd066f8efd149da1 [file] [log] [blame]
# 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")
import("//src/storage/fs_test/suite.gni")
group("tests") {
testonly = true
deps = [ ":disk-extractor-unit-test" ]
}
test("fvm_extractor_unit_test") {
testonly = true
sources = [ "fvm_extractor_test.cc" ]
deps = [
"//src/lib/fxl/test:gtest_main",
"//src/lib/storage/fs_management",
"//src/storage/extractor/c:disk_extractor",
"//src/storage/extractor/cpp:disk_extractor",
"//src/storage/gpt",
"//src/storage/lib/utils:topological_path",
"//src/storage/testing:storage_driver_test_support",
"//third_party/googletest:gtest",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
test("disk_extractor_unit_test") {
testonly = true
sources = [
"blobfs_extractor_test.cc",
"extractor_test.cc",
"hex_dump_generator_test.cc",
"minfs_extractor_test.cc",
]
deps = [
"//sdk/fidl/fuchsia.fs",
"//src/lib/fxl/test:gtest_main",
"//src/storage/blobfs/test/integration:blobfs_integration_fixtures",
"//src/storage/extractor/c:disk_extractor",
"//src/storage/extractor/cpp:disk_extractor",
"//src/storage/fs_test",
"//third_party/googletest:gtest",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/zxc",
"//zircon/third_party/ulib/cksum",
]
data_deps = [ "//src/storage/bin/blobfs" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_component("disk-extractor-unit-test-component") {
testonly = true
manifest = "meta/cpp_lib_tests.cml"
deps = [
":disk_extractor_unit_test",
"//src/storage/bin/minfs",
"//src/storage/minfs/test:minfs_fs_test_config",
"//src/storage/testing:storage_driver_test_realm",
]
}
fuchsia_component("fvm-extractor-unit-test") {
testonly = true
manifest = "meta/fvm_extractor_tests.cml"
deps = [
":fvm_extractor_unit_test",
"//src/storage/testing:storage_driver_test_realm",
]
}
fuchsia_test_package("disk-extractor-unit-test") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
test_components = [
":disk-extractor-unit-test-component",
":fvm-extractor-unit-test",
]
}
static_library("disk_extractor") {
public = [
"extractor.h",
"hex_dump_generator.h",
]
deps = [
"//src/lib/storage/vfs/cpp",
"//src/storage/gpt",
"//zircon/system/ulib/fbl",
"//zircon/third_party/ulib/cksum",
"//zircon/third_party/ulib/safemath:safemath",
]
sources = [
"extractor.cc",
"fvm_extractor.cc",
"hex_dump_generator.cc",
"minfs_extractor.cc",
]
public_deps = [
"//sdk/lib/fit-promise",
"//src/storage/blobfs",
"//src/storage/extractor/c:disk_extractor",
"//src/storage/minfs",
"//zircon/system/ulib/zxc",
]
if (is_fuchsia) {
sources += [ "blobfs_extractor.cc" ]
public_deps += [
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/id_allocator",
"//zircon/system/ulib/syslog",
]
deps += [
"//sdk/lib/fdio",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
]
include_dirs = [ ".." ]
} else {
sources += [ "blobfs_extractor_host.cc" ]
}
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}