Skip to content

Commit 0fdf977

Browse files
committed
[WIP] More simd tests
1 parent 7e4cafb commit 0fdf977

File tree

5 files changed

+2688
-5
lines changed

5 files changed

+2688
-5
lines changed

build_system/prepare.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pub(crate) fn prepare(dirs: &Dirs) {
1515
RelPath::DOWNLOAD.ensure_exists(dirs);
1616
crate::tests::RAND_REPO.fetch(dirs);
1717
crate::tests::REGEX_REPO.fetch(dirs);
18+
crate::tests::IMAGE_REPO.fetch(dirs);
19+
crate::tests::BLAKE3_REPO.fetch(dirs);
1820
}
1921

2022
pub(crate) fn prepare_stdlib(dirs: &Dirs, rustc: &Path) {

build_system/tests.rs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,26 @@ static LIBCORE_TESTS_SRC: RelPath = RelPath::BUILD.join("coretests");
138138

139139
static LIBCORE_TESTS: CargoProject = CargoProject::new(&LIBCORE_TESTS_SRC, "coretests_target");
140140

141+
pub(crate) static IMAGE_REPO: GitRepo = GitRepo::github(
142+
"image-rs",
143+
"image",
144+
"6efcc15589640b6bd1c0dc85ec1e39910ea6c58f",
145+
"77d7061e3ef3f58c",
146+
"image",
147+
);
148+
149+
static IMAGE: CargoProject = CargoProject::new(&IMAGE_REPO.source_dir(), "image_target");
150+
151+
pub(crate) static BLAKE3_REPO: GitRepo = GitRepo::github(
152+
"BLAKE3-team",
153+
"BLAKE3",
154+
"3f396d223946f722ab060fe9377cd1cebacaf4c0",
155+
"26d5a53578977197",
156+
"blake3",
157+
);
158+
159+
static BLAKE3: CargoProject = CargoProject::new(&BLAKE3_REPO.source_dir(), "blake3_target");
160+
141161
const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
142162
TestCase::custom("test.rust-random/rand", &|runner| {
143163
RAND_REPO.patch(&runner.dirs);
@@ -233,6 +253,59 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
233253
spawn_and_wait(test_cmd);
234254
}
235255
}),
256+
TestCase::custom("test.image-fractal", &|runner| {
257+
IMAGE_REPO.patch(&runner.dirs);
258+
259+
IMAGE.clean(&runner.dirs);
260+
261+
let mut build_cmd = IMAGE.build(&runner.target_compiler, &runner.dirs);
262+
build_cmd
263+
.arg("--example")
264+
.arg("fractal")
265+
.arg("--no-default-features")
266+
.arg("--features")
267+
.arg("png");
268+
spawn_and_wait(build_cmd);
269+
270+
if runner.is_native {
271+
let mut run_cmd = IMAGE.run(&runner.target_compiler, &runner.dirs);
272+
run_cmd
273+
.arg("--example")
274+
.arg("fractal")
275+
.arg("--no-default-features")
276+
.arg("--features")
277+
.arg("png");
278+
run_cmd.current_dir(IMAGE.target_dir(&runner.dirs));
279+
280+
spawn_and_wait(run_cmd);
281+
282+
let expected =
283+
fs::read(IMAGE.source_dir(&runner.dirs).join("examples").join("fractal.png"))
284+
.unwrap();
285+
let output = fs::read(IMAGE.target_dir(&runner.dirs).join("fractal.png")).unwrap();
286+
287+
if output != expected {
288+
println!("Output files don't match!");
289+
290+
std::process::exit(1);
291+
}
292+
}
293+
}),
294+
TestCase::custom("test.blake3", &|runner| {
295+
BLAKE3_REPO.patch(&runner.dirs);
296+
297+
BLAKE3.clean(&runner.dirs);
298+
299+
let mut build_cmd = BLAKE3.build(&runner.target_compiler, &runner.dirs);
300+
build_cmd.arg("--all-targets");
301+
spawn_and_wait(build_cmd);
302+
303+
if runner.is_native {
304+
let mut test_cmd = BLAKE3.test(&runner.target_compiler, &runner.dirs);
305+
test_cmd.arg("-q");
306+
spawn_and_wait(test_cmd);
307+
}
308+
}),
236309
];
237310

238311
pub(crate) fn run_tests(

config.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# the sysroot source hasn't changed. This is useful when the codegen backend hasn't been modified.
1515
# This option can be changed while the build system is already running for as long as sysroot
1616
# building hasn't started yet.
17-
#keep_sysroot
17+
keep_sysroot
1818

1919

2020
# Testsuite
@@ -48,7 +48,9 @@ aot.gen_block_iterate
4848
aot.raw-dylib
4949

5050
testsuite.extended_sysroot
51-
test.rust-random/rand
52-
test.libcore
53-
test.regex
54-
test.portable-simd
51+
#test.rust-random/rand
52+
#test.libcore
53+
#test.regex
54+
#test.portable-simd
55+
#test.image-fractal # FIXME
56+
test.blake3

0 commit comments

Comments
 (0)