Index: lib/Fuzzer/test/fuzzer-jobs.test =================================================================== --- lib/Fuzzer/test/fuzzer-jobs.test +++ lib/Fuzzer/test/fuzzer-jobs.test @@ -1,3 +1,5 @@ +REQUIRES: posix + RUN: rm -rf %tmp RUN: mkdir %tmp && cd %tmp # Create a shared corpus directory @@ -14,16 +16,14 @@ # files by now. RUN: ls fuzz-0.log RUN: ls fuzz-1.log +# Check if libFuzzer is still running. +RUN: kill -0 ${FUZZER_PID} # Wait for libfuzzer to finish. -# This probably isn't portable but we need a way to block until -# the fuzzer is done otherwise we might remove the files while -# they are being used. -RUN: while kill -0 ${FUZZER_PID}; do : ; done +RUN: wait ${FUZZER_PID} RUN: rm -f fuzz-{0,1}.log RUN: rm -rf FuzzerJobsTestCORPUS RUN: FileCheck -input-file=%t-fuzzer-jobs-test.log %s RUN: rm %t-fuzzer-jobs-test.log -RUN: cd ../ CHECK-DAG: Job 0 exited with exit code 0 CHECK-DAG: Job 1 exited with exit code 0