allowing the entry point name to be something other than main
add build tests
This commit is contained in:
parent
0e8490757f
commit
b7cefd0c96
7 changed files with 127 additions and 14 deletions
17
src/test/compile-fail/multiple-main-2.rs
Normal file
17
src/test/compile-fail/multiple-main-2.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2012 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.
|
||||
|
||||
#[main]
|
||||
fn bar() {
|
||||
}
|
||||
|
||||
#[main]
|
||||
fn foo() { //~ ERROR multiple 'main' functions
|
||||
}
|
||||
19
src/test/compile-fail/multiple-main-3.rs
Normal file
19
src/test/compile-fail/multiple-main-3.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2012 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.
|
||||
|
||||
#[main]
|
||||
fn main1() {
|
||||
}
|
||||
|
||||
mod foo {
|
||||
#[main]
|
||||
fn main2() { //~ ERROR multiple 'main' functions
|
||||
}
|
||||
}
|
||||
17
src/test/run-pass/attr-main-2.rs
Normal file
17
src/test/run-pass/attr-main-2.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2012 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.
|
||||
|
||||
fn main() {
|
||||
fail
|
||||
}
|
||||
|
||||
#[main]
|
||||
fn foo() {
|
||||
}
|
||||
13
src/test/run-pass/attr-main.rs
Normal file
13
src/test/run-pass/attr-main.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2012 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.
|
||||
|
||||
#[main]
|
||||
fn foo() {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue