Skip to content

Commit d43342f

Browse files
committed
skip style test in ci
1 parent 430c88f commit d43342f

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

ci/run.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ if [ -n "${QEMU:-}" ]; then
8080
exec grep -E "^(PASSED)|(test result: ok)" "${CARGO_TARGET_DIR}/out.log"
8181
fi
8282

83-
cmd="env LIBC_CI=1 cargo test --target $target ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}"
83+
cmd="cargo test --target $target ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}"
84+
test_flags="--skip check_style"
8485

8586
# Run tests in the `libc` crate
8687
case "$target" in
@@ -101,25 +102,25 @@ if [ "$target" = "s390x-unknown-linux-gnu" ]; then
101102
passed=0
102103
until [ $n -ge $N ]; do
103104
if [ "$passed" = "0" ]; then
104-
if $cmd --no-default-features; then
105+
if eval "$cmd --no-default-features -- $test_flags"; then
105106
passed=$((passed+1))
106107
continue
107108
fi
108109
elif [ "$passed" = "1" ]; then
109-
if $cmd; then
110+
if eval "$cmd -- $test_flags"; then
110111
passed=$((passed+1))
111112
continue
112113
fi
113114
elif [ "$passed" = "2" ]; then
114-
if $cmd --features extra_traits; then
115+
if eval "$cmd --features extra_traits -- $test_flags"; then
115116
break
116117
fi
117118
fi
118119
n=$((n+1))
119120
sleep 1
120121
done
121122
else
122-
$cmd --no-default-features
123-
$cmd
124-
$cmd --features extra_traits
123+
eval "$cmd --no-default-features -- $test_flags"
124+
eval "$cmd -- $test_flags"
125+
eval "$cmd --features extra_traits -- $test_flags"
125126
fi

ci/runtest-android.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::env;
2-
use std::process::Command;
32
use std::path::{Path, PathBuf};
3+
use std::process::Command;
44

55
fn main() {
66
let args = env::args_os()
77
.skip(1)
8-
.filter(|arg| arg != "--quiet")
8+
.filter(|arg| arg != "--quiet" && arg != "--skip" && arg != "check_style")
99
.collect::<Vec<_>>();
1010
assert_eq!(args.len(), 1);
1111
let test = PathBuf::from(&args[0]);
@@ -36,14 +36,16 @@ fn main() {
3636
let stdout = String::from_utf8_lossy(&output.stdout);
3737
let stderr = String::from_utf8_lossy(&output.stderr);
3838

39-
println!("status: {}\nstdout ---\n{}\nstderr ---\n{}",
40-
output.status,
41-
stdout,
42-
stderr);
39+
println!(
40+
"status: {}\nstdout ---\n{}\nstderr ---\n{}",
41+
output.status, stdout, stderr
42+
);
4343

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+
}) {
4749
panic!("failed to find successful test run");
4850
};
4951
}

libc-test/test/style.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ type Result<T> = std::result::Result<T, Error>;
3737

3838
#[test]
3939
fn check_style() {
40-
if env::var("LIBC_CI").is_ok() {
41-
// we already run this in the style.sh script
42-
return;
43-
}
44-
4540
let root_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../src");
4641
let mut errors = Errors { errs: false };
4742
walk(&root_dir, &mut errors).expect("root dir should be walked successfully");

0 commit comments

Comments
 (0)