File tree 4 files changed +25
-229
lines changed
4 files changed +25
-229
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ if [ -n "${QEMU:-}" ]; then
81
81
fi
82
82
83
83
cmd=" cargo test --target $target ${LIBC_CI_ZBUILD_STD+" -Zbuild-std" } "
84
+ test_flags=" --skip check_style"
84
85
85
86
# Run tests in the `libc` crate
86
87
case " $target " in
@@ -101,25 +102,31 @@ if [ "$target" = "s390x-unknown-linux-gnu" ]; then
101
102
passed=0
102
103
until [ $n -ge $N ]; do
103
104
if [ " $passed " = " 0" ]; then
104
- if $cmd --no-default-features; then
105
+ # shellcheck disable=SC2086
106
+ if $cmd --no-default-features -- $test_flags ; then
105
107
passed=$(( passed+ 1 ))
106
108
continue
107
109
fi
108
110
elif [ " $passed " = " 1" ]; then
109
- if $cmd ; then
111
+ # shellcheck disable=SC2086
112
+ if $cmd -- $test_flags ; then
110
113
passed=$(( passed+ 1 ))
111
114
continue
112
115
fi
113
116
elif [ " $passed " = " 2" ]; then
114
- if $cmd --features extra_traits; then
117
+ # shellcheck disable=SC2086
118
+ if $cmd --features extra_traits -- $test_flags ; then
115
119
break
116
120
fi
117
121
fi
118
122
n=$(( n+ 1 ))
119
123
sleep 1
120
124
done
121
125
else
122
- $cmd --no-default-features
123
- $cmd
124
- $cmd --features extra_traits
126
+ # shellcheck disable=SC2086
127
+ $cmd --no-default-features -- $test_flags
128
+ # shellcheck disable=SC2086
129
+ $cmd -- $test_flags
130
+ # shellcheck disable=SC2086
131
+ $cmd --features extra_traits -- $test_flags
125
132
fi
Original file line number Diff line number Diff line change 1
1
use std:: env;
2
- use std:: process:: Command ;
3
2
use std:: path:: { Path , PathBuf } ;
3
+ use std:: process:: Command ;
4
4
5
5
fn main ( ) {
6
6
let args = env:: args_os ( )
7
7
. skip ( 1 )
8
- . filter ( |arg| arg != "--quiet" )
8
+ . filter ( |arg| arg != "--quiet" && arg != "--skip" && arg != "check_style" )
9
9
. collect :: < Vec < _ > > ( ) ;
10
10
assert_eq ! ( args. len( ) , 1 ) ;
11
11
let test = PathBuf :: from ( & args[ 0 ] ) ;
@@ -36,14 +36,16 @@ fn main() {
36
36
let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
37
37
let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
38
38
39
- println ! ( "status: {} \n stdout --- \n {} \n stderr --- \n {}" ,
40
- output . status ,
41
- stdout,
42
- stderr ) ;
39
+ println ! (
40
+ "status: {} \n stdout --- \n {} \n stderr --- \n {}" ,
41
+ output . status , stdout, stderr
42
+ ) ;
43
43
44
- if !stderr. lines ( ) . any ( |l| ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) || l. starts_with ( "test result: ok" ) )
45
- && !stdout. lines ( ) . any ( |l| ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) || l. starts_with ( "test result: ok" ) )
46
- {
44
+ if !stderr. lines ( ) . any ( |l| {
45
+ ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) || l. starts_with ( "test result: ok" )
46
+ } ) && !stdout. lines ( ) . any ( |l| {
47
+ ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) || l. starts_with ( "test result: ok" )
48
+ } ) {
47
49
panic ! ( "failed to find successful test run" ) ;
48
50
} ;
49
51
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ if [ -n "${CI:-}" ]; then
9
9
check=" --check"
10
10
fi
11
11
12
- rustc ci/style.rs && ./ style src
12
+ cargo test --manifest-path libc-test/Cargo.toml --test style -- --nocapture
13
13
14
14
command -v rustfmt
15
15
rustfmt -V
You can’t perform that action at this time.
0 commit comments