Give test and main tasks better names
Tests now have the same name as the test that they're running (to allow for easier diagnosing of failure sources), and the main task is now specially named <main> instead of <unnamed>. Closes #10195 Closes #10073
This commit is contained in:
parent
e976de32dc
commit
e2a68b6867
4 changed files with 40 additions and 0 deletions
15
src/test/run-fail/main-fail.rs
Normal file
15
src/test/run-fail/main-fail.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:task '<main>' failed at
|
||||
|
||||
fn main() {
|
||||
fail!()
|
||||
}
|
||||
18
src/test/run-fail/test-fail.rs
Normal file
18
src/test/run-fail/test-fail.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:task 'test_foo' failed at
|
||||
// compile-flags: --test
|
||||
|
||||
#[test]
|
||||
fn test_foo() {
|
||||
fail!()
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue