| # 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/fuzzing/fuzzer.gni") |
| import("//build/host.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.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", |
| "status.h", |
| "streaming-chunked-compressor.cc", |
| "streaming-chunked-compressor.h", |
| ] |
| public_deps = [ "//zircon/public/lib/fbl" ] |
| deps = [ |
| "//src/lib/fxl", |
| "//zircon/public/lib/cksum", |
| "//zircon/public/lib/fbl", |
| |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. |
| "//zircon/third_party/ulib/zstd", |
| ] |
| |
| if (is_fuchsia) { |
| deps += [ "//zircon/system/ulib/syslog" ] |
| public_deps += [ "//zircon/public/lib/zx" ] |
| } |
| } |
| |
| executable("chunked-compress") { |
| sources = [ "main.cc" ] |
| deps = [ |
| ":chunked-compression", |
| "//zircon/public/lib/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/public/lib/fbl", |
| ] |
| deps = [ "//zircon/public/lib/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", |
| "seek-table-test.cc", |
| "streaming-chunked-compressor-test.cc", |
| ] |
| deps = [ |
| ":chunked-compression", |
| ":chunked-compression-testutils", |
| "//zircon/public/lib/cksum", |
| "//zircon/public/lib/zxtest", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| unittest_package("chunked-compression-unittests-package") { |
| package_name = "chunked-compression-unittests" |
| deps = [ ":chunked-compression-unittests" ] |
| |
| tests = [ |
| { |
| name = "chunked-compression-unittests" |
| 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", |
| ] |
| } |
| |
| fuzzers_package("chunked-compression-fuzzers-package") { |
| package_name = "chunked-compression-fuzzers" |
| fuzzers = [ |
| ":compress-decompress-fuzzer", |
| ":compress-fuzzer", |
| ":decompressor-fuzzer", |
| ":header-reader-fuzzer", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":chunked-compression-fuzzers-package", |
| ":chunked-compression-unittests-package", |
| ] |
| } |