1 RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest
3 RUN: rm -rf %t/T0 %t/T1 %t/T2
4 RUN: mkdir -p %t/T0 %t/T1 %t/T2
5 RUN: echo F..... > %t/T0/1
6 RUN: echo .U.... > %t/T0/2
7 RUN: echo ..Z... > %t/T0/3
9 # T1 has 3 elements, T2 is empty.
10 RUN: cp %t/T0/* %t/T1/
11 RUN: %run %t-FullCoverageSetTest -merge=1 %t/T1 %t/T2 2>&1 | FileCheck %s --check-prefix=CHECK1
12 CHECK1: MERGE-OUTER: 3 files, 3 in the initial corpus
13 CHECK1: MERGE-OUTER: 0 new files with 0 new features added
15 RUN: echo ...Z.. > %t/T2/1
16 RUN: echo ....E. > %t/T2/2
17 RUN: echo .....R > %t/T2/3
18 RUN: echo F..... > %t/T2/a
19 RUN: echo .U.... > %t/T2/b
20 RUN: echo ..Z... > %t/T2/c
22 # T1 has 3 elements, T2 has 6 elements, only 3 are new.
23 RUN: %run %t-FullCoverageSetTest -merge=1 %t/T1 %t/T2 2>&1 | FileCheck %s --check-prefix=CHECK2
24 CHECK2: MERGE-OUTER: 9 files, 3 in the initial corpus
25 CHECK2: MERGE-OUTER: 3 new files with 3 new features added
27 # Now, T1 has 6 units and T2 has no new interesting units.
28 RUN: %run %t-FullCoverageSetTest -merge=1 %t/T1 %t/T2 2>&1 | FileCheck %s --check-prefix=CHECK3
29 CHECK3: MERGE-OUTER: 12 files, 6 in the initial corpus
30 CHECK3: MERGE-OUTER: 0 new files with 0 new features added
32 # Check that we respect max_len during the merge and don't crash.
34 RUN: cp %t/T0/* %t/T1/
35 RUN: echo looooooooong > %t/T2/looooooooong
36 RUN: %run %t-FullCoverageSetTest -merge=1 %t/T1 %t/T2 -max_len=6 2>&1 | FileCheck %s --check-prefix=MAX_LEN
37 MAX_LEN: MERGE-OUTER: 3 new files
39 # Check that we respect -merge_control_file=FILE
41 RUN: cp %t/T0/* %t/T1/
43 RUN: %run %t-FullCoverageSetTest -merge=1 -merge_control_file=%t/MCF %t/T1 %t/T2 2>&1 | FileCheck %s --check-prefix=MCF
44 RUN: grep STARTED %t/MCF
46 MCF: MERGE-INNER: using the control file {{.*}}MCF
47 MCF: MERGE-OUTER: 3 new files
50 # Check that merge tolerates failures.
52 RUN: cp %t/T0/* %t/T1/
53 RUN: echo 'FUZZER' > %t/T2/FUZZER
54 RUN: %run %t-FullCoverageSetTest -merge=1 %t/T1 %t/T2 2>&1 | FileCheck %s --check-prefix=MERGE_WITH_CRASH
55 MERGE_WITH_CRASH: MERGE-OUTER: successful in 2 attempt(s)
56 MERGE_WITH_CRASH: MERGE-OUTER: 3 new files
58 # Check that we actually limit the size with max_len
59 RUN: rm %t/T1/* %t/T2/*
60 RUN: echo 'FUZZER' > %t/T2/FUZZER
61 RUN: %run %t-FullCoverageSetTest -merge=1 %t/T1 %t/T2 -max_len=5 2>&1 | FileCheck %s --check-prefix=MERGE_LEN5
62 RUN: not grep FUZZER %t/T1/*
63 RUN: grep FUZZE %t/T1/*
64 MERGE_LEN5: MERGE-OUTER: successful in 1 attempt(s)