Skip to content

Commit

Permalink
bye bye src/test/compile-fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jun 25, 2019
1 parent 9723ed0 commit 3282050
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ build/
# Output for all compiletest-based test suites
test/
run-pass/
compile-fail/
debuginfo/
...

Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ impl<'a> Builder<'a> {
test::Tidy,
test::Ui,
test::RunPass,
test::CompileFail,
test::RunFail,
test::RunPassValgrind,
test::MirOpt,
Expand Down
6 changes: 0 additions & 6 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,6 @@ default_test_with_compare_mode!(RunPass {
compare_mode: "nll"
});

default_test!(CompileFail {
path: "src/test/compile-fail",
mode: "compile-fail",
suite: "compile-fail"
});

default_test!(RunFail {
path: "src/test/run-fail",
mode: "run-fail",
Expand Down
5 changes: 1 addition & 4 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::util::PathBufExt;

#[derive(Clone, Copy, PartialEq, Debug)]
pub enum Mode {
CompileFail,
RunFail,
/// This now behaves like a `ui` test that has an implict `// run-pass`.
RunPass,
Expand Down Expand Up @@ -50,7 +49,6 @@ impl FromStr for Mode {
type Err = ();
fn from_str(s: &str) -> Result<Mode, ()> {
match s {
"compile-fail" => Ok(CompileFail),
"run-fail" => Ok(RunFail),
"run-pass" => Ok(RunPass),
"run-pass-valgrind" => Ok(RunPassValgrind),
Expand All @@ -76,7 +74,6 @@ impl FromStr for Mode {
impl fmt::Display for Mode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let s = match *self {
CompileFail => "compile-fail",
RunFail => "run-fail",
RunPass => "run-pass",
RunPassValgrind => "run-pass-valgrind",
Expand Down Expand Up @@ -172,7 +169,7 @@ pub struct Config {
/// The name of the stage being built (stage1, etc)
pub stage_id: String,

/// The test mode, compile-fail, run-fail, run-pass
/// The test mode, run-fail, run-pass
pub mode: Mode,

/// Run ignored tests
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
"",
"mode",
"which sort of compile tests to run",
"(compile-fail|run-fail|run-pass|\
"(run-fail|run-pass|\
run-pass-valgrind|pretty|debug-info|incremental|mir-opt)",
)
.optflag("", "ignored", "run tests marked as ignored")
Expand Down
17 changes: 7 additions & 10 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::common::{expected_output_path, UI_EXTENSIONS, UI_FIXED, UI_STDERR, UI
use crate::common::{output_base_dir, output_base_name, output_testname_unique};
use crate::common::{Codegen, CodegenUnits, Rustdoc};
use crate::common::{DebugInfoCdb, DebugInfoGdbLldb, DebugInfoGdb, DebugInfoLldb};
use crate::common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind};
use crate::common::{Pretty, RunFail, RunPass, RunPassValgrind};
use crate::common::{Config, TestPaths};
use crate::common::{Incremental, MirOpt, RunMake, Ui, JsDocTest, Assembly};
use diff;
Expand Down Expand Up @@ -286,7 +286,6 @@ impl<'test> TestCx<'test> {
/// revisions, exactly once, with revision == None).
fn run_revision(&self) {
match self.config.mode {
CompileFail => self.run_cfail_test(),
RunFail => self.run_rfail_test(),
RunPassValgrind => self.run_valgrind_test(),
Pretty => self.run_pretty_test(),
Expand Down Expand Up @@ -319,7 +318,6 @@ impl<'test> TestCx<'test> {

fn should_compile_successfully(&self) -> bool {
match self.config.mode {
CompileFail => false,
RunPass => true,
JsDocTest => true,
Ui => self.props.pass_mode.is_some(),
Expand Down Expand Up @@ -1535,12 +1533,11 @@ impl<'test> TestCx<'test> {
rustc.arg("-L").arg(&self.aux_output_dir_name());

match self.config.mode {
CompileFail | Ui => {
// compile-fail and ui tests tend to have tons of unused code as
// it's just testing various pieces of the compile, but we don't
// want to actually assert warnings about all this code. Instead
// let's just ignore unused code warnings by defaults and tests
// can turn it back on if needed.
Ui => {
// ui tests tend to have tons of unused code as it's just testing
// various pieces of the compile, but we don't want to actually assert
// warnings about all this code. Instead let's just ignore unused
// code warnings by defaults and tests can turn it back on if needed.
if !self.config.src_base.ends_with("rustdoc-ui") {
rustc.args(&["-A", "unused"]);
}
Expand Down Expand Up @@ -1922,7 +1919,7 @@ impl<'test> TestCx<'test> {
}

match self.config.mode {
CompileFail | Incremental => {
Incremental => {
// If we are extracting and matching errors in the new
// fashion, then you want JSON mode. Old-skool error
// patterns still match the raw compiler output.
Expand Down

0 comments on commit 3282050

Please sign in to comment.