Skip to content

Commit

Permalink
Parallelize roundtrip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Dec 20, 2024
1 parent fbf2566 commit 49a264c
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 49a264c

Please sign in to comment.