Skip to content

Commit

Permalink
Test fixes from the rollup
Browse files Browse the repository at this point in the history
Closes rust-lang#16097 (fix variable name in tutorial)
Closes rust-lang#16100 (More defailbloating)
Closes rust-lang#16104 (Fix deprecation commment on `core::cmp::lexical_ordering`)
Closes rust-lang#16105 (fix formatting in pointer guide table)
Closes rust-lang#16107 (remove serialize::ebml, add librbml)
Closes rust-lang#16108 (Fix heading levels in pointer guide)
Closes rust-lang#16109 (rustrt: Don't conditionally init the at_exit QUEUE)
Closes rust-lang#16111 (hexfloat: Deprecate to move out of the repo)
Closes rust-lang#16113 (Add examples for GenericPath methods.)
Closes rust-lang#16115 (Byte literals!)
Closes rust-lang#16116 (Add a non-regression test for issue rust-lang#8372)
Closes rust-lang#16120 (Deprecate semver)
Closes rust-lang#16124 (Deprecate uuid)
Closes rust-lang#16126 (Deprecate fourcc)
Closes rust-lang#16127 (Remove incorrect example)
Closes rust-lang#16129 (Add note about production deployments.)
Closes rust-lang#16131 (librustc: Don't ICE when trying to subst regions in destructor call.)
Closes rust-lang#16133 (librustc: Don't ICE with struct exprs where the name is not a valid struct.)
Closes rust-lang#16136 (Implement slice::Vector for Option<T> and CVec<T>)
Closes rust-lang#16137 (alloc, arena, test, url, uuid: Elide lifetimes.)
  • Loading branch information
alexcrichton committed Jul 31, 2014
1 parent f861848 commit ec79d36
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/librustrt/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ mod test {
#[should_fail]
fn test_begin_unwind() {
use std::rt::unwind::begin_unwind;
begin_unwind("cause", file!(), line!())
begin_unwind("cause", &(file!(), line!()))
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions src/libuuid/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ unlikely.
To create a new random (V4) UUID and print it out in hexadecimal form:
```rust
# #![allow(deprecated)]
# extern crate uuid;
use uuid::Uuid;
fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/lang-item-public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![feature(lang_items)]

#[lang="fail_"]
fn fail(_: &'static str, _: &'static str, _: uint) -> ! { loop {} }
fn fail(_: &(&'static str, &'static str, uint)) -> ! { loop {} }

#[lang = "stack_exhausted"]
extern fn stack_exhausted() {}
Expand Down
16 changes: 11 additions & 5 deletions src/test/run-pass/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ fn start(argc: int, argv: *const *const u8) -> int {

#[inline(never)]
fn foo() {
fail!()
let _v = vec![1i, 2, 3];
if os::getenv("IS_TEST").is_some() {
fail!()
}
}

#[inline(never)]
Expand All @@ -37,32 +40,35 @@ fn double() {
}

fn runtest(me: &str) {
let mut template = Command::new(me);
template.env("IS_TEST", "1");

// Make sure that the stack trace is printed
let mut p = Command::new(me).arg("fail").env("RUST_BACKTRACE", "1").spawn().unwrap();
let p = template.clone().arg("fail").env("RUST_BACKTRACE", "1").spawn().unwrap();
let out = p.wait_with_output().unwrap();
assert!(!out.status.success());
let s = str::from_utf8(out.error.as_slice()).unwrap();
assert!(s.contains("stack backtrace") && s.contains("foo::h"),
"bad output: {}", s);

// Make sure the stack trace is *not* printed
let mut p = Command::new(me).arg("fail").spawn().unwrap();
let p = template.clone().arg("fail").spawn().unwrap();
let out = p.wait_with_output().unwrap();
assert!(!out.status.success());
let s = str::from_utf8(out.error.as_slice()).unwrap();
assert!(!s.contains("stack backtrace") && !s.contains("foo::h"),
"bad output2: {}", s);

// Make sure a stack trace is printed
let mut p = Command::new(me).arg("double-fail").spawn().unwrap();
let p = template.clone().arg("double-fail").spawn().unwrap();
let out = p.wait_with_output().unwrap();
assert!(!out.status.success());
let s = str::from_utf8(out.error.as_slice()).unwrap();
assert!(s.contains("stack backtrace") && s.contains("double::h"),
"bad output3: {}", s);

// Make sure a stack trace isn't printed too many times
let mut p = Command::new(me).arg("double-fail")
let p = template.clone().arg("double-fail")
.env("RUST_BACKTRACE", "1").spawn().unwrap();
let out = p.wait_with_output().unwrap();
assert!(!out.status.success());
Expand Down

4 comments on commit ec79d36

@alexcrichton
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ p=10

@alexcrichton
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors: retry

@alexcrichton
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors: retry

@alexcrichton
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors: retry

Please sign in to comment.