Skip to content

Commit

Permalink
Rollup merge of #48880 - petrochenkov:badstderr, r=kennytm
Browse files Browse the repository at this point in the history
tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directories
  • Loading branch information
Mark-Simulacrum committed Mar 9, 2018
2 parents 7e310c6 + c1a73d2 commit 56b923e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 140 deletions.
19 changes: 0 additions & 19 deletions src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr

This file was deleted.

This file was deleted.

62 changes: 0 additions & 62 deletions src/test/ui/resolve-error.stderr

This file was deleted.

14 changes: 0 additions & 14 deletions src/test/ui/span/loan-extend.stderr

This file was deleted.

1 change: 1 addition & 0 deletions src/tools/tidy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub mod features;
pub mod cargo;
pub mod pal;
pub mod deps;
pub mod ui_tests;
pub mod unstable_book;

fn filter_dirs(path: &Path) -> bool {
Expand Down
1 change: 1 addition & 0 deletions src/tools/tidy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fn main() {
deps::check(&path, &mut bad);
}
deps::check_whitelist(&path, &cargo, &mut bad);
ui_tests::check(&path, &mut bad);

if bad {
eprintln!("some tidy checks failed");
Expand Down
26 changes: 26 additions & 0 deletions src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Tidy check to ensure that there are no stray `.stderr` files in UI test directories.

use std::path::Path;

pub fn check(path: &Path, bad: &mut bool) {
super::walk_many(&[&path.join("test/ui"), &path.join("test/ui-fulldeps")],
&mut |_| false,
&mut |file_path| {
if let Some(ext) = file_path.extension() {
if (ext == "stderr" || ext == "stdout") && !file_path.with_extension("rs").exists() {
println!("Stray file with UI testing output: {:?}", file_path);
*bad = true;
}
}
});
}

0 comments on commit 56b923e

Please sign in to comment.