# HG changeset patch # User Simon Heath # Date 1688939614 14400 # Sun Jul 09 17:53:34 2023 -0400 # Node ID 430bcdd316fa817f26ba24f158c7019f4d46b6a7 # Parent 281b2177867e81bad8b62086ce6ed2095f44beec # Parent ccddc594ebdc6537ac2846435b1ea1602a74fd1c mergeded diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -11,11 +11,6 @@ path = "tests/endtoend.rs" harness = false -#[[test]] -#name = "reformat" -#path = "tests/reformat.rs" -#harness = false - [[test]] name = "blns" path = "tests/blns.rs" diff --git a/tests/reformat.rs b/tests/reformat.rs deleted file mode 100644 --- a/tests/reformat.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! Test suite that parses the programs in `tests/programs/`, -//! then runs garnetfmt on them and makes sure they parse identically. -//! -//! Still uses `lang_tester` which is kinda odd but works. -//! It's slooooooow because it has lots of external invocations to -//! `garnetfmt`, but frankly `garnetfmt` should make sure that its output -//! is still valid anyway so in the end this is kinda the right abstraction -//! boundary. Otherwise we'd just have to rewrite half of lang_tester and -//! half of garnetfmt in this file. - -use std::process::Command; - -use lang_tester::LangTester; - -fn main() { - // We use garnetc to compile files into a binary, then store those binary files into `tempdir`. - LangTester::new() - .test_dir("tests/programs/") - // Only use files named `*.gt` as test files. - .test_file_filter(|p| { - p.extension() - .map(std::ffi::OsStr::to_str) - .unwrap_or(Some("")) - .unwrap() - == "gt" - }) - .test_extract(|_p| String::from("Format:\n status: success\n")) - .test_cmds(move |p| { - // Test command 1: reformat x.gt and make sure it succeeds, - // which checks reparsing - let mut format = Command::new("cargo"); - format.args(&[ - "run", - "--bin", - "garnetfmt", - "--", - "-c", - p.to_str().unwrap(), - ]); - - vec![("Format", format)] - }) - .run(); -}