1 //! Tidy check to prevent creation of unnecessary debug artifacts while running tests.
3 use std::path::{Path, PathBuf};
5 const GRAPHVIZ_POSTFLOW_MSG: &str = "`borrowck_graphviz_postflow` attribute in test";
7 pub fn check(path: &Path, bad: &mut bool) {
8 let test_dir: PathBuf = path.join("test");
10 super::walk(&test_dir, &mut super::filter_dirs, &mut |entry, contents| {
11 let filename = entry.path();
12 let is_rust = filename.extension().map_or(false, |ext| ext == "rs");
17 for (i, line) in contents.lines().enumerate() {
18 if line.contains("borrowck_graphviz_postflow") {
19 tidy_error!(bad, "{}:{}: {}", filename.display(), i + 1, GRAPHVIZ_POSTFLOW_MSG);