Skip to content

Commit

Permalink
Remove failing plugin tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Nov 25, 2019
1 parent 750cb14 commit 1d1b035
Showing 1 changed file with 0 additions and 195 deletions.
195 changes: 0 additions & 195 deletions tests/testsuite/cross_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,201 +143,6 @@ fn simple_deps() {
p.process(&p.target_bin(&target, "foo")).run();
}

#[cargo_test]
fn plugin_deps() {
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"
[dependencies.baz]
path = "../baz"
"#,
)
.file(
"src/main.rs",
r#"
#![feature(plugin)]
#![plugin(bar)]
extern crate baz;
fn main() {
assert_eq!(bar!(), baz::baz());
}
"#,
)
.build();
let _bar = project()
.at("bar")
.file(
"Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
[lib]
name = "bar"
plugin = true
"#,
)
.file(
"src/lib.rs",
r#"
#![feature(plugin_registrar, rustc_private)]
extern crate rustc_driver;
extern crate syntax;
extern crate syntax_expand;
use rustc_driver::plugin::Registry;
use syntax::tokenstream::TokenStream;
use syntax::source_map::Span;
use syntax::ast::*;
use syntax_expand::base::{ExtCtxt, MacEager, MacResult};
#[plugin_registrar]
pub fn foo(reg: &mut Registry) {
reg.register_macro("bar", expand_bar);
}
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: TokenStream)
-> Box<MacResult + 'static> {
MacEager::expr(cx.expr_lit(sp, LitKind::Int(1, LitIntType::Unsuffixed)))
}
"#,
)
.build();
let _baz = project()
.at("baz")
.file("Cargo.toml", &basic_manifest("baz", "0.0.1"))
.file("src/lib.rs", "pub fn baz() -> i32 { 1 }")
.build();

let target = cross_compile::alternate();
foo.cargo("build --target").arg(&target).run();
assert!(foo.target_bin(&target, "foo").is_file());

foo.process(&foo.target_bin(&target, "foo")).run();
}

#[cargo_test]
fn plugin_to_the_max() {
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"
[dependencies.baz]
path = "../baz"
"#,
)
.file(
"src/main.rs",
r#"
#![feature(plugin)]
#![plugin(bar)]
extern crate baz;
fn main() {
assert_eq!(bar!(), baz::baz());
}
"#,
)
.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 rustc_driver;
extern crate syntax;
extern crate syntax_expand;
extern crate baz;
use rustc_driver::plugin::Registry;
use syntax::tokenstream::TokenStream;
use syntax::source_map::Span;
use syntax::ast::*;
use syntax_expand::base::{ExtCtxt, MacEager, MacResult};
use syntax::ptr::P;
#[plugin_registrar]
pub fn foo(reg: &mut Registry) {
reg.register_macro("bar", expand_bar);
}
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: TokenStream)
-> Box<MacResult + 'static> {
let bar = Ident::from_str("baz");
let path = cx.path(sp, vec![bar.clone(), bar]);
MacEager::expr(cx.expr_call(sp, cx.expr_path(path), vec![]))
}
"#,
)
.build();
let _baz = project()
.at("baz")
.file("Cargo.toml", &basic_manifest("baz", "0.0.1"))
.file("src/lib.rs", "pub fn baz() -> i32 { 1 }")
.build();

let target = cross_compile::alternate();
foo.cargo("build -v --target").arg(&target).run();
println!("second");
foo.cargo("build -v --target").arg(&target).run();
assert!(foo.target_bin(&target, "foo").is_file());

foo.process(&foo.target_bin(&target, "foo")).run();
}

#[cargo_test]
fn linker_and_ar() {
if cross_compile::disabled() {
Expand Down

0 comments on commit 1d1b035

Please sign in to comment.