forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build standalone fuzzer tests for running with Dr. Fuzz
- add use_drfuzz arg to support building standalone fuzzer tests for Dr. Fuzz - add drfuzz_main.cc to provid main function if use_drfuzz is used R=aizatsky@chromium.org,dpranke@chromium.org, BUG=566930 Review URL: https://codereview.chromium.org/1498013005 Cr-Commit-Position: refs/heads/master@{#364840}
- Loading branch information
zhaoqin
authored and
Commit bot
committed
Dec 11, 2015
1 parent
0da6b7c
commit 36e9403
Showing
4 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
#include "base/memory/scoped_ptr.h" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size); | ||
|
||
// Provide main for running fuzzer tests with Dr. Fuzz. | ||
int main(int argc, char **argv) | ||
{ | ||
static const size_t kFuzzInputMaxSize = 1024; | ||
scoped_ptr<unsigned char[]> fuzz_input(new unsigned char[kFuzzInputMaxSize]); | ||
// The buffer and size arguments can be changed by Dr. Fuzz. | ||
return LLVMFuzzerTestOneInput(fuzz_input.get(), kFuzzInputMaxSize); | ||
} |