1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[libFuzzer] print the file name before executing the input so that if there is a crash we know which files has caused it

llvm-svn: 269450
This commit is contained in:
Kostya Serebryany 2016-05-13 18:10:33 +00:00
parent 2f92ae6c43
commit 409e80a364
2 changed files with 4 additions and 3 deletions

View File

@ -367,11 +367,12 @@ static int FuzzerDriver(const std::vector<std::string> &Args,
Inputs->size(), Runs); Inputs->size(), Runs);
for (auto &Path : *Inputs) { for (auto &Path : *Inputs) {
auto StartTime = system_clock::now(); auto StartTime = system_clock::now();
Printf("%s ... ", Path.c_str());
for (int Iter = 0; Iter < Runs; Iter++) for (int Iter = 0; Iter < Runs; Iter++)
RunOneTest(&F, Path.c_str()); RunOneTest(&F, Path.c_str());
auto StopTime = system_clock::now(); auto StopTime = system_clock::now();
auto MS = duration_cast<milliseconds>(StopTime - StartTime).count(); auto MS = duration_cast<milliseconds>(StopTime - StartTime).count();
Printf("%s: %zd ms\n", Path.c_str(), (long)MS); Printf("%zd ms\n", (long)MS);
} }
F.PrintFinalStats(); F.PrintFinalStats();
exit(0); exit(0);

View File

@ -57,8 +57,8 @@ RUN: echo bbb > %tmp/SINGLE_INPUTS/bbb
RUN: LLVMFuzzer-SimpleTest %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS RUN: LLVMFuzzer-SimpleTest %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS
RUN: rm -rf %tmp/SINGLE_INPUTS RUN: rm -rf %tmp/SINGLE_INPUTS
SINGLE_INPUTS: LLVMFuzzer-SimpleTest: Running 2 inputs 1 time(s) each. SINGLE_INPUTS: LLVMFuzzer-SimpleTest: Running 2 inputs 1 time(s) each.
SINGLE_INPUTS: aaa: SINGLE_INPUTS: aaa ...
SINGLE_INPUTS: bbb: SINGLE_INPUTS: bbb ...
RUN: rm -rf %t/SUB1 RUN: rm -rf %t/SUB1
RUN: mkdir -p %t/SUB1/SUB2/SUB3 RUN: mkdir -p %t/SUB1/SUB2/SUB3