Testsuite: remove some unnecessary is_nightly checks.

This commit is contained in:
Eric Huss 2019-03-26 13:56:14 -07:00
parent 1ebf6ef219
commit 50277e88fe
14 changed files with 27 additions and 88 deletions

View file

@ -6,7 +6,7 @@ use crate::support::paths::{root, CargoPathExt};
use crate::support::registry::Package;
use crate::support::ProjectBuilder;
use crate::support::{
basic_bin_manifest, basic_lib_manifest, basic_manifest, is_nightly, rustc_host, sleep_ms,
basic_bin_manifest, basic_lib_manifest, basic_manifest, rustc_host, sleep_ms,
};
use crate::support::{main_file, project, Execs};
use cargo::util::paths::dylib_path_envvar;
@ -2706,10 +2706,6 @@ fn example_as_dylib() {
#[test]
fn example_as_proc_macro() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",
@ -2725,7 +2721,18 @@ fn example_as_proc_macro() {
"#,
)
.file("src/lib.rs", "")
.file("examples/ex.rs", "#![feature(proc_macro)]")
.file(
"examples/ex.rs",
r#"
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro]
pub fn eat(_item: TokenStream) -> TokenStream {
"".parse().unwrap()
}
"#,
)
.build();
p.cargo("build --example=ex").run();

View file

@ -149,6 +149,7 @@ fn plugin_deps() {
return;
}
if !is_nightly() {
// plugins are unstable
return;
}
@ -241,6 +242,7 @@ fn plugin_to_the_max() {
return;
}
if !is_nightly() {
// plugins are unstable
return;
}
@ -396,6 +398,7 @@ fn plugin_with_extra_dylib_dep() {
return;
}
if !is_nightly() {
// plugins are unstable
return;
}

View file

