Skip to content

Commit

Permalink
Delete broken nightly tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Jun 11, 2020
1 parent dc21706 commit f5681b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 302 deletions.
92 changes: 1 addition & 91 deletions tests/testsuite/cross_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//!
//! See `cargo_test_support::cross_compile` for more detail.
use cargo_test_support::rustc_host;
use cargo_test_support::{basic_bin_manifest, basic_manifest, cross_compile, project};
use cargo_test_support::{is_nightly, rustc_host};

#[cargo_test]
fn simple_cross() {
Expand Down Expand Up @@ -206,96 +206,6 @@ fn linker() {
.run();
}

#[cargo_test]
fn plugin_with_extra_dylib_dep() {
if cross_compile::disabled() {
return;
}
if !is_nightly() {
// plugins are unstable
return;
}

let foo = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.0.1"
authors = []
[dependencies.bar]
path = "../bar"
"#,
)
.file(
"src/main.rs",
r#"
#![feature(plugin)]
#![plugin(bar)]
fn main() {}
"#,
)
.build();
let _bar = project()
.at("bar")
.file(
"Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
[lib]
name = "bar"
plugin = true
[dependencies.baz]
path = "../baz"
"#,
)
.file(
"src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
extern crate baz;
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
#[plugin_registrar]
pub fn foo(reg: &mut Registry) {
println!("{}", baz::baz());
}
"#,
)
.build();
let _baz = project()
.at("baz")
.file(
"Cargo.toml",
r#"
[package]
name = "baz"
version = "0.0.1"
authors = []
[lib]
name = "baz"
crate_type = ["dylib"]
"#,
)
.file("src/lib.rs", "pub fn baz() -> i32 { 1 }")
.build();

let target = cross_compile::alternate();
foo.cargo("build --target").arg(&target).run();
}

#[cargo_test]
fn cross_tests() {
if !cross_compile::can_run_on_host() {
Expand Down
211 changes: 0 additions & 211 deletions tests/testsuite/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,217 +3,6 @@
use cargo_test_support::{basic_manifest, project};
use cargo_test_support::{is_nightly, rustc_host};

#[cargo_test]
fn plugin_to_the_max() {
if !is_nightly() {
// plugins are unstable
return;
}

let foo = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.0.1"
authors = []
[lib]
name = "foo_lib"
[dependencies.bar]
path = "../bar"
"#,
)
.file(
"src/main.rs",
r#"
#![feature(plugin)]
#![plugin(bar)]
extern crate foo_lib;
fn main() { foo_lib::foo(); }
"#,
)
.file(
"src/foo_lib.rs",
r#"
#![feature(plugin)]
#![plugin(bar)]
pub fn foo() {}
"#,
)
.build();
let _bar = project()
.at("bar")
.file(
"Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
[lib]
name = "bar"
plugin = true
[dependencies.baz]
path = "../baz"
"#,
)
.file(
"src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
extern crate baz;
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
#[plugin_registrar]
pub fn foo(_reg: &mut Registry) {
println!("{}", baz::baz());
}
"#,
)
.build();
let _baz = project()
.at("baz")
.file(
"Cargo.toml",
r#"
[package]
name = "baz"
version = "0.0.1"
authors = []
[lib]
name = "baz"
crate_type = ["dylib"]
"#,
)
.file("src/lib.rs", "pub fn baz() -> i32 { 1 }")
.build();

foo.cargo("build").run();
foo.cargo("doc").run();
}

#[cargo_test]
fn plugin_with_dynamic_native_dependency() {
if !is_nightly() {
// plugins are unstable
return;
}

let build = project()
.at("builder")
.file(
"Cargo.toml",
r#"
[package]
name = "builder"
version = "0.0.1"
authors = []
[lib]
name = "builder"
crate-type = ["dylib"]
"#,
)
.file("src/lib.rs", "#[no_mangle] pub extern fn foo() {}")
.build();

let foo = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.0.1"
authors = []
[dependencies.bar]
path = "bar"
"#,
)
.file(
"src/main.rs",
r#"
#![feature(plugin)]
#![plugin(bar)]
fn main() {}
"#,
)
.file(
"bar/Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
build = 'build.rs'
[lib]
name = "bar"
plugin = true
"#,
)
.file(
"bar/build.rs",
r#"
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let root = PathBuf::from(env::var("BUILDER_ROOT").unwrap());
let file = format!("{}builder{}",
env::consts::DLL_PREFIX,
env::consts::DLL_SUFFIX);
let src = root.join(&file);
let dst = out_dir.join(&file);
fs::copy(src, dst).unwrap();
if cfg!(windows) {
fs::copy(root.join("builder.dll.lib"),
out_dir.join("builder.dll.lib")).unwrap();
}
println!("cargo:rustc-flags=-L {}", out_dir.display());
}
"#,
)
.file(
"bar/src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
#[cfg_attr(not(target_env = "msvc"), link(name = "builder"))]
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
extern { fn foo(); }
#[plugin_registrar]
pub fn bar(_reg: &mut Registry) {
unsafe { foo() }
}
"#,
)
.build();

build.cargo("build").run();

let root = build.root().join("target").join("debug");
foo.cargo("build -v").env("BUILDER_ROOT", root).run();
}

#[cargo_test]
fn plugin_integration() {
let p = project()
Expand Down

0 comments on commit f5681b7

Please sign in to comment.