1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
# Check the 'mkdir' tool.
#
# mkdir on WSL gives the new folder 0777 permissions, which break this test. This is because
# the WSL file system doesn't support permissions: https://github.com/Microsoft/BashOnWindows/issues/1801
# See https://github.com/Microsoft/BashOnWindows/issues/1801
# XFAIL: windows_subsystem_linux
# 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
# RUN: %S/Inputs/get-file-permissions %t.build/subdir/subdir2 > %t.permissions
# RUN: %{FileCheck} --input-file=%t.permissions --check-prefix=CHECK-PERMISSIONS %s
#
# CHECK: ECHO
# CHECK: MKDIR
# CHECK: MUTATE
# CHECK: TRIGGERED
# CHECK-PERMISSIONS: 0755
# 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
|