use criterion::{black_box, criterion_group, criterion_main, Criterion};
use deqp_runner::{parallel_deqp, DeqpMock, TestCase};

fn runner_overhead(c: &mut Criterion) {
    let mut tests = Vec::new();
    for i in 0..100000 {
        tests.push(TestCase::Deqp(format!("dEQP-GLES2.test.p.{}", i)))
    }

    let deqp = DeqpMock::new();
    c.bench_function("overhead 100000 passes", |b| {
        b.iter(|| {
            let results = parallel_deqp(&deqp, black_box(tests.clone()));
            assert_eq!(results.unwrap().result_counts.pass, 100000);
        });
    });
}

criterion_group!(benches, runner_overhead);
criterion_main!(benches);
