llvm-project/compiler-rt/test/fuzzer/merge-sigusr.test

27 lines
713 B
Plaintext

# Check that libFuzzer honors SIGUSR1/SIGUSR2
UNSUPPORTED: darwin
RUN: rm -rf %t
RUN: mkdir -p %t
RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGUSR
RUN: mkdir -p %t/C1 %t/C2
RUN: echo a > %t/C2/a
RUN: echo b > %t/C2/b
RUN: echo c > %t/C2/c
RUN: echo d > %t/C2/d
RUN: echo e > %t/C2/e
RUN: echo f > %t/C2/f
RUN: echo g > %t/C2/g
RUN: %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2> %t/log & export PID=$!
RUN: sleep 3
RUN: pkill -SIGUSR2 -f %t/LFSIGUSR
RUN: sleep 3
RUN: cat %t/log | FileCheck %s
RUN: grep C2/g %t/MCF
RUN: grep STARTED %t/MCF
RUN: tail -n 1 %t/MCF | grep DONE
CHECK: INFO: signal received, trying to exit gracefully
CHECK: INFO: libFuzzer: exiting as requested