Files
llvm-project/compiler-rt/test/fuzzer/focus-function.test
cmtice 14cf515f0a [compiler-rt] Update fuzzer/focus-function.test to not require shell. (#157967)
Replace sub-shell for-loops with python calls so this test can run in
the lit internal shell. This is part of our work migrating to use the
internal shell as the default for lit tests.
2025-09-10 19:35:59 -07:00

31 lines
1.2 KiB
Plaintext

# Tests -focus_function
#
# TODO: don't require linux.
# REQUIRES: linux
UNSUPPORTED: target=aarch64{{.*}}
RUN: %cpp_compiler %S/OnlySomeBytesTest.cpp -o %t-exe
RUN: %run %t-exe -runs=100 2>&1 | FileCheck %s --check-prefix=FOCUS_NONE
FOCUS_NONE-NOT: INFO: Focus function is set to
FOCUS_NONE-NOT: INFO: {{.*}} inputs touch the focus function
RUN: not %run %t-exe -runs=100 -focus_function=WRONG 2>&1 | FileCheck %s --check-prefix=FOCUS_WRONG
FOCUS_WRONG-NOT: INFO: Focus function is set to
FOCUS_WRONG: ERROR: Failed to set focus function
RUN: %run %t-exe -runs=100 -focus_function=f0 2>&1 | FileCheck %s --check-prefix=FOCUS_F0
FOCUS_F0: INFO: Focus function is set to 'f0'
FOCUS_F0: INFO: 0/1 inputs touch the focus function
RUN: rm -rf %t-corpus
RUN: mkdir %t-corpus
# ABC triggers the focus function, others don't.
RUN: %python -c 'print("ABC" + "x" * 2048)' > %t-corpus/ABC
RUN: %python -c 'print("AXY" + "x" * 2048)' > %t-corpus/AXY
RUN: %python -c 'print("ABX" + "x" * 2048)' > %t-corpus/ABX
RUN: %run %t-exe -runs=10000 -focus_function=f0 %t-corpus 2>&1 | FileCheck %s --check-prefix=CORPUS_1_3
CORPUS_1_3: INFO: 1/3 inputs touch the focus function
CORPUS_1_3: DONE {{.*}} focus: