| # Check that SIGINT handling aborts a build. |
| |
| # RUN: rm -rf %t.build |
| # RUN: mkdir -p %t.build |
| # RUN: cp %s %t.build/build.ninja |
| # RUN: cp %S/Inputs/wait-for-file %t.build |
| # RUN: /bin/bash -c \ |
| # RUN: "%{llbuild} ninja build --jobs 1 --chdir %t.build &> %t.out & \ |
| # RUN: echo $! > %t.build/llbuild.pid; \ |
| # RUN: wait $(cat %t.build/llbuild.pid)" || true |
| # RUN: %{FileCheck} --input-file %t.out %s |
| # |
| # CHECK: [1/{{.*}}] SIGNAL PARENT LLBUILD PROCESS |
| # CHECK: cancelling build. |
| # |
| # FIXME: Disabled on Linux for the time being, it doesn't always pass. See https://bugs.swift.org/browse/SR-3427 |
| # REQUIRES: platform=Darwin |
| |
| rule CAT |
| command = cat ${in} > ${out} |
| rule SIGNAL |
| description = SIGNAL PARENT LLBUILD PROCESS |
| command = ./wait-for-file llbuild.pid && cat llbuild.pid | xargs kill -SIGINT |
| |
| build output-1: SIGNAL |
| build output: CAT output-1 |