| # 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/fuzzing/fuzzer.gni") |
| |
| # When migrating Zircon fuzzers to the Fuchsia build, add them to this list. |
| _migrated_fuzzers = [ |
| "//src/devices/block/drivers/ftl/test:ftl-read-write-fuzzer", |
| "//src/media/audio/drivers/intel-hda/controller:nhlt-fuzzer", |
| "//zircon/system/ulib/affine/test:affine-fuzzer", |
| "//zircon/system/ulib/bitmap/test:raw-bitmap-fuzzer", |
| "//zircon/system/ulib/blobfs/test:zstd-fuzzer", |
| "//zircon/system/ulib/blobfs/test:zstd-seekable-fuzzer", |
| "//zircon/system/ulib/blobfs/test:zstd-seekable-symmetric-fuzzer", |
| "//zircon/system/ulib/bootfs/test:bootfs-parser-fuzzer", |
| "//zircon/system/ulib/elfload/test:elfload-fuzzer", |
| "//zircon/system/ulib/fs/journal/test:journal-entry-fuzzer", |
| "//zircon/system/ulib/fs/journal/test:journal-fuzzer", |
| "//zircon/system/ulib/fs/journal/test:journal-replay-fuzzer", |
| "//zircon/system/ulib/fs/test:vmo_file-fuzzer", |
| "//zircon/system/ulib/gfx/test:gfx-fuzzer", |
| "//zircon/system/ulib/hid-parser/test:hid-parser-fuzzer", |
| "//zircon/system/ulib/inspect/test:inspect-reader-fuzzer", |
| "//zircon/system/ulib/ldmsg/test:ldmsg-fuzzer", |
| "//zircon/system/ulib/minfs/test:minfs-fuzzer", |
| "//zircon/system/ulib/tftp/test:tftp-fuzzer", |
| "//zircon/system/ulib/utf_conversion/test:utf_conversion-fuzzer", |
| "//zircon/system/ulib/zbi-bootfs/test:zbi-bootfs-fuzzer", |
| "//zircon/system/ulib/zircon-crypto/test:hmac-fuzzer", |
| "//src/zircon/tests/kernel-cmdline:kernel-cmdline-fuzzer", |
| "//zircon/system/utest/noop-fuzzer", |
| "//zircon/third_party/ulib/lz4/test:lz4-decompress-fuzzer", |
| "//zircon/third_party/ulib/lz4/test:lz4-roundtrip-fuzzer", |
| ] |
| |
| # Emits a JSON manifest similar to the one used to incorporate Zircon fuzzers into the Fuchsia GN |
| # build pre-unification. This is used to validate that the list of Zircon fuzzers is the unchanged |
| # as fuzzers are being migrated. Post-unification, this target can be removed. |
| generated_file("migrated_fuzzers_manifest") { |
| outputs = [ "$root_build_dir/migrated_zircon_fuzzers.json" ] |
| contents = [] |
| foreach(fuzzer, _migrated_fuzzers) { |
| fuzzer_name = get_label_info(fuzzer, "name") |
| foreach(variant, |
| [ |
| "asan", |
| "asan-ubsan", |
| "ubsan", |
| ]) { |
| contents += [ "$fuzzer_name.$variant" ] |
| } |
| } |
| output_conversion = "json" |
| } |
| |
| fuzzers_package("zircon_fuzzers") { |
| # Zircon fuzzers built using Fuchsia GN. |
| fuzzers = _migrated_fuzzers |
| |
| # Zircon fuzzers built using Zircon GN; only enabled if a fuzzer variant is selected. |
| fuzzer_variants = [ |
| "asan-fuzzer", |
| "asan-ubsan-fuzzer", |
| "ubsan-fuzzer", |
| ] |
| |
| selected_variants = [] |
| foreach(selected_variant, select_variant_canonical) { |
| if (defined(selected_variant.variant)) { |
| selected_variants += [ selected_variant.variant ] |
| } |
| } |
| |
| if (selected_variants + fuzzer_variants - fuzzer_variants != |
| selected_variants) { |
| deps = [ ":migrated_fuzzers_manifest" ] |
| } |
| } |
| |
| # Known to infrastructure. |
| # TODO(fxbug.dev/10198): delete me. zbi_tests.json is now always produced. |
| group("zbi_tests") { |
| } |