• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Check the not command
2#
3# RUN: not %{lit} -j 1 -a -v %{inputs}/shtest-not \
4# RUN: | FileCheck -match-full-lines %s
5#
6# END.
7
8# Make sure not and env commands are included in printed commands.
9
10# CHECK: -- Testing: 13 tests{{.*}}
11
12# CHECK: FAIL: shtest-not :: not-args-last-is-crash.txt {{.*}}
13# CHECK: $ "not" "--crash"
14# CHECK: Error: 'not' requires a subcommand
15# CHECK: error: command failed with exit status: {{.*}}
16
17# CHECK: FAIL: shtest-not :: not-args-nested-none.txt {{.*}}
18# CHECK: $ "not" "not" "not"
19# CHECK: Error: 'not' requires a subcommand
20# CHECK: error: command failed with exit status: {{.*}}
21
22# CHECK: FAIL: shtest-not :: not-args-none.txt {{.*}}
23# CHECK: $ "not"
24# CHECK: Error: 'not' requires a subcommand
25# CHECK: error: command failed with exit status: {{.*}}
26
27# CHECK: FAIL: shtest-not :: not-calls-cd.txt {{.*}}
28# CHECK: $ "not" "not" "cd" "foobar"
29# CHECK: $ "not" "--crash" "cd" "foobar"
30# CHECK: Error: 'not --crash' cannot call 'cd'
31# CHECK: error: command failed with exit status: {{.*}}
32
33# CHECK: FAIL: shtest-not :: not-calls-colon.txt {{.*}}
34# CHECK: $ "not" "not" ":" "foobar"
35# CHECK: $ "not" "--crash" ":"
36# CHECK: Error: 'not --crash' cannot call ':'
37# CHECK: error: command failed with exit status: {{.*}}
38
39# CHECK: FAIL: shtest-not :: not-calls-diff-with-crash.txt {{.*}}
40# CHECK: $ "not" "--crash" "diff" "-u" {{.*}}
41# CHECK-NOT: "$"
42# CHECK-NOT: {{[Ee]rror}}
43# CHECK: error: command failed with exit status: {{.*}}
44# CHECK-NOT: {{[Ee]rror}}
45# CHECK-NOT: "$"
46
47# CHECK: FAIL: shtest-not :: not-calls-diff.txt {{.*}}
48# CHECK: $ "not" "diff" {{.*}}
49# CHECK: $ "not" "not" "not" "diff" {{.*}}
50# CHECK: $ "not" "not" "not" "not" "not" "diff" {{.*}}
51# CHECK: $ "diff" {{.*}}
52# CHECK: $ "not" "not" "diff" {{.*}}
53# CHECK: $ "not" "not" "not" "not" "diff" {{.*}}
54# CHECK: $ "not" "diff" {{.*}}
55# CHECK-NOT: "$"
56
57# CHECK: FAIL: shtest-not :: not-calls-echo.txt {{.*}}
58# CHECK: $ "not" "not" "echo" "hello" "world"
59# CHECK: $ "not" "--crash" "echo" "hello" "world"
60# CHECK: Error: 'not --crash' cannot call 'echo'
61# CHECK: error: command failed with exit status: {{.*}}
62
63# CHECK: FAIL: shtest-not :: not-calls-env-builtin.txt {{.*}}
64# CHECK: $ "not" "--crash" "env" "-u" "FOO" "BAR=3" "rm" "{{.*}}.no-such-file"
65# CHECK: Error: 'env' cannot call 'rm'
66# CHECK: error: command failed with exit status: {{.*}}
67
68# CHECK: FAIL: shtest-not :: not-calls-export.txt {{.*}}
69# CHECK: $ "not" "not" "export" "FOO=1"
70# CHECK: $ "not" "--crash" "export" "BAZ=3"
71# CHECK: Error: 'not --crash' cannot call 'export'
72# CHECK: error: command failed with exit status: {{.*}}
73
74
75# CHECK: PASS: shtest-not :: not-calls-external.txt {{.*}}
76
77# CHECK: $ "not" "{{[^"]*}}" "fail.py"
78# CHECK: $ "not" "not" "{{[^"]*}}" "pass.py"
79# CHECK: $ "not" "not" "not" "{{[^"]*}}" "fail.py"
80# CHECK: $ "not" "not" "not" "not" "{{[^"]*}}" "pass.py"
81
82# CHECK: $ "not" "not" "--crash" "{{[^"]*}}" "pass.py"
83# CHECK: $ "not" "not" "--crash" "{{[^"]*}}" "fail.py"
84# CHECK: $ "not" "not" "--crash" "not" "{{[^"]*}}" "pass.py"
85# CHECK: $ "not" "not" "--crash" "not" "{{[^"]*}}" "fail.py"
86
87# CHECK: $ "env" "not" "{{[^"]*}}" "fail.py"
88# CHECK: $ "not" "env" "{{[^"]*}}" "fail.py"
89# CHECK: $ "env" "FOO=1" "not" "{{[^"]*}}" "fail.py"
90# CHECK: $ "not" "env" "FOO=1" "BAR=1" "{{[^"]*}}" "fail.py"
91# CHECK: $ "env" "FOO=1" "BAR=1" "not" "env" "-u" "FOO" "BAR=2" "{{[^"]*}}" "fail.py"
92# CHECK: $ "not" "env" "FOO=1" "BAR=1" "not" "env" "-u" "FOO" "-u" "BAR" "{{[^"]*}}" "pass.py"
93# CHECK: $ "not" "not" "env" "FOO=1" "env" "FOO=2" "BAR=1" "{{[^"]*}}" "pass.py"
94# CHECK: $ "env" "FOO=1" "-u" "BAR" "env" "-u" "FOO" "BAR=1" "not" "not" "{{[^"]*}}" "pass.py"
95
96# CHECK: $ "not" "env" "FOO=1" "BAR=1" "env" "FOO=2" "BAR=2" "not" "--crash" "{{[^"]*}}" "pass.py"
97# CHECK: $ "not" "env" "FOO=1" "BAR=1" "not" "--crash" "not" "{{[^"]*}}" "pass.py"
98# CHECK: $ "not" "not" "--crash" "env" "-u" "BAR" "not" "env" "-u" "FOO" "BAR=1" "{{[^"]*}}" "pass.py"
99
100
101# CHECK: FAIL: shtest-not :: not-calls-mkdir.txt {{.*}}
102# CHECK: $ "not" "mkdir" {{.*}}
103# CHECK: $ "not" "--crash" "mkdir" "foobar"
104# CHECK: Error: 'not --crash' cannot call 'mkdir'
105# CHECK: error: command failed with exit status: {{.*}}
106
107# CHECK: FAIL: shtest-not :: not-calls-rm.txt {{.*}}
108# CHECK: $ "not" "rm" {{.*}}
109# CHECK: $ "not" "--crash" "rm" "foobar"
110# CHECK: Error: 'not --crash' cannot call 'rm'
111# CHECK: error: command failed with exit status: {{.*}}
112
113# CHECK: Passed:  1
114# CHECK: Failed: 12
115# CHECK-NOT: {{.}}
116