rustpkg: Add more tests

These are examples of what *should* work, and probably don't
work yet.
This commit is contained in:
Tim Chevalier 2013-04-17 19:00:52 -07:00
parent 958189dba1
commit 128e95b89d
6 changed files with 93 additions and 0 deletions

View 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() {}

View 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() {}

View File

@ -0,0 +1,7 @@
#[bench]
fn g() {
let mut x = 0;
while(x < 1000) {
x += 1;
}
}

View 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 }

View 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() {}

View 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);
}