From 49a264c635b706ffeb0068741f17109e8ef98a6e Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 18 Dec 2024 16:25:57 +0000 Subject: [PATCH] Parallelize roundtrip tests --- src/encoder.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/encoder.rs b/src/encoder.rs index c143fa04..cbbebd69 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -1737,9 +1737,18 @@ mod tests { use std::io::Cursor; #[test] - fn roundtrip() { + fn roundtrip1() { + roundtrip_inner(); + } + + #[test] + fn roundtrip2() { + roundtrip_inner(); + } + + fn roundtrip_inner() { // More loops = more random testing, but also more test wait time - for _ in 0..10 { + for _ in 0..5 { for path in glob::glob("tests/pngsuite/*.png") .unwrap() .map(|r| r.unwrap()) @@ -1783,9 +1792,18 @@ mod tests { } #[test] - fn roundtrip_stream() { + fn roundtrip_stream1() { + roundtrip_stream_inner(); + } + + #[test] + fn roundtrip_stream2() { + roundtrip_stream_inner(); + } + + fn roundtrip_stream_inner() { // More loops = more random testing, but also more test wait time - for _ in 0..10 { + for _ in 0..5 { for path in glob::glob("tests/pngsuite/*.png") .unwrap() .map(|r| r.unwrap())