Skip to content

Commit fe1404c

Browse files
committed
[WIP] Add image and blake3 simd tests
1 parent 7e4cafb commit fe1404c

File tree

5 files changed

+2254
-1
lines changed

5 files changed

+2254
-1
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: 62 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+
"c8d67ecc2a9ba42bb105be8cd430bba4248ee974",
145+
"3a7a845a9749123f",
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+
"8e2e07e0222851a7f071eee9ffaca4c17fb7872c",
155+
"6011bb8c767b053c",
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,48 @@ 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+
}),
283+
TestCase::custom("test.blake3", &|runner| {
284+
BLAKE3_REPO.patch(&runner.dirs);
285+
286+
BLAKE3.clean(&runner.dirs);
287+
288+
let mut build_cmd = BLAKE3.build(&runner.target_compiler, &runner.dirs);
289+
build_cmd.arg("--all-targets");
290+
spawn_and_wait(build_cmd);
291+
292+
if runner.is_native {
293+
let mut test_cmd = BLAKE3.test(&runner.target_compiler, &runner.dirs);
294+
test_cmd.arg("-q");
295+
spawn_and_wait(test_cmd);
296+
}
297+
}),
236298
];
237299

238300
pub(crate) fn run_tests(

config.txt

Lines changed: 3 additions & 1 deletion
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
@@ -52,3 +52,5 @@ test.rust-random/rand
5252
test.libcore
5353
test.regex
5454
test.portable-simd
55+
test.image-fractal
56+
test.blake3

0 commit comments

Comments
 (0)