From 839315becab30fb1d781b3c0adc21595ef9b75a2 Mon Sep 17 00:00:00 2001 From: katrielc Date: Mon, 20 Jun 2016 06:03:39 -0700 Subject: [PATCH] Use the Chromium libfuzzer template instead of rolling our own. This lets us use their fancy features, including seed_corpus which is super handy. NOTRY=true Review-Url: https://codereview.webrtc.org/2081683002 Cr-Commit-Position: refs/heads/master@{#13216} --- webrtc/test/fuzzers/BUILD.gn | 15 +++++++++++++- webrtc/test/fuzzers/webrtc_fuzzer.gni | 28 --------------------------- 2 files changed, 14 insertions(+), 29 deletions(-) delete mode 100644 webrtc/test/fuzzers/webrtc_fuzzer.gni diff --git a/webrtc/test/fuzzers/BUILD.gn b/webrtc/test/fuzzers/BUILD.gn index 3e59339299..29867a1a7d 100644 --- a/webrtc/test/fuzzers/BUILD.gn +++ b/webrtc/test/fuzzers/BUILD.gn @@ -7,7 +7,8 @@ # be found in the AUTHORS file in the root of the source tree. import("//build/config/features.gni") -import("webrtc_fuzzer.gni") +import("//testing/test.gni") +import("//testing/libfuzzer/fuzzer_test.gni") static_library("webrtc_fuzzer_main") { public_configs = [ "../..:common_inherited_config" ] @@ -21,6 +22,18 @@ static_library("webrtc_fuzzer_main") { ] } +template("webrtc_fuzzer_test") { + fuzzer_test(target_name) { + forward_variables_from(invoker, "*") + deps += [ ":webrtc_fuzzer_main" ] + if (is_clang) { + # Suppress warnings from Chrome's Clang plugins. + # See http://code.google.com/p/webrtc/issues/detail?id=163 for details + suppressed_configs = [ "//build/config/clang:find_bad_constructs" ] + } + } +} + webrtc_fuzzer_test("h264_depacketizer_fuzzer") { sources = [ "h264_depacketizer_fuzzer.cc", diff --git a/webrtc/test/fuzzers/webrtc_fuzzer.gni b/webrtc/test/fuzzers/webrtc_fuzzer.gni deleted file mode 100644 index d264392c07..0000000000 --- a/webrtc/test/fuzzers/webrtc_fuzzer.gni +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -import("//testing/test.gni") - -template("webrtc_fuzzer_test") { - assert(defined(invoker.sources), "Need sources in $target_name.") - - test(target_name) { - forward_variables_from(invoker, [ "sources" ]) - deps = [ - ":webrtc_fuzzer_main", - ] - if (defined(invoker.deps)) { - deps += invoker.deps - } - if (is_clang) { - # Suppress warnings from Chrome's Clang plugins. - # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. - configs -= [ "//build/config/clang:find_bad_constructs" ] - } - } -}