about summary refs log tree commit diff
path: root/src/compiletest/compiletest.rs
AgeCommit message (Collapse)AuthorLines
2015-01-02std: Stabilize the prelude moduleAlex Crichton-2/+2
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-21Fallout of std::str stabilizationAlex Crichton-4/+2
2014-12-17rollup merge of #19818: emk/regex_at_name_optAlex Crichton-2/+2
Hello! This is my first Rust patch, and I fear that I've probably skipped at least 7 critical steps. I'd appreciate your feedback and advice about how to contribute to Rust. This patch is based on a discussion with @BurntSushi in #14602 a while back. I'm happy to revise it as needed to fit into the modern world. :-) As discussed in that issue, the existing `at` and `name` functions represent two different results with the empty string: 1. Matched the empty string. 2. Did not match anything. Consider the following example. This regex has two named matched groups, `key` and `value`. `value` is optional: ```rust // Matches "foo", "foo;v=bar" and "foo;v=". regex!(r"(?P<key>[a-z]+)(;v=(?P<value>[a-z]*))?"); ``` We can access `value` using `caps.name("value")`, but there's no way for us to distinguish between the `"foo"` and `"foo;v="` cases. Early this year, @BurntSushi recommended modifying the existing `at` and `name` functions to return `Option`, instead of adding new functions to the API. This is a [breaking-change], but the fix is easy: - `refs.at(1)` becomes `refs.at(1).unwrap_or("")`. - `refs.name(name)` becomes `refs.name(name).unwrap_or("")`.
2014-12-14Modify `regex::Captures::{at,name}` to return `Option`Eric Kidd-2/+2
Closes #14602. As discussed in that issue, the existing `at` and `name` functions represent two different results with the empty string: 1. Matched the empty string. 2. Did not match anything. Consider the following example. This regex has two named matched groups, `key` and `value`. `value` is optional: ```rust // Matches "foo", "foo;v=bar" and "foo;v=". regex!(r"(?P<key>[a-z]+)(;v=(?P<value>[a-z]*))?"); ``` We can access `value` using `caps.name("value")`, but there's no way for us to distinguish between the `"foo"` and `"foo;v="` cases. Early this year, @BurntSushi recommended modifying the existing `at` and `name` functions to return `Option`, instead of adding new functions to the API. This is a [breaking-change], but the fix is easy: - `refs.at(1)` becomes `refs.at(1).unwrap_or("")`. - `refs.name(name)` becomes `refs.name(name).unwrap_or("")`.
2014-12-14Mostly rote conversion of `proc()` to `move||` (and occasionally `Thunk::new`)Niko Matsakis-4/+5
2014-12-06Allow message specification for should_failSteven Fackler-1/+1
The test harness will make sure that the panic message contains the specified string. This is useful to help make `#[should_fail]` tests a bit less brittle by decreasing the chance that the test isn't "accidentally" passing due to a panic occurring earlier than expected. The behavior is in some ways similar to JUnit's `expected` feature: `@Test(expected=NullPointerException.class)`. Without the message assertion, this test would pass even though it's not actually reaching the intended part of the code: ```rust #[test] #[should_fail(message = "out of bounds")] fn test_oob_array_access() { let idx: uint = from_str("13o").unwrap(); // oops, this will panic [1i32, 2, 3][idx]; } ```
2014-12-05test: expose boxplot and the extra stats test keeps track ofErick Tryzelaar-0/+3
[breaking-change]
2014-11-17Switch to purely namespaced enumsSteven Fackler-1/+1
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-16Move FromStr to core::strBrendan Zabarauskas-1/+1
2014-10-29Rename fail! to panic!Steve Klabnik-6/+6
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-26debuginfo: Set RUST_TEST_TASKS to 1 again for LLDB testsMichael Woerister-1/+11
2014-10-23Error if we should be able to Valgrind but can'tNick Cameron-2/+9
2014-10-23Add run-pass-valgrind testsNick Cameron-1/+3
Closes #16914
2014-10-22debuginfo: Let LLDB tests run in parallel again since our min-supported ↵Michael Woerister-11/+1
version has no problems with that.
2014-10-08debuginfo: Add LLDB version handling to test infrastructure.Michael Woerister-1/+37
2014-10-07Put slicing syntax behind a feature gate.Nick Cameron-1/+1
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02Revert "Put slicing syntax behind a feature gate."Aaron Turon-1/+1
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2014-10-02Put slicing syntax behind a feature gate.Nick Cameron-1/+1
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-01Remove all use of librustuvAaron Turon-10/+0
2014-09-16Fallout from renamingAaron Turon-2/+2
2014-08-27debuginfo: Improve GDB version handling in compiletest toolMichael Woerister-5/+11
2014-08-27debuginfo: Emit different autotest debugger scripts depending on GDB version.Michael Woerister-0/+19
2014-07-17deprecate Vec::getNick Cameron-3/+3
2014-07-16debuginfo: Make sure that only one LLDB test task is run at a time.Michael Woerister-1/+11
Some older versions of LLDB have problems with multiple instances running in parallel. This commit makes sure we don't do that.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1/+1
[breaking-change]
2014-06-28Rename all raw pointers as necessaryAlex Crichton-1/+1
2014-06-25compiletest: Remove superfluous to_string callsPiotr Jawniak-29/+16
2014-06-14Register new snapshotsAlex Crichton-8/+1
2014-06-14getopts: format failure messages with `Show`.Huon Wilson-1/+1
This obsoletes the old `to_err_msg` method. Replace println!("Error: {}", failure.to_err_msg()) let string = failure.to_err_msg(); with println!("Error: {}", failure) let string = failure.to_str(); [breaking-change]
2014-06-09Add a --color flag to test binariesSteven Fackler-0/+1
It uses the same behavior as rustc's.
2014-06-09Use phase(plugin) in bootstrap cratesKeegan McAllister-2/+8
Do this to avoid warnings on post-stage0 builds.
2014-05-28std: Remove format_strbuf!()Alex Crichton-36/+34
This was only ever a transitionary macro.
2014-05-27std: Rename strbuf operations to stringRicho Healey-21/+21
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-3/+3
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-4/+4
[breaking-change]
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-2/+6
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-2/+2
2014-05-20compiletest: Refactor compile-fail to regex.Kevin Butler-1/+3
2014-05-16libgetopts: Remove all uses of `~str` from `libgetopts`Patrick Walton-7/+6
2014-05-16compiletest: Remove all uses of `~str` from `compiletest`Patrick Walton-56/+84
2014-05-15test: allow the test filter to be a regex.Huon Wilson-8/+18
This is fully backwards compatible, since test names are Rust identifiers + `:`, and hence not special regex characters. Fixes #2866.
2014-05-14libtest: Remove all uses of `~str` from `libtest`.Patrick Walton-3/+9
2014-05-14Get rid of the android-cross-path flag to rustc.Luqman Aden-0/+3
There's no need to include this specific flag just for android. We can already deal with what it tries to solve by using -C linker=/path/to/cc and -C ar=/path/to/ar. The Makefiles for rustc already set this up when we're crosscompiling. I did add the flag to compiletest though so it can find gdb. Though, I'm pretty sure we don't run debuginfo tests on android anyways right now. [breaking-change]
2014-05-13Touch up and rebase previous commitsAlex Crichton-2/+2
* Added `// no-pretty-expanded` to pretty-print a test, but not run it through the `expanded` variant. * Removed #[deriving] and other expanded attributes after they are expanded * Removed hacks around &str and &&str and friends (from both the parser and the pretty printer). * Un-ignored a bunch of tests
2014-05-13compiletest: Modernize typenamesklutzy-49/+22
2014-05-07debuginfo: Split debuginfo autotests into debuginfo-gdb and debuginfo-lldbMichael Woerister-17/+15
2014-04-24test: Add an option to not capture outputAlex Crichton-1/+2
A new flag to the test runner, --nocapture, can be passed to instruct that the output of tests should not be captured by default. The behavior can also be triggered via a RUST_TEST_NOCAPTURE environment variable being set. Closes #13374
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-13/+13
2014-04-02Avoid injecting unfulfilled dependence in compiletest on libnative.Felix S. Klock II-0/+3
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-4/+4
Closes #2569