| # 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/dist/resource.gni") |
| import("//build/fuzz.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/zx", |
| ] |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| "//third_party/zstd", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zx", |
| "//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(https://fxbug.dev/42136089): 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(https://fxbug.dev/42136089): 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" |
| } |
| } |
| } |
| |
| resource("header-reader-fuzzer-dictionary") { |
| sources = [ "test_data/archive.dict" ] |
| outputs = [ "data/{{source_file_part}}" ] |
| } |
| |
| fuchsia_library_fuzzer("header-reader-fuzzer") { |
| sources = [ "header-reader-fuzztest.cc" ] |
| deps = [ |
| ":chunked-compression", |
| ":chunked-compression-testutils", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| ] |
| } |
| |
| resource("decompressor-fuzzer-dictionary") { |
| sources = [ "test_data/archive.dict" ] |
| outputs = [ "data/{{source_file_part}}" ] |
| } |
| |
| fuchsia_library_fuzzer("decompressor-fuzzer") { |
| sources = [ "decompressor-fuzztest.cc" ] |
| deps = [ |
| ":chunked-compression", |
| ":chunked-compression-testutils", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| ] |
| } |
| |
| fuchsia_library_fuzzer("compress-decompress-fuzzer") { |
| sources = [ "compress-decompress-fuzztest.cc" ] |
| deps = [ |
| ":chunked-compression", |
| ":chunked-compression-testutils", |
| ] |
| } |
| |
| fuchsia_library_fuzzer("compress-fuzzer") { |
| sources = [ "compress-fuzztest.cc" ] |
| deps = [ |
| ":chunked-compression", |
| ":chunked-compression-testutils", |
| ] |
| } |
| |
| fuchsia_fuzzer_component("compress-decompress-fuzzer-component") { |
| manifest = "meta/compress-decompress-fuzzer.cml" |
| deps = [ ":compress-decompress-fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("compress-fuzzer-component") { |
| manifest = "meta/compress-fuzzer.cml" |
| deps = [ ":compress-fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_component("decompressor-fuzzer-component") { |
| manifest = "meta/decompressor-fuzzer.cml" |
| deps = [ |
| ":decompressor-fuzzer", |
| ".:decompressor-fuzzer-dictionary", |
| ] |
| } |
| |
| fuchsia_fuzzer_component("header-reader-fuzzer-component") { |
| manifest = "meta/header-reader-fuzzer.cml" |
| deps = [ |
| ":header-reader-fuzzer", |
| ".:header-reader-fuzzer-dictionary", |
| ] |
| } |
| |
| fuchsia_fuzzer_package("chunked-compression-fuzzers-package") { |
| package_name = "chunked-compression-fuzzers" |
| cpp_fuzzer_components = [ |
| ":compress-decompress-fuzzer-component", |
| ":compress-fuzzer-component", |
| ":decompressor-fuzzer-component", |
| ":header-reader-fuzzer-component", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":chunked-compression-fuzzers-package", |
| ":chunked-compression-unittests-package", |
| ] |
| } |