File tree 3 files changed +35
-54
lines changed
3 files changed +35
-54
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -ex
4
+
5
+ # Check sysroot handling
6
+ sysroot=$( ./target/debug/clippy-driver --print sysroot)
7
+ test " $sysroot " = " $( rustc --print sysroot) "
8
+
9
+ if [[ ${OS} == " Windows" ]]; then
10
+ desired_sysroot=C:/tmp
11
+ else
12
+ desired_sysroot=/tmp
13
+ fi
14
+ sysroot=$( ./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
15
+ test " $sysroot " = $desired_sysroot
16
+
17
+ sysroot=$( SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
18
+ test " $sysroot " = $desired_sysroot
19
+
20
+ # Make sure this isn't set - clippy-driver should cope without it
21
+ unset CARGO_MANIFEST_DIR
22
+
23
+ # Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
24
+ # FIXME: How to match the clippy invocation in compile-test.rs?
25
+ ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1
26
+ sed -e " s,tests/ui,\$ DIR," -e " /= help/d" cstring.stderr > normalized.stderr
27
+ diff normalized.stderr tests/ui/cstring.stderr
28
+
29
+ # TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR
Original file line number Diff line number Diff line change 68
68
run : ../target/debug/cargo-clippy
69
69
working-directory : clippy_workspace_tests
70
70
- name : Test clippy-driver
71
- run : |
72
- (
73
- set -ex
74
- # Check sysroot handling
75
- sysroot=$(./target/debug/clippy-driver --print sysroot)
76
- test "$sysroot" = "$(rustc --print sysroot)"
77
-
78
- desired_sysroot=/tmp
79
- sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
80
- test "$sysroot" = $desired_sysroot
81
-
82
- sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
83
- test "$sysroot" = $desired_sysroot
84
-
85
- # Make sure this isn't set - clippy-driver should cope without it
86
- unset CARGO_MANIFEST_DIR
87
-
88
- # Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
89
- # FIXME: How to match the clippy invocation in compile-test.rs?
90
- ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1
91
- sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr > normalized.stderr
92
- diff normalized.stderr tests/ui/cstring.stderr
93
-
94
- # TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR
95
- )
71
+ run : bash .github/driver.sh
72
+ env :
73
+ OS : ${{ runner.os }}
96
74
97
75
- name : Run cargo-cache --autoclean
98
76
run : |
Original file line number Diff line number Diff line change @@ -136,36 +136,10 @@ jobs:
136
136
shell : bash
137
137
working-directory : clippy_workspace_tests
138
138
- name : Test clippy-driver
139
- run : |
140
- (
141
- set -ex
142
- # Check sysroot handling
143
- sysroot=$(./target/debug/clippy-driver --print sysroot)
144
- test "$sysroot" = "$(rustc --print sysroot)"
145
-
146
- if [[ ${{ runner.os }} == "Windows" ]]; then
147
- desired_sysroot=C:/tmp
148
- else
149
- desired_sysroot=/tmp
150
- fi
151
- sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
152
- test "$sysroot" = $desired_sysroot
153
-
154
- sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
155
- test "$sysroot" = $desired_sysroot
156
-
157
- # Make sure this isn't set - clippy-driver should cope without it
158
- unset CARGO_MANIFEST_DIR
159
-
160
- # Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
161
- # FIXME: How to match the clippy invocation in compile-test.rs?
162
- ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1
163
- sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr > normalized.stderr
164
- diff normalized.stderr tests/ui/cstring.stderr
165
-
166
- # TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR
167
- )
139
+ run : bash .github/driver.sh
168
140
shell : bash
141
+ env :
142
+ OS : ${{ runner.os }}
169
143
170
144
- name : Run cargo-cache --autoclean
171
145
run : |
You can’t perform that action at this time.
0 commit comments