diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-04-17 19:00:52 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-04-17 19:00:52 -0700 |
| commit | 128e95b89df851fdecec348a40c49feb61a7bee7 (patch) | |
| tree | d00d24dd91489e42422acfda893f7208701525cb | |
| parent | 958189dba10536bd3f41004c4806893ec5deadd9 (diff) | |
| download | rust-128e95b89df851fdecec348a40c49feb61a7bee7.tar.gz rust-128e95b89df851fdecec348a40c49feb61a7bee7.zip | |
rustpkg: Add more tests
These are examples of what *should* work, and probably don't work yet.
6 files changed, 93 insertions, 0 deletions
diff --git a/src/librustpkg/testsuite/pass/deeply/nested/path/foo/main.rs b/src/librustpkg/testsuite/pass/deeply/nested/path/foo/main.rs new file mode 100644 index 00000000000..41041ccb509 --- /dev/null +++ b/src/librustpkg/testsuite/pass/deeply/nested/path/foo/main.rs @@ -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() {} + diff --git a/src/librustpkg/testsuite/pass/external-crate/main.rs b/src/librustpkg/testsuite/pass/external-crate/main.rs new file mode 100644 index 00000000000..d094bcd6bba --- /dev/null +++ b/src/librustpkg/testsuite/pass/external-crate/main.rs @@ -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() {} diff --git a/src/librustpkg/testsuite/pass/install-paths/bench.rs b/src/librustpkg/testsuite/pass/install-paths/bench.rs new file mode 100644 index 00000000000..5aa6d2455cf --- /dev/null +++ b/src/librustpkg/testsuite/pass/install-paths/bench.rs @@ -0,0 +1,7 @@ +#[bench] +fn g() { + let mut x = 0; + while(x < 1000) { + x += 1; + } +} \ No newline at end of file diff --git a/src/librustpkg/testsuite/pass/install-paths/lib.rs b/src/librustpkg/testsuite/pass/install-paths/lib.rs new file mode 100644 index 00000000000..baf90446f7a --- /dev/null +++ b/src/librustpkg/testsuite/pass/install-paths/lib.rs @@ -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 } diff --git a/src/librustpkg/testsuite/pass/install-paths/main.rs b/src/librustpkg/testsuite/pass/install-paths/main.rs new file mode 100644 index 00000000000..37e606dcb1a --- /dev/null +++ b/src/librustpkg/testsuite/pass/install-paths/main.rs @@ -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() {} diff --git a/src/librustpkg/testsuite/pass/install-paths/test.rs b/src/librustpkg/testsuite/pass/install-paths/test.rs new file mode 100644 index 00000000000..acfae9e04fb --- /dev/null +++ b/src/librustpkg/testsuite/pass/install-paths/test.rs @@ -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); +} |
