| # Check the 'mkdir' tool. |
| # |
| # RUN: rm -rf %t.build |
| # RUN: mkdir -p %t.build |
| # RUN: cp %s %t.build/build.llbuild |
| # RUN: %{llbuild} buildsystem build --serial --chdir %t.build > %t.out |
| # RUN: %{FileCheck} --input-file=%t.out %s |
| # |
| # CHECK: ECHO |
| # CHECK: MKDIR |
| # CHECK: MUTATE |
| # CHECK: TRIGGERED |
| |
| |
| # Check that a null build does nothing. |
| # |
| # RUN: echo "START." > %t2.out |
| # RUN: %{llbuild} buildsystem build --serial --chdir %t.build >> %t2.out |
| # RUN: echo "EOF" >> %t2.out |
| # RUN: %{FileCheck} --input-file=%t2.out %s --check-prefix=CHECK-REBUILD |
| # |
| # CHECK-REBUILD: START |
| # CHECK-REBUILD-NOT: MKDIR |
| # CHECK-REBUILD-NOT: MUTATE |
| # CHECK-REBUILD-NOT: TRIGGERED |
| # CHECK-REBUILD-NEXT: EOF |
| |
| |
| # Ensure the directory is recreated if necessary. |
| # |
| # RUN: rm -rf %t.build/subdir |
| # RUN: %{llbuild} buildsystem build --serial --chdir %t.build > %t3.out |
| # RUN: %{FileCheck} --input-file=%t3.out %s --check-prefix=CHECK-RECREATE |
| # |
| # CHECK-RECREATE: MKDIR |
| # CHECK-RECREATE: MUTATE |
| # CHECK-RECREATE: TRIGGERED |
| |
| client: |
| name: basic |
| |
| targets: |
| "": ["<all>"] |
| |
| nodes: |
| "<<TRIGGER: MKDIR>>": |
| is-command-timestamp: true |
| |
| commands: |
| C.all: |
| tool: phony |
| inputs: ["<TRIGGERED>"] |
| outputs: ["<all>"] |
| C.echo: |
| tool: shell |
| description: ECHO |
| outputs: ["<echo>"] |
| args: echo hi |
| C.mkdir: |
| tool: mkdir |
| description: MKDIR |
| inputs: ["<echo>"] |
| outputs: ["subdir/subdir2", "<<TRIGGER: MKDIR>>"] |
| C.mutate: |
| tool: shell |
| description: MUTATE |
| inputs: ["subdir/subdir2"] |
| outputs: ["subdir/subdir2/thing.txt"] |
| # We use touch -r here to ensure the directory time is modified to something different. |
| args: touch subdir/subdir2/thing.txt && touch -r / subdir subdir/subdir2 |
| C.triggered: |
| tool: shell |
| description: TRIGGERED |
| # The second input here is just to force a deterministic order. |
| inputs: ["<<TRIGGER: MKDIR>>", "subdir/subdir2/thing.txt"] |
| outputs: ["<TRIGGERED>"] |
| args: true |
| |
| |