@ -4,6 +4,7 @@ use crate::support::{basic_manifest, project};
#[test]
fn custom_target_minimal() {
if !is_nightly() {
// Requires features no_core, lang_items
return;
}
let p = project()
@ -53,6 +54,7 @@ fn custom_target_minimal() {
#[test]
fn custom_target_dependency() {
if !is_nightly() {
// Requires features no_core, lang_items, optin_builtin_traits
return;
}
let p = project()

View file

@ -903,9 +903,6 @@ fn document_only_lib() {
#[test]
fn plugins_no_use_target() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",
@ -1165,11 +1162,6 @@ fn doc_workspace_open_binary_and_library() {
#[test]
fn doc_edition() {
if !is_nightly() {
// Stable rustdoc won't have the edition option. Remove this once it
// is stabilized.
return;
}
let p = project()
.file(
"Cargo.toml",
@ -1198,9 +1190,6 @@ fn doc_edition() {
#[test]
fn doc_target_edition() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",

View file

@ -1,11 +1,7 @@
use crate::support::{basic_lib_manifest, is_nightly, project};
use crate::support::{basic_lib_manifest, project};
#[test]
fn edition_works_for_build_script() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",

View file

@ -3,7 +3,6 @@ use std::fs::File;
use git2;
use crate::support::git;
use crate::support::is_nightly;
use crate::support::{basic_manifest, project};
use std::io::Write;
@ -267,15 +266,11 @@ fn do_not_fix_non_relevant_deps() {
#[test]
fn prepare_for_2018() {
if !is_nightly() {
return;
}
let p = project()
.file(
"src/lib.rs",
r#"
#![allow(unused)]
#![feature(rust_2018_preview)]
mod foo {
pub const FOO: &str = "fooo";
@ -311,15 +306,10 @@ fn prepare_for_2018() {
#[test]
fn local_paths() {
if !is_nightly() {
return;
}
let p = project()
.file(
"src/lib.rs",
r#"
#![feature(rust_2018_preview)]
use test::foo;
mod test {
@ -350,9 +340,6 @@ fn local_paths() {
#[test]
fn upgrade_extern_crate() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",
@ -403,15 +390,11 @@ fn upgrade_extern_crate() {
#[test]
fn specify_rustflags() {
if !is_nightly() {
return;
}
let p = project()
.file(
"src/lib.rs",
r#"
#![allow(unused)]
#![feature(rust_2018_preview)]
mod foo {
pub const FOO: &str = "fooo";
@ -874,15 +857,10 @@ information about transitioning to the 2018 edition see:
#[test]
fn fix_overlapping() {
if !is_nightly() {
return;
}
let p = project()
.file(
"src/lib.rs",
r#"
#![feature(rust_2018_preview)]
pub fn foo<T>() {}
pub struct A;
@ -912,9 +890,6 @@ fn fix_overlapping() {
#[test]
fn fix_idioms() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",
@ -1196,9 +1171,6 @@ fn only_warn_for_relevant_crates() {
#[test]
fn fix_to_broken_code() {
if !is_nightly() {
return;
}
let p = project()
.file(
"foo/Cargo.toml",

View file

@ -770,11 +770,6 @@ fn installs_from_cwd_by_default() {
#[test]
fn installs_from_cwd_with_2018_warnings() {
if !support::is_nightly() {
// Stable rust won't have the edition option. Remove this once it
// is stabilized.
return;
}
let p = project()
.file(
"Cargo.toml",

View file

@ -6,7 +6,7 @@ use std::path::Path;
use crate::support::cargo_process;
use crate::support::registry::Package;
use crate::support::{
basic_manifest, git, is_nightly, path2url, paths, project, publish::validate_crate_contents,
basic_manifest, git, path2url, paths, project, publish::validate_crate_contents,
registry,
};
use git2;
@ -972,11 +972,6 @@ fn test_edition() {
#[test]
fn edition_with_metadata() {
if !is_nightly() {
// --edition is nightly-only
return;
}
let p = project()
.file(
"Cargo.toml",

View file

@ -4,6 +4,7 @@ use crate::support::{is_nightly, rustc_host};
#[test]
fn plugin_to_the_max() {
if !is_nightly() {
// plugins are unstable
return;
}
@ -103,6 +104,7 @@ fn plugin_to_the_max() {
#[test]
fn plugin_with_dynamic_native_dependency() {
if !is_nightly() {
// plugins are unstable
return;
}
@ -335,6 +337,7 @@ fn native_plugin_dependency_with_custom_ar_linker() {
#[test]
fn panic_abort_plugins() {
if !is_nightly() {
// requires rustc_private
return;
}
@ -382,6 +385,7 @@ fn panic_abort_plugins() {
#[test]
fn shared_panic_abort_plugins() {
if !is_nightly() {
// requires rustc_private
return;
}

View file

@ -204,6 +204,7 @@ fn impl_and_derive() {
#[test]
fn plugin_and_proc_macro() {
if !is_nightly() {
// plugins are unstable
return;
}

View file

@ -1,6 +1,5 @@
use std::env;
use crate::support::is_nightly;
use crate::support::project;
#[test]
@ -149,10 +148,6 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) {
#[test]
fn opt_level_overrides() {
if !is_nightly() {
return;
}
for &(profile_level, rustc_level) in &[
("1", "1"),
("2", "2"),

View file

@ -1,4 +1,3 @@
use crate::support;
use crate::support::{basic_bin_manifest, basic_lib_manifest, project, Project};
use cargo::util::paths::dylib_path_envvar;
@ -435,10 +434,6 @@ fn autodiscover_examples_project(rust_edition: &str, autoexamples: Option<bool>)
#[test]
fn run_example_autodiscover_2015() {
if !support::is_nightly() {
return;
}
let p = autodiscover_examples_project("2015", None);
p.cargo("run --example a")
.with_status(101)
@ -467,10 +462,6 @@ error: no example target named `a`
#[test]
fn run_example_autodiscover_2015_with_autoexamples_enabled() {
if !support::is_nightly() {
return;
}
let p = autodiscover_examples_project("2015", Some(true));
p.cargo("run --example a")
.with_stderr(
@ -485,10 +476,6 @@ fn run_example_autodiscover_2015_with_autoexamples_enabled() {
#[test]
fn run_example_autodiscover_2015_with_autoexamples_disabled() {
if !support::is_nightly() {
return;
}
let p = autodiscover_examples_project("2015", Some(false));
p.cargo("run --example a")
.with_status(101)
@ -498,10 +485,6 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
#[test]
fn run_example_autodiscover_2018() {
if !support::is_nightly() {
return;
}
let p = autodiscover_examples_project("2018", None);
p.cargo("run --example a")
.with_stderr(

View file

@ -60,6 +60,7 @@ rust, like this:
```
if !is_nightly() {
// Add a comment here explaining why this is necessary.
return;
}
```
@ -753,7 +754,6 @@ impl Execs {
p.cwd(cwd.join(path.as_ref()));
} else {
p.cwd(path);
}
}
self

View file

@ -6,7 +6,7 @@ use cargo;
use crate::support::paths::CargoPathExt;
use crate::support::registry::Package;
use crate::support::{basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, project};
use crate::support::{is_nightly, rustc_host, sleep_ms};
use crate::support::{rustc_host, sleep_ms};
#[test]
fn cargo_test_simple() {
@ -106,9 +106,6 @@ fn cargo_test_release() {
#[test]
fn cargo_test_overflow_checks() {
if !is_nightly() {
return;
}
let p = project()
.file(
"Cargo.toml",