1# Verify that we build in parallel correctly. We do this by running two tasks,
2# each of which requires the other to have run before it is willing to complete.
3#
4#
5# The wait-for-file script will exit after ~1s, so if both commands aren't
6# started within that time period then the build will fail.
7
8# RUN: rm -rf %t.build
9# RUN: mkdir -p %t.build
10# RUN: cp %s %t.build/build.ninja
11# RUN: cp %S/Inputs/wait-for-file %t.build
12# RUN: %{llbuild} ninja build --chdir %t.build --no-db
13
14rule CUSTOM
15  command = ${COMMAND}
16
17build cleanup: CUSTOM
18  command = rm -f node-{A,B}-semaphore
19build node-A: CUSTOM cleanup
20  command = touch node-B-semaphore && ./wait-for-file node-A-semaphore
21build node-B: CUSTOM cleanup
22  command = touch node-A-semaphore && ./wait-for-file node-B-semaphore
23
24build both: phony node-A node-B
25default both
26