mod test_util; #[cfg(test)] mod no_cargo { use crate::test_util::build_reference_test_runner::BuildReferenceTestRunner; use std::env; use test_generator::test_resources; fn test_without_cargo(test: F) where F: Fn(), { let path_var = env::var("PATH").unwrap(); let vars = path_var.split(':'); let new_vars: Vec<&str> = vars .filter(|v| !v.contains("cargo") && !v.contains("rustup")) .collect(); let new_path_var = new_vars.join(":"); temp_env::with_vars([("PATH", Some(new_path_var))], test); } #[test_resources("tests/resources/no_cargo_new/")] fn no_cargo(resource: &str) { test_without_cargo(|| { let build_test_runner = BuildReferenceTestRunner::from(resource); build_test_runner.run_reference_test(); }); } }