Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / utils / lit / tests / shtest-env.py
blob03bb4a3cae7dd19bc11be200e1ae23416b82fc13
1 # Check the env command
3 # RUN: not %{lit} -a -v %{inputs}/shtest-env \
4 # RUN: | FileCheck -match-full-lines %s
6 # END.
8 # Make sure env commands are included in printed commands.
10 # CHECK: -- Testing: 16 tests{{.*}}
12 # CHECK: FAIL: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
13 # CHECK: env FOO=1
14 # CHECK: # executed command: env FOO=1
15 # CHECK: # | Error: 'env' requires a subcommand
16 # CHECK: # error: command failed with exit status: {{.*}}
18 # CHECK: FAIL: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
19 # CHECK: env -u FOO
20 # CHECK: # executed command: env -u FOO
21 # CHECK: # | Error: 'env' requires a subcommand
22 # CHECK: # error: command failed with exit status: {{.*}}
24 # CHECK: FAIL: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
25 # CHECK: env -u
26 # CHECK: # executed command: env -u
27 # CHECK: # | Error: 'env' requires a subcommand
28 # CHECK: # error: command failed with exit status: {{.*}}
30 # CHECK: FAIL: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
31 # CHECK: env env env
32 # CHECK: # executed command: env env env
33 # CHECK: # | Error: 'env' requires a subcommand
34 # CHECK: # error: command failed with exit status: {{.*}}
36 # CHECK: FAIL: shtest-env :: env-args-none.txt ({{[^)]*}})
37 # CHECK: env
38 # CHECK: # executed command: env
39 # CHECK: # | Error: 'env' requires a subcommand
40 # CHECK: # error: command failed with exit status: {{.*}}
42 # CHECK: FAIL: shtest-env :: env-calls-cd.txt ({{[^)]*}})
43 # CHECK: env -u FOO BAR=3 cd foobar
44 # CHECK: # executed command: env -u FOO BAR=3 cd foobar
45 # CHECK: # | Error: 'env' cannot call 'cd'
46 # CHECK: # error: command failed with exit status: {{.*}}
48 # CHECK: FAIL: shtest-env :: env-calls-colon.txt ({{[^)]*}})
49 # CHECK: env -u FOO BAR=3 :
50 # CHECK: # executed command: env -u FOO BAR=3 :
51 # CHECK: # | Error: 'env' cannot call ':'
52 # CHECK: # error: command failed with exit status: {{.*}}
54 # CHECK: FAIL: shtest-env :: env-calls-echo.txt ({{[^)]*}})
55 # CHECK: env -u FOO BAR=3 echo hello world
56 # CHECK: # executed command: env -u FOO BAR=3 echo hello world
57 # CHECK: # | Error: 'env' cannot call 'echo'
58 # CHECK: # error: command failed with exit status: {{.*}}
60 # CHECK: PASS: shtest-env :: env-calls-env.txt ({{[^)]*}})
61 # CHECK: env env [[PYTHON:.+]] print_environment.py | {{.*}}
62 # CHECK: # executed command: env env [[PYTHON_BARE:.+]] print_environment.py
63 # CHECK: env FOO=2 env BAR=1 [[PYTHON]] print_environment.py | {{.*}}
64 # CHECK: # executed command: env FOO=2 env BAR=1 [[PYTHON_BARE]] print_environment.py
65 # CHECK: env -u FOO env -u BAR [[PYTHON]] print_environment.py | {{.*}}
66 # CHECK: # executed command: env -u FOO env -u BAR [[PYTHON_BARE]] print_environment.py
67 # CHECK: env -u FOO BAR=1 env -u BAR FOO=2 [[PYTHON]] print_environment.py | {{.*}}
68 # CHECK: # executed command: env -u FOO BAR=1 env -u BAR FOO=2 [[PYTHON_BARE]] print_environment.py
69 # CHECK: env -u FOO BAR=1 env -u BAR FOO=2 env BAZ=3 [[PYTHON]] print_environment.py | {{.*}}
70 # CHECK: # executed command: env -u FOO BAR=1 env -u BAR FOO=2 env BAZ=3 [[PYTHON_BARE]] print_environment.py
71 # CHECK-NOT: {{^[^#]}}
72 # CHECK: --
74 # CHECK: FAIL: shtest-env :: env-calls-export.txt ({{[^)]*}})
75 # CHECK: env -u FOO BAR=3 export BAZ=3
76 # CHECK: # executed command: env -u FOO BAR=3 export BAZ=3
77 # CHECK: # | Error: 'env' cannot call 'export'
78 # CHECK: # error: command failed with exit status: {{.*}}
80 # CHECK: FAIL: shtest-env :: env-calls-mkdir.txt ({{[^)]*}})
81 # CHECK: env -u FOO BAR=3 mkdir foobar
82 # CHECK: # executed command: env -u FOO BAR=3 mkdir foobar
83 # CHECK: # | Error: 'env' cannot call 'mkdir'
84 # CHECK: # error: command failed with exit status: {{.*}}
86 # CHECK: FAIL: shtest-env :: env-calls-not-builtin.txt ({{[^)]*}})
87 # CHECK: env -u FOO BAR=3 not rm {{.+}}.no-such-file
88 # CHECK: # executed command: env -u FOO BAR=3 not rm {{.+}}.no-such-file{{.*}}
89 # CHECK: # | Error: 'env' cannot call 'rm'
90 # CHECK: # error: command failed with exit status: {{.*}}
92 # CHECK: FAIL: shtest-env :: env-calls-rm.txt ({{[^)]*}})
93 # CHECK: env -u FOO BAR=3 rm foobar
94 # CHECK: # executed command: env -u FOO BAR=3 rm foobar
95 # CHECK: # | Error: 'env' cannot call 'rm'
96 # CHECK: # error: command failed with exit status: {{.*}}
98 # CHECK: PASS: shtest-env :: env-u.txt ({{[^)]*}})
99 # CHECK: [[PYTHON]] print_environment.py | {{.*}}
100 # CHECK: env -u FOO [[PYTHON]] print_environment.py | {{.*}}
101 # CHECK: # executed command: env -u FOO [[PYTHON_BARE]] print_environment.py
102 # CHECK: env -u FOO -u BAR [[PYTHON]] print_environment.py | {{.*}}
103 # CHECK: # executed command: env -u FOO -u BAR [[PYTHON_BARE]] print_environment.py
104 # CHECK-NOT: {{^[^#]}}
105 # CHECK: --
107 # CHECK: PASS: shtest-env :: env.txt ({{[^)]*}})
108 # CHECK: env A_FOO=999 [[PYTHON]] print_environment.py | {{.*}}
109 # CHECK: # executed command: env A_FOO=999 [[PYTHON_BARE]] print_environment.py
110 # CHECK: env A_FOO=1 B_BAR=2 C_OOF=3 [[PYTHON]] print_environment.py | {{.*}}
111 # CHECK: # executed command: env A_FOO=1 B_BAR=2 C_OOF=3 [[PYTHON_BARE]] print_environment.py
112 # CHECK-NOT: {{^[^#]}}
113 # CHECK: --
115 # CHECK: PASS: shtest-env :: mixed.txt ({{[^)]*}})
116 # CHECK: env A_FOO=999 -u FOO [[PYTHON]] print_environment.py | {{.*}}
117 # CHECK: # executed command: env A_FOO=999 -u FOO [[PYTHON_BARE]] print_environment.py
118 # CHECK: env A_FOO=1 -u FOO B_BAR=2 -u BAR C_OOF=3 [[PYTHON]] print_environment.py | {{.*}}
119 # CHECK: # executed command: env A_FOO=1 -u FOO B_BAR=2 -u BAR C_OOF=3 [[PYTHON_BARE]] print_environment.py
120 # CHECK-NOT: {{^[^#]}}
121 # CHECK: --
123 # CHECK: Total Discovered Tests: 16
124 # CHECK: Passed: 4 {{\([0-9]*\.[0-9]*%\)}}
125 # CHECK: Failed: 12 {{\([0-9]*\.[0-9]*%\)}}
126 # CHECK-NOT: {{.}}