blob: b9a030be2dba33a7c570b8c18ce8317e9e22e4e6 [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/testing/environments.gni")
source_set("compression-interfaces") {
public = [
"compressor.h",
"decompressor.h",
]
public_deps = [
"//sdk/lib/fit",
"//sdk/lib/fit-promise",
"//zircon/system/ulib/fbl",
]
}
source_set("lz4-compression") {
sources = [
"lz4_compressor.cc",
"lz4_decompressor.cc",
]
public = [
"lz4_compressor.h",
"lz4_decompressor.h",
]
public_deps = [
":compression-interfaces",
"//sdk/lib/fit-promise",
"//src/storage/volume_image:options",
"//zircon/system/ulib/fbl",
"//zircon/third_party/ulib/lz4",
]
}
source_set("lz4-compression-test") {
testonly = true
sources = [
"lz4_compressor_test.cc",
"lz4_decompressor_test.cc",
]
deps = [
":lz4-compression",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
source_set("lz4-decompress-reader") {
sources = [ "lz4_decompress_reader.cc" ]
public = [ "lz4_decompress_reader.h" ]
public_deps = [
":io-interfaces",
":lz4-compression",
"//sdk/lib/fit",
"//zircon/system/ulib/fbl",
]
}
source_set("lz4-decompress-reader-test") {
testonly = true
sources = [ "lz4_decompress_reader_test.cc" ]
deps = [
":fd-io",
":fd-test-helper",
":lz4-decompress-reader",
"//src/storage/volume_image/fvm:fvm-sparse-image",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
configs += [ "//src/storage/volume_image/adapter:test-image-path" ]
if (is_host) {
deps += [ "//src/storage/volume_image/adapter:host-test-images" ]
}
}
source_set("guid") {
sources = [ "guid.cc" ]
public = [ "guid.h" ]
public_deps = [
"//sdk/lib/fit-promise",
"//zircon/system/ulib/fbl",
"//zircon/third_party/ulib/safemath",
]
}
source_set("guid-test") {
testonly = true
sources = [ "guid_test.cc" ]
deps = [
":guid",
"//sdk/lib/fit",
"//third_party/googletest:gtest",
"//zircon/system/ulib/fbl",
]
# This double checks that the resulting guids are compatible with our existing guids.
# Because gpt is fuchsia only, this is required.
if (is_fuchsia) {
sources += [ "guid_test_fuchsia.cc" ]
deps += [ "//src/storage/gpt" ]
}
}
source_set("path") {
sources = [ "path.cc" ]
public = [ "path.h" ]
}
source_set("io-interfaces") {
public = [
"bounded_writer.h",
"reader.h",
"writer.h",
]
public_deps = [
"//sdk/lib/fit-promise",
"//zircon/system/ulib/fbl",
]
}
source_set("io-interfaces-test") {
testonly = true
sources = [ "bounded_writer_test.cc" ]
deps = [
":io-interfaces",
"//third_party/googletest:gtest",
]
}
source_set("fd-io") {
sources = [
"fd_reader.cc",
"fd_writer.cc",
]
public = [
"fd_reader.h",
"fd_writer.h",
]
public_deps = [
":io-interfaces",
"//sdk/lib/fit-promise",
"//zircon/system/ulib/fbl",
"//zircon/third_party/ulib/safemath",
]
}
source_set("block-io") {
sources = [ "block_writer.cc" ]
public = [ "block_writer.h" ]
public_deps = [
":io-interfaces",
"//sdk/lib/fit-promise",
"//zircon/system/ulib/fbl",
]
deps = [ ":block-utils" ]
}
source_set("block-io-test") {
testonly = true
sources = [ "block_writer_test.cc" ]
deps = [
":block-io",
":block-utils",
"//third_party/googletest:gtest",
]
}
source_set("fd-test-helper") {
sources = [ "fd_test_helper.cc" ]
public = [ "fd_test_helper.h" ]
public_deps = [ "//sdk/lib/fit-promise" ]
deps = [ "//zircon/system/ulib/fbl" ]
}
source_set("fd-io-test") {
testonly = true
sources = [
"fd_reader_test.cc",
"fd_writer_test.cc",
]
deps = [
":fd-io",
":fd-test-helper",
"//sdk/lib/fit",
"//third_party/googletest:gtest",
"//zircon/system/ulib/fbl",
]
}
source_set("block-utils") {
public = [ "block_utils.h" ]
public_deps = [ "//zircon/system/ulib/fbl" ]
}
source_set("block-utils-test") {
testonly = true
sources = [ "block_utils_test.cc" ]
deps = [
":block-utils",
"//third_party/googletest:gtest",
"//zircon/system/ulib/fbl",
]
}
group("tests") {
testonly = true
deps = [
":block-io-test",
":block-utils-test",
":fd-io-test",
":guid-test",
":io-interfaces-test",
":lz4-compression-test",
":lz4-decompress-reader-test",
]
}