Index: lib/Fuzzer/test/merge.test =================================================================== --- lib/Fuzzer/test/merge.test +++ lib/Fuzzer/test/merge.test @@ -1,12 +1,13 @@ CHECK: BINGO -RUN: rm -rf %tmp/T1 %tmp/T2 -RUN: mkdir -p %tmp/T1 %tmp/T2 -RUN: echo F..... > %tmp/T1/1 -RUN: echo .U.... > %tmp/T1/2 -RUN: echo ..Z... > %tmp/T1/3 +RUN: rm -rf %tmp/T0 %tmp/T1 %tmp/T2 +RUN: mkdir -p %tmp/T0 %tmp/T1 %tmp/T2 +RUN: echo F..... > %tmp/T0/1 +RUN: echo .U.... > %tmp/T0/2 +RUN: echo ..Z... > %tmp/T0/3 # T1 has 3 elements, T2 is empty. +RUN: cp %tmp/T0/* %tmp/T1/ RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK1 CHECK1: MERGE-OUTER: 3 files, 3 in the initial corpus CHECK1: MERGE-OUTER: 0 new files with 0 new features added @@ -29,13 +30,15 @@ CHECK3: MERGE-OUTER: 0 new files with 0 new features added # Check that we respect max_len during the merge and don't crash. -RUN: rm %tmp/T1/??* +RUN: rm %tmp/T1/* +RUN: cp %tmp/T0/* %tmp/T1/ RUN: echo looooooooong > %tmp/T2/looooooooong RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 -max_len=6 2>&1 | FileCheck %s --check-prefix=MAX_LEN MAX_LEN: MERGE-OUTER: 3 new files # Check that merge tolerates failures. -RUN: rm %tmp/T1/??* +RUN: rm %tmp/T1/* +RUN: cp %tmp/T0/* %tmp/T1/ RUN: echo 'FUZZER' > %tmp/T2/FUZZER RUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=MERGE_WITH_CRASH MERGE_WITH_CRASH: MERGE-OUTER: succesfull in 2 attempt(s)