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 87 88 89 90 91 92 93 94
|
# Check basic building functionality with the device-agnostic file system.
#
# RUN: rm -rf %t.build
# RUN: mkdir -p %t.build
# RUN: touch "%t.build/input A"
# RUN: cat %s | sed -e 's#ENV_PATH#%{env}#g' -e 's#SORT_PATH#%{sort}#g' > %t.build/build.llbuild
# RUN: %{llbuild} buildsystem build --serial --chdir %t.build --trace %t.trace > %t.out
# RUN: %{FileCheck} --input-file=%t.out %s
# RUN: diff "%t.build/input A" %t.build/output
#
# CHECK: env
# CHECK: ENV_KEY=ENV_VALUE_1
# CHECK-NOT: {{^PATH=}}
# CHECK: env
# CHECK: ENV_KEY=ENV_VALUE_2
# CHECK: LLBUILD_TASK_ID={{[a-f0-9]+}}
# CHECK: {{^PATH=random-overridden-path}}
# CHECK: cp 'input A' output
# Check the engine trace.
#
# RUN: %{FileCheck} --input-file=%t.trace %s --check-prefix CHECK-TRACE
#
# CHECK-TRACE: "build-started"
# CHECK-TRACE: "new-rule", "R1", "Tbasic"
# CHECK-TRACE: "new-rule", "R2", "Noutput"
# CHECK-TRACE: "new-rule", "R3", "Ccp-output"
# CHECK-TRACE: "new-rule", "R4", "Ninput A"
# CHECK-TRACE: "build-ended"
# Check that a null build does nothing.
#
# RUN: %{llbuild} buildsystem build --serial --chdir %t.build > %t2.out
# RUN: echo "PREVENT-EMPTY-FILE" >> %t2.out
# RUN: %{FileCheck} --input-file=%t2.out %s --check-prefix=CHECK-REBUILD
#
# CHECK-REBUILD-NOT: cp 'input A' output
# Check that we properly copy the output when the input changes.
#
# RUN: echo mod >> "%t.build/input A"
# RUN: %{llbuild} buildsystem build --serial --chdir %t.build > %t3.out
# RUN: %{FileCheck} --input-file=%t3.out %s --check-prefix=CHECK-REBUILD-MODIFIED
# RUN: diff "%t.build/input A" %t.build/output
#
# CHECK-REBUILD-MODIFIED: cp 'input A' output
# Check that we properly copy the output when the output isn't present.
#
# RUN: rm -rf %t.build/output
# RUN: %{llbuild} buildsystem build --serial --chdir %t.build > %t4.out
# RUN: %{FileCheck} --input-file=%t4.out %s --check-prefix=CHECK-REBUILD-OUTPUT-REMOVED
# RUN: diff "%t.build/input A" %t.build/output
#
# CHECK-REBUILD-OUTPUT-REMOVED: cp 'input A' output
client:
name: basic
file-system: device-agnostic
targets:
basic: ["output"]
# define the default target to execute when this manifest is loaded.
default: basic
commands:
"<env-1>":
tool: shell
outputs: ["<env-1>"]
args: ENV_PATH | SORT_PATH
env:
ENV_KEY: ENV_VALUE_1
inherit-env: false
"<env-2>":
tool: shell
inputs: ["<env-1>"]
outputs: ["<env-2>"]
args: ENV_PATH | SORT_PATH
env:
ENV_KEY: ENV_VALUE_2
PATH: random-overridden-path
cp-output:
tool: shell
inputs: ["input A", "<env-1>", "<env-2>"]
outputs: ["output"]
# FIXME: Design a limited mechanism for substitution. Might be tool specific.
description: "cp 'input A' output"
args: ["cp", "input A", "output"]
|