Skip to content

Commit 1397094

Browse files
committed
Run coretests and alloctests with cg_clif in CI
1 parent fadea8e commit 1397094

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

compiler/rustc_codegen_cranelift/build_system/tests.rs

+26-21
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,32 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
9999
runner.run_out_command("gen_block_iterate", &[]);
100100
}),
101101
TestCase::build_bin_and_run("aot.raw-dylib", "example/raw-dylib.rs", &[]),
102+
TestCase::custom("test.sysroot", &|runner| {
103+
apply_patches(
104+
&runner.dirs,
105+
"sysroot_tests",
106+
&runner.stdlib_source.join("library"),
107+
&SYSROOT_TESTS_SRC.to_path(&runner.dirs),
108+
);
109+
110+
SYSROOT_TESTS.clean(&runner.dirs);
111+
112+
// coretests and alloctests produce a bunch of warnings. When running
113+
// in rust's CI warnings are denied, so we have to override that here.
114+
let mut target_compiler = runner.target_compiler.clone();
115+
target_compiler.rustflags.push("--cap-lints=allow".to_owned());
116+
117+
if runner.is_native {
118+
let mut test_cmd = SYSROOT_TESTS.test(&target_compiler, &runner.dirs);
119+
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests", "--", "-q"]);
120+
spawn_and_wait(test_cmd);
121+
} else {
122+
eprintln!("Cross-Compiling: Not running tests");
123+
let mut build_cmd = SYSROOT_TESTS.build(&target_compiler, &runner.dirs);
124+
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
125+
spawn_and_wait(build_cmd);
126+
}
127+
}),
102128
];
103129

104130
pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
@@ -146,27 +172,6 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
146172
spawn_and_wait(build_cmd);
147173
}
148174
}),
149-
TestCase::custom("test.sysroot", &|runner| {
150-
apply_patches(
151-
&runner.dirs,
152-
"sysroot_tests",
153-
&runner.stdlib_source.join("library"),
154-
&SYSROOT_TESTS_SRC.to_path(&runner.dirs),
155-
);
156-
157-
SYSROOT_TESTS.clean(&runner.dirs);
158-
159-
if runner.is_native {
160-
let mut test_cmd = SYSROOT_TESTS.test(&runner.target_compiler, &runner.dirs);
161-
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--", "-q"]);
162-
spawn_and_wait(test_cmd);
163-
} else {
164-
eprintln!("Cross-Compiling: Not running tests");
165-
let mut build_cmd = SYSROOT_TESTS.build(&runner.target_compiler, &runner.dirs);
166-
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
167-
spawn_and_wait(build_cmd);
168-
}
169-
}),
170175
TestCase::custom("test.regex", &|runner| {
171176
REGEX_REPO.patch(&runner.dirs);
172177

compiler/rustc_codegen_cranelift/config.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ aot.issue-59326
3232
aot.neon
3333
aot.gen_block_iterate
3434
aot.raw-dylib
35+
test.sysroot
3536

3637
testsuite.extended_sysroot
3738
test.rust-random/rand
38-
test.sysroot
3939
test.regex
4040
test.portable-simd

library/coretests/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ edition = "2024"
1212
path = "lib.rs"
1313
test = false
1414
bench = false
15+
doc = false
1516

1617
[[test]]
1718
name = "coretests"

0 commit comments

Comments
 (0)