fn main()
{
  if std::fs::exists("gqlite_bench_data").unwrap()
  {
    std::process::Command::new("git")
      .arg("pull")
      .spawn()
      .unwrap()
      .wait()
      .unwrap();
  }
  else
  {
    std::process::Command::new("git")
      .arg("clone")
      .arg("https://gitlab.com/auksys/data/gqlite_bench.git")
      .arg("gqlite_bench_data")
      .spawn()
      .unwrap()
      .wait()
      .unwrap();
  }
  // Run registered benchmarks.
  divan::main();
}

// Parse the small `pokec` dataset.
#[divan::bench()]
fn parse_small_pokec()
{
  let filename = "gqlite_bench_data/pokec_small_import.cypher";
  let import_query = std::fs::read_to_string(filename).unwrap();
  let _ = gqlparser::oc::parse_oc_query(&import_query);
}
