[libFuzzer] split a test into two
authorKostya Serebryany <kcc@google.com>
Fri, 10 Nov 2017 00:18:13 +0000 (00:18 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 10 Nov 2017 00:18:13 +0000 (00:18 +0000)
llvm-svn: 317851

compiler-rt/test/fuzzer/merge-sigusr.test [new file with mode: 0644]
compiler-rt/test/fuzzer/sigusr.test

diff --git a/compiler-rt/test/fuzzer/merge-sigusr.test b/compiler-rt/test/fuzzer/merge-sigusr.test
new file mode 100644 (file)
index 0000000..058b5ec
--- /dev/null
@@ -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
index f1a15a4..7164fe7 100644 (file)
@@ -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