rustpkg: Add more tests
These are examples of what *should* work, and probably don't work yet.
This commit is contained in:
parent
958189dba1
commit
128e95b89d
18
src/librustpkg/testsuite/pass/deeply/nested/path/foo/main.rs
Normal file
18
src/librustpkg/testsuite/pass/deeply/nested/path/foo/main.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.
|
||||
|
||||
/*
|
||||
The test runner should check that, after `rustpkg install deeply/nested/path/foo`:
|
||||
with RUST_PATH undefined in the environment:
|
||||
* ./deeply/nested/path/foo exists and is an executable
|
||||
*/
|
||||
|
||||
fn main() {}
|
||||
|
21
src/librustpkg/testsuite/pass/external-crate/main.rs
Normal file
21
src/librustpkg/testsuite/pass/external-crate/main.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// 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.
|
||||
|
||||
/*
|
||||
The test runner should check that, after `rustpkg install external crate`
|
||||
with RUST_PATH undefined in the environment
|
||||
and with `rustpkg install deeply/nested/path/foo` already
|
||||
executed:
|
||||
* ./.rust/external_crate exists and is an executable
|
||||
*/
|
||||
|
||||
extern mod foo; // refers to deeply/nested/path/foo
|
||||
|
||||
fn main() {}
|
7
src/librustpkg/testsuite/pass/install-paths/bench.rs
Normal file
7
src/librustpkg/testsuite/pass/install-paths/bench.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[bench]
|
||||
fn g() {
|
||||
let mut x = 0;
|
||||
while(x < 1000) {
|
||||
x += 1;
|
||||
}
|
||||
}
|
11
src/librustpkg/testsuite/pass/install-paths/lib.rs
Normal file
11
src/librustpkg/testsuite/pass/install-paths/lib.rs
Normal file
@ -0,0 +1,11 @@
|
||||
// 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.
|
||||
|
||||
fn f() -> int { 42 }
|
22
src/librustpkg/testsuite/pass/install-paths/main.rs
Normal file
22
src/librustpkg/testsuite/pass/install-paths/main.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// 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.
|
||||
|
||||
/*
|
||||
The test runner should check that, after `rustpkg install install-paths`
|
||||
with RUST_PATH undefined in the environment:
|
||||
* ./.rust/install_paths exists and is an executable
|
||||
* ./.rust/libinstall_paths exists and is a library
|
||||
* ./.rust/install_pathstest does not exist
|
||||
* ./.rust/install_pathsbench does not exist
|
||||
* install-paths/build/install_pathstest exists and is an executable
|
||||
* install-paths/build/install_pathsbench exists and is an executable
|
||||
*/
|
||||
|
||||
fn main() {}
|
14
src/librustpkg/testsuite/pass/install-paths/test.rs
Normal file
14
src/librustpkg/testsuite/pass/install-paths/test.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// 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.
|
||||
|
||||
#[test]
|
||||
fn test_two_plus_two() {
|
||||
assert!(2 + 2 == 4);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user