Skip to content

Commit

Permalink
only benchmark non failing programs
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Oct 13, 2024
1 parent 9e1ec54 commit fd2682e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion benches/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ fn run_example(name: &Path) {
let program = std::fs::read_to_string(&filename).unwrap();
let mut egraph = EGraph::default();
egraph.set_reserved_symbol("___".into());
let _ = egraph.parse_and_run_program(Some(filename), &program);
egraph
.parse_and_run_program(Some(filename), &program)
.unwrap();
}

pub fn criterion_benchmark(c: &mut Criterion) {
for entry in glob::glob("tests/**/*.egg").unwrap() {
let path = entry.unwrap().clone();
let name = path.file_stem().unwrap().to_string_lossy().to_string();
if path
.to_string_lossy()
.to_string()
.contains("fail-typecheck")
{
continue;
}
c.bench_with_input(BenchmarkId::new("example", &name), &path, |_b, f| {
run_example(f)
});
Expand Down

0 comments on commit fd2682e

Please sign in to comment.