blob: 7aef12fc4903922b5fc7346a78fc17b24d00abc1 [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/fuzzing/fuzzer.gni")
import("//build/fuzzing/fuzzer_package.gni")
import("//build/host.gni")
import("//build/test.gni")
source_set("chunked-compression") {
sources = [
"chunked-archive.cc",
"chunked-archive.h",
"chunked-compressor.cc",
"chunked-compressor.h",
"chunked-decompressor.cc",
"chunked-decompressor.h",
"compression-params.cc",
"compression-params.h",
"multithreaded-chunked-compressor.cc",
"multithreaded-chunked-compressor.h",
"status.h",
"streaming-chunked-compressor.cc",
"streaming-chunked-compressor.h",
]
public_deps = [
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/zxc",
]
deps = [
"//src/lib/fxl",
"//third_party/zstd",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/zxc",
"//zircon/third_party/ulib/cksum",
]
if (is_fuchsia) {
deps += [ "//sdk/lib/syslog/cpp" ]
public_deps += [ "//zircon/system/ulib/zx" ]
}
}
executable("chunked-compress") {
sources = [ "main.cc" ]
deps = [
":chunked-compression",
"//zircon/system/ulib/fbl",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
install_host_tools("chunked-compress-host-tool") {
deps = [ ":chunked-compress" ]
outputs = [ "chunked-compress" ]
}
source_set("chunked-compression-testutils") {
testonly = true
visibility = [ ":*" ]
sources = [
"test-utils.cc",
"test-utils.h",
]
public_deps = [
":chunked-compression",
"//zircon/system/ulib/fbl",
]
deps = [ "//zircon/third_party/ulib/cksum" ]
}
test("chunked-compression-unittests") {
testonly = true
output_name = "chunked-compression-unittests"
sources = [
"chunked-compressor-test.cc",
"chunked-decompressor-test.cc",
"compression-params-test.cc",
"header-reader-test.cc",
"header-writer-test.cc",
"multithreaded-chunked-compressor-test.cc",
"seek-table-test.cc",
"streaming-chunked-compressor-test.cc",
]
deps = [
":chunked-compression",
":chunked-compression-testutils",
"//zircon/system/ulib/zxtest",
"//zircon/third_party/ulib/cksum",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_unittest_package("chunked-compression-unittests-package") {
package_name = "chunked-compression-unittests"
deps = [ ":chunked-compression-unittests" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
fuzzer("header-reader-fuzzer") {
sources = [ "header-reader-fuzztest.cc" ]
dictionary = "test_data/archive.dict"
deps = [
":chunked-compression",
":chunked-compression-testutils",
"//src/lib/fxl",
]
}
fuzzer("decompressor-fuzzer") {
sources = [ "decompressor-fuzztest.cc" ]
dictionary = "test_data/archive.dict"
deps = [
":chunked-compression",
":chunked-compression-testutils",
"//src/lib/fxl",
]
}
fuzzer("compress-decompress-fuzzer") {
sources = [ "compress-decompress-fuzztest.cc" ]
deps = [
":chunked-compression",
":chunked-compression-testutils",
]
}
fuzzer("compress-fuzzer") {
sources = [ "compress-fuzztest.cc" ]
deps = [
":chunked-compression",
":chunked-compression-testutils",
]
}
fuzzer_package("chunked-compression-fuzzers-package") {
package_name = "chunked-compression-fuzzers"
cpp_fuzzers = [
":compress-decompress-fuzzer",
":compress-fuzzer",
":decompressor-fuzzer",
":header-reader-fuzzer",
]
}
group("tests") {
testonly = true
deps = [
":chunked-compression-fuzzers-package",
":chunked-compression-unittests-package",
]
}