Skip to content

Commit

Permalink
Auto merge of #3299 - alexcrichton:fix-tests, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix tests on nightly
  • Loading branch information
bors authored Nov 17, 2016
2 parents 2ffc035 + 0a78e43 commit b7be4f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/rustversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016-11-03
2016-11-16
9 changes: 7 additions & 2 deletions tests/cargotest/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,13 @@ impl<T, E: fmt::Display> ErrMsg<T> for Result<T, E> {
// Path to cargo executables
pub fn cargo_dir() -> PathBuf {
env::var_os("CARGO_BIN_PATH").map(PathBuf::from).or_else(|| {
env::current_exe().ok().as_ref().and_then(|s| s.parent())
.map(|s| s.to_path_buf())
env::current_exe().ok().map(|mut path| {
path.pop();
if path.ends_with("deps") {
path.pop();
}
path
})
}).unwrap_or_else(|| {
panic!("CARGO_BIN_PATH wasn't set. Cannot continue running test")
})
Expand Down
15 changes: 4 additions & 11 deletions tests/proc-macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ fn noop() {
use proc_macro::TokenStream;
#[proc_macro_derive(Noop)]
pub fn noop(input: TokenStream) -> TokenStream {
input
pub fn noop(_input: TokenStream) -> TokenStream {
"".parse().unwrap()
}
"#);
noop.build();
Expand Down Expand Up @@ -87,8 +87,8 @@ fn impl_and_derive() {
fn impl_by_transmogrify(&self) -> bool;
}
#[derive(Transmogrify)]
struct X;
#[derive(Transmogrify, Debug)]
struct X { success: bool }
fn main() {
let x = X::new();
Expand All @@ -115,8 +115,6 @@ fn impl_and_derive() {
#[proc_macro_derive(Transmogrify)]
#[doc(hidden)]
pub fn transmogrify(input: TokenStream) -> TokenStream {
assert_eq!(input.to_string(), "struct X;\n");
"
impl X {
fn new() -> Self {
Expand All @@ -129,11 +127,6 @@ fn impl_and_derive() {
true
}
}
#[derive(Debug)]
struct X {
success: bool,
}
".parse().unwrap()
}
"#);
Expand Down

0 comments on commit b7be4f2

Please sign in to comment.