1 # Tests -focus_function
3 # TODO: don't require linux.
5 UNSUPPORTED: target=aarch64{{.*}}
7 RUN: %cpp_compiler %S/OnlySomeBytesTest.cpp -o %t-exe
9 RUN: %t-exe -runs=100 2>&1 | FileCheck %s --check-prefix=FOCUS_NONE
10 FOCUS_NONE-NOT: INFO: Focus function is set to
11 FOCUS_NONE-NOT: INFO: {{.*}} inputs touch the focus function
13 RUN: not %t-exe -runs=100 -focus_function=WRONG 2>&1 | FileCheck %s --check-prefix=FOCUS_WRONG
14 FOCUS_WRONG-NOT: INFO: Focus function is set to
15 FOCUS_WRONG: ERROR: Failed to set focus function
17 RUN: %t-exe -runs=100 -focus_function=f0 2>&1 | FileCheck %s --check-prefix=FOCUS_F0
18 FOCUS_F0: INFO: Focus function is set to 'f0'
19 FOCUS_F0: INFO: 0/1 inputs touch the focus function
23 # ABC triggers the focus function, others don't.
24 RUN: echo ABC$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/ABC
25 RUN: echo AXY$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/AXY
26 RUN: echo ABX$(for((i=0;i<2048;i++)); do echo -n x; done) > %t-corpus/ABX
28 RUN: %t-exe -runs=10000 -focus_function=f0 %t-corpus 2>&1 | FileCheck %s --check-prefix=CORPUS_1_3
29 CORPUS_1_3: INFO: 1/3 inputs touch the focus function
30 CORPUS_1_3: DONE {{.*}} focus: