kermit_bench/
lib.rs

1pub mod benchmark;
2pub mod benchmarks;
3pub mod downloader;
4pub mod generation;
5pub mod manager;
6mod utils;
7
8#[cfg(test)]
9mod tests {
10    use {
11        crate::{benchmarks::Benchmark, manager::BenchmarkManager},
12        std::path::PathBuf,
13    };
14
15    #[test]
16    fn oxford_benchmark() {
17        let tmp_dir = PathBuf::from("data"); // env::temp_dir().join("kermit-bench-testing");
18        if tmp_dir.exists() {
19            std::fs::remove_dir_all(&tmp_dir).expect("Failed to remove temporary directory");
20        }
21        std::fs::create_dir_all(&tmp_dir).expect("Failed to create temporary directory");
22        let mut man = BenchmarkManager::new(&tmp_dir);
23        assert!(man.add_benchmark(Benchmark::Oxford).is_ok());
24
25        let ds_dir = tmp_dir.join(Benchmark::Oxford.config().metadata().download_spec.name);
26        assert!(ds_dir.exists());
27
28        // Test validation - should succeed when dataset is properly loaded
29        assert!(Benchmark::Oxford.config().validate(&tmp_dir).is_ok());
30
31        assert!(man.rm_benchmark(Benchmark::Oxford).is_ok());
32    }
33}