(
+ &mut self,
+ configs: Vec (
- &mut self,
- configs: Vec (&mut self, configs: Vec.*)\]:.*").unwrap();
+// // Store all covered error codes
+// let mut found_codes = BTreeMap::new();
+// let re = Regex::new(r"Error \[(?P
.*)\]:.*").unwrap();
- for (path, content) in tests.into_iter() {
- if let Some(config) = extract_test_config(&content) {
- // Skip passing tests.
- if config.expectation == Expectation::Pass {
- continue;
- }
+// for (path, content) in tests.into_iter() {
+// if let Some(config) = extract_test_config(&content) {
+// // Skip passing tests.
+// if config.expectation == Expectation::Pass {
+// continue;
+// }
- let mut expectation_path = expectation_dir.clone();
+// let mut expectation_path = expectation_dir.clone();
- let path = PathBuf::from(path);
- let relative_path = path.strip_prefix(&test_dir).expect("path error for test");
+// let path = PathBuf::from(path);
+// let relative_path = path.strip_prefix(&test_dir).expect("path error for test");
- let mut relative_expectation_path = relative_path.to_str().unwrap().to_string();
- relative_expectation_path += ".out";
+// let mut relative_expectation_path = relative_path.to_str().unwrap().to_string();
+// relative_expectation_path += ".out";
- // Add expectation category
- if relative_expectation_path.starts_with("compiler") {
- expectation_path.push("compiler");
- } else {
- expectation_path.push("parser");
- }
- expectation_path.push(&relative_expectation_path);
+// // Add expectation category
+// if relative_expectation_path.starts_with("compiler") {
+// expectation_path.push("compiler");
+// } else {
+// expectation_path.push("parser");
+// }
+// expectation_path.push(&relative_expectation_path);
- if expectation_path.exists() {
- let raw = std::fs::read_to_string(&expectation_path).expect("failed to read expectations file");
- let expectation: TestExpectation =
- serde_yaml::from_str(&raw).expect("invalid yaml in expectations file");
+// if expectation_path.exists() {
+// let raw = std::fs::read_to_string(&expectation_path).expect("failed to read expectations file");
+// let expectation: TestExpectation =
+// serde_yaml::from_str(&raw).expect("invalid yaml in expectations file");
- for value in expectation.outputs {
- if let serde_yaml::Value::String(message) = value {
- if let Some(caps) = re.captures(&message) {
- if let Some(code) = caps.name("code") {
- let files = found_codes
- .entry(code.as_str().to_string())
- .or_insert_with(HashSet::new);
- let path = expectation_path
- .strip_prefix(test_dir.clone())
- .expect("invalid prefix for expectation path");
- files.insert(PathBuf::from(path));
- }
- }
- }
- }
- }
- }
- }
+// for value in expectation.outputs {
+// if let serde_yaml::Value::String(message) = value {
+// if let Some(caps) = re.captures(&message) {
+// if let Some(code) = caps.name("code") {
+// let files = found_codes
+// .entry(code.as_str().to_string())
+// .or_insert_with(HashSet::new);
+// let path = expectation_path
+// .strip_prefix(test_dir.clone())
+// .expect("invalid prefix for expectation path");
+// files.insert(PathBuf::from(path));
+// }
+// }
+// }
+// }
+// }
+// }
+// }
- // Collect all defined error codes.
- let mut all_codes = HashSet::new();
- collect_error_codes(
- &mut all_codes,
- AstError::message_type(),
- AstError::code_identifier(),
- AstError::code_mask(),
- AstError::num_exit_codes(),
- );
- collect_error_codes(
- &mut all_codes,
- InputError::message_type(),
- InputError::code_identifier(),
- InputError::code_mask(),
- InputError::num_exit_codes(),
- );
- collect_error_codes(
- &mut all_codes,
- PackageError::message_type(),
- PackageError::code_identifier(),
- PackageError::code_mask(),
- PackageError::num_exit_codes(),
- );
- collect_error_codes(
- &mut all_codes,
- ParserError::message_type(),
- ParserError::code_identifier(),
- ParserError::code_mask(),
- ParserError::num_exit_codes(),
- );
+// // Collect all defined error codes.
+// let mut all_codes = HashSet::new();
+// collect_error_codes(
+// &mut all_codes,
+// AstError::message_type(),
+// AstError::code_identifier(),
+// AstError::code_mask(),
+// AstError::num_exit_codes(),
+// );
+// collect_error_codes(
+// &mut all_codes,
+// InputError::message_type(),
+// InputError::code_identifier(),
+// InputError::code_mask(),
+// InputError::num_exit_codes(),
+// );
+// collect_error_codes(
+// &mut all_codes,
+// PackageError::message_type(),
+// PackageError::code_identifier(),
+// PackageError::code_mask(),
+// PackageError::num_exit_codes(),
+// );
+// collect_error_codes(
+// &mut all_codes,
+// ParserError::message_type(),
+// ParserError::code_identifier(),
+// ParserError::code_mask(),
+// ParserError::num_exit_codes(),
+// );
- // Repackage data into values compatible with serde_yaml
- let mut covered_errors = serde_yaml::Mapping::new();
- let mut unknown_errors = serde_yaml::Mapping::new();
+// // Repackage data into values compatible with serde_yaml
+// let mut covered_errors = serde_yaml::Mapping::new();
+// let mut unknown_errors = serde_yaml::Mapping::new();
- for (code, paths) in found_codes.iter() {
- let mut yaml_paths = Vec::with_capacity(paths.len());
- for path in paths {
- yaml_paths.push(path.to_str().unwrap());
- }
- yaml_paths.sort_unstable();
- let yaml_paths = yaml_paths.iter().map(|s| Value::String(s.to_string())).collect();
+// for (code, paths) in found_codes.iter() {
+// let mut yaml_paths = Vec::with_capacity(paths.len());
+// for path in paths {
+// yaml_paths.push(path.to_str().unwrap());
+// }
+// yaml_paths.sort_unstable();
+// let yaml_paths = yaml_paths.iter().map(|s| Value::String(s.to_string())).collect();
- if all_codes.contains(code) {
- covered_errors.insert(Value::String(code.to_owned()), Value::Sequence(yaml_paths));
- } else {
- unknown_errors.insert(Value::String(code.to_owned()), Value::Sequence(yaml_paths));
- }
- all_codes.remove(code);
- }
+// if all_codes.contains(code) {
+// covered_errors.insert(Value::String(code.to_owned()), Value::Sequence(yaml_paths));
+// } else {
+// unknown_errors.insert(Value::String(code.to_owned()), Value::Sequence(yaml_paths));
+// }
+// all_codes.remove(code);
+// }
- let mut codes: Vec