blob: dd4cebf22f5620b833ca78095e53b30a6eab6cc2 [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/test.gni")
static_library("transaction") {
sources = [
"buffered_operations_builder.cc",
"transaction_handler.cc",
]
public = [
"buffered_operations_builder.h",
"transaction_handler.h",
]
public_deps = [
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/storage/operation",
]
deps = [
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/storage/operation",
]
if (is_fuchsia) {
public += [ "device_transaction_handler.h" ]
sources += [ "device_transaction_handler.cc" ]
public_deps += [
"//sdk/fidl/fuchsia.hardware.block.driver:fuchsia.hardware.block.driver_banjo_c",
"//src/storage/lib/block_client/cpp:interface",
]
deps += [
"//sdk/fidl/fuchsia.hardware.block.driver:fuchsia.hardware.block.driver_banjo_c",
"//src/storage/lib/trace:cpp",
]
}
}
group("tests") {
testonly = true
deps = [ ":fs-transaction-tests" ]
}
test("fs-transaction-test") {
output_name = "fs_transaction_test"
sources = [
"buffered_operations_builder_test.cc",
"device_transaction_handler_test.cc",
]
deps = [
":transaction",
"//sdk/fidl/fuchsia.hardware.block.driver:fuchsia.hardware.block.driver_banjo_c",
"//src/lib/fxl/test:gtest_main",
"//src/storage/lib/block_client/cpp:fake_device",
"//src/storage/lib/block_client/cpp:interface",
"//third_party/googletest:gtest",
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/storage/operation",
"//zircon/system/ulib/zx",
]
}
fuchsia_unittest_package("fs-transaction-tests") {
manifest = "meta/fs_transaction_tests.cml"
deps = [ ":fs-transaction-test" ]
}