From e8637f45ea36aeb30fba7c8957664115977b7f0e Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Fri, 10 Nov 2017 00:18:13 +0000 Subject: [PATCH] [libFuzzer] split a test into two llvm-svn: 317851 --- compiler-rt/test/fuzzer/merge-sigusr.test | 24 ++++++++++++++++++++++++ compiler-rt/test/fuzzer/sigusr.test | 17 ----------------- 2 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 compiler-rt/test/fuzzer/merge-sigusr.test diff --git a/compiler-rt/test/fuzzer/merge-sigusr.test b/compiler-rt/test/fuzzer/merge-sigusr.test new file mode 100644 index 0000000..058b5ec --- /dev/null +++ b/compiler-rt/test/fuzzer/merge-sigusr.test @@ -0,0 +1,24 @@ +# Check that libFuzzer honors SIGUSR1/SIGUSR2 +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: %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2> %t/log & export PID=$! +RUN: sleep 3 +RUN: pkill -f -SIGUSR2 %t/LFSIGUSR +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 diff --git a/compiler-rt/test/fuzzer/sigusr.test b/compiler-rt/test/fuzzer/sigusr.test index f1a15a4..7164fe7 100644 --- a/compiler-rt/test/fuzzer/sigusr.test +++ b/compiler-rt/test/fuzzer/sigusr.test @@ -8,22 +8,5 @@ RUN: sleep 2 RUN: kill -SIGUSR1 $PID RUN: cat %t/log | FileCheck %s -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: %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2> %t/log & export PID=$! -RUN: sleep 3 -RUN: pkill -f -SIGUSR2 %t/LFSIGUSR -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 -- 2.7.4