| # Check that we properly detect an introduced cycle. |
| # |
| # We use 'grep' to slice out two different subfiles from the same file. |
| # |
| # RUN: rm -rf %t.build |
| # RUN: mkdir -p %t.build |
| # |
| # RUN: grep -A1000 "VERSION-BEGIN-[1]" %s | grep -B10000 "VERSION-END-1" | grep -ve '^--$' > %t.build/build-1.llbuild |
| # RUN: %{llbuild} buildsystem build --serial --chdir %t.build -f build-1.llbuild > %t1.out |
| # RUN: %{FileCheck} --check-prefix CHECK-VERSION-1 --input-file %t1.out %s |
| # |
| # RUN: grep -A1000 "VERSION-BEGIN-[2]" %s | grep -B10000 "VERSION-END-2" | grep -ve '^--$' > %t.build/build-2.llbuild |
| # RUN: %{llbuild} buildsystem build --serial --chdir %t.build -f build-2.llbuild > %t2.out 2> %t2.err || true |
| # RUN: echo "END-OF-FILE" >> %t2.out |
| # RUN: %{FileCheck} --check-prefix CHECK-VERSION-2 --input-file %t2.out %s |
| # RUN: %{FileCheck} --check-prefix CHECK-VERSION-2-ERR --input-file %t2.err %s |
| |
| ##### VERSION-BEGIN-1 ##### |
| |
| # CHECK-VERSION-1: echo output-1 > output-1 |
| # CHECK-VERSION-1: cat output-1 > output |
| client: |
| name: basic |
| |
| targets: |
| "": ["<output>"] |
| |
| commands: |
| output: |
| tool: shell |
| inputs: ["<output-1>"] |
| outputs: ["<output>"] |
| args: cat output-1 > output |
| |
| output-1: |
| tool: shell |
| outputs: ["<output-1>"] |
| args: echo output-1 > output-1 |
| |
| ##### VERSION-END-1 ##### |
| |
| ##### VERSION-BEGIN-2 ##### |
| |
| # CHECK-VERSION-2-NOT: output |
| # CHECK-VERSION-2: END-OF-FILE |
| # CHECK-VERSION-2-ERR: error: cycle detected while building: command 'output' -> node '<output-1>' -> command 'output-1' -> node '<output>' -> command 'output' |
| client: |
| name: basic |
| |
| targets: |
| "": ["<output>"] |
| |
| commands: |
| output: |
| tool: shell |
| inputs: ["<output-1>"] |
| outputs: ["<output>"] |
| args: cat output-1 > output |
| |
| output-1: |
| tool: shell |
| inputs: ["<output>"] |
| outputs: ["<output-1>"] |
| args: echo output-1 > output-1 |
| |
| ##### VERSION-END-2 ##### |