1 # Check that we can inject preamble commands at the beginning of a ShTest.
3 # For one case, check the execution trace as these preamble commands have
4 # "preamble command" instead of the usual "{{RUN}}: at line N".
6 # RUN: %{lit} %{inputs}/shtest-inject/test-empty.txt --show-all | FileCheck --check-prefix=CHECK-TEST1 %s
8 # CHECK-TEST1: Command Output (stdout):
10 # CHECK-TEST1-NEXT: # preamble command line
11 # CHECK-TEST1-NEXT: echo "THIS WAS"
12 # CHECK-TEST1-NEXT: # executed command: echo 'THIS WAS'
13 # CHECK-TEST1-NEXT: # .---command stdout{{-*}}
14 # CHECK-TEST1-NEXT: # | THIS WAS
15 # CHECK-TEST1-NEXT: # `---{{-*}}
16 # CHECK-TEST1-NEXT: # preamble command line
17 # CHECK-TEST1-NEXT: echo "INJECTED"
18 # CHECK-TEST1-NEXT: # executed command: echo INJECTED
19 # CHECK-TEST1-NEXT: # .---command stdout{{-*}}
20 # CHECK-TEST1-NEXT: # | INJECTED
21 # CHECK-TEST1-NEXT: # `---{{-*}}
23 # CHECK-TEST1-NEXT: --
25 # CHECK-TEST1: Passed: 1
27 # RUN: %{lit} %{inputs}/shtest-inject/test-one.txt --show-all | FileCheck --check-prefix=CHECK-TEST2 %s
29 # CHECK-TEST2: THIS WAS
30 # CHECK-TEST2: INJECTED
31 # CHECK-TEST2: IN THE FILE
33 # CHECK-TEST2: Passed: 1
35 # RUN: %{lit} %{inputs}/shtest-inject/test-many.txt --show-all | FileCheck --check-prefix=CHECK-TEST3 %s
37 # CHECK-TEST3: THIS WAS
38 # CHECK-TEST3: INJECTED
39 # CHECK-TEST3: IN THE FILE
40 # CHECK-TEST3: IF IT WORKS
41 # CHECK-TEST3: AS EXPECTED
43 # CHECK-TEST3: Passed: 1