summary refs log tree commit diff
path: root/src/libtest
AgeCommit message (Collapse)AuthorLines
2015-09-08Reverted for-loop, it messes up type inferencellogiq-1/+2
2015-09-08fixes/improvements thanks to @ManishearthAndre Bogus-1/+0
2015-09-08some more clippy-based improvementsAndre Bogus-17/+17
2015-08-17test: Don't panic if some tests failedAlex Crichton-1/+1
This commit removes the call to `panic!("Some tests failed")` at the end of all tests run when running with libtest. The panic is replaced with `std::process::exit` to have a nonzero error code, but this change both: 1. Makes the test runner no longer print out the extraneous panic message at the end of a failing test run that some tests failed. (this is already summarized in the output of the test run). 2. When running tests with `RUST_BACKTRACE` set it removes an extraneous backtrace from the output (only failing tests will have their backtraces in the output.
2015-08-15Add issue for the rustc_private feature everywhereAlex Crichton-1/+1
2015-08-11rollup merge of #27622: eefriedman/https-urlAlex Crichton-2/+2
Also fixes a few outdated links.
2015-08-10Stabilize the Duration APISteven Fackler-2/+1
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation.
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-2/+2
Also fixes a few outdated links.
2015-08-04syntax: Don't assume `std` exists for testsAlex Crichton-9/+10
This commit removes the injection of `std::env::args()` from `--test` expanded code, relying on the test runner itself to call this funciton. This is more hygienic because we can't assume that `std` exists at the top layer all the time, and it meaks the injected test module entirely self contained.
2015-07-27std: Remove msvc/valgrind headersAlex Crichton-8/+1
These aren't really used for anything any more, so there doesn't seem to be much reason to leave them around in the `rt` directory. There was some limiting of threads spawned or tests when run under valgrind, but very little is run under valgrind nowadays so there's also no real use keeping these around.
2015-07-12Auto merge of #26957 - wesleywiser:rename_connect_to_join, r=alexcrichtonbors-1/+1
Fixes #26900
2015-07-12Implement RFC 1058Simonas Kazlauskas-2/+1
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-07-02windows: Don't link rust_builtinAlex Crichton-3/+17
This library has no shims which are actually needed on Windows now, so translate that last easy one into Rust and then don't link it at all on Windows.
2015-06-18Auto merge of #26192 - alexcrichton:features-clean, r=aturonbors-11/+10
This commit shards the all-encompassing `core`, `std_misc`, `collections`, and `alloc` features into finer-grained components that are much more easily opted into and tracked. This reflects the effort to push forward current unstable APIs to either stabilization or removal. Keeping track of unstable features on a much more fine-grained basis will enable the library subteam to quickly analyze a feature and help prioritize internally about what APIs should be stabilized. A few assorted APIs were deprecated along the way, but otherwise this change is just changing the feature name associated with each API. Soon we will have a dashboard for keeping track of all the unstable APIs in the standard library, and I'll also start making issues for each unstable API after performing a first-pass for stabilization.
2015-06-18Auto merge of #26340 - bluss:bench-sigfix, r=alexcrichtonbors-4/+4
test: Fix a bug in bench result formatting It would skip the middle part if it was 0, displaying a number a 1000 times too small. The MB/s number next to it gave it away. Fixed it looks like this: ``` test h ... bench: 1,000,129 ns/iter (+/- 4,730) ```
2015-06-17More test fixes and fallout of stability changesAlex Crichton-5/+2
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+2
2015-06-17collections: Split the `collections` featureAlex Crichton-1/+1
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-17alloc: Split apart the global `alloc` featureAlex Crichton-5/+6
2015-06-16test: Fix a bug in bench result formattingUlrik Sverdrup-4/+4
It would skip the middle part if it was 0, displaying a number a 1000 times too small. The MB/s number next to it gave it away. Fixed it looks like this: ``` test h ... bench: 1,000,129 ns/iter (+/- 4,730) ```
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-06-09Auto merge of #26068 - bluss:bench-sigfigs, r=huonwbors-8/+35
test: Display benchmark results with thousands separators Example display: ``` running 9 tests test a ... bench: 0 ns/iter (+/- 0) test b ... bench: 52 ns/iter (+/- 0) test c ... bench: 88 ns/iter (+/- 0) test d ... bench: 618 ns/iter (+/- 111) test e ... bench: 5,933 ns/iter (+/- 87) test f ... bench: 59,280 ns/iter (+/- 1,052) test g ... bench: 588,672 ns/iter (+/- 3,381) test h ... bench: 5,894,227 ns/iter (+/- 303,489) test i ... bench: 59,112,382 ns/iter (+/- 1,500,110) ``` Fixes #10953 Fixes #26109
2015-06-09test: Display benchmark results with thousands separatorsUlrik Sverdrup-8/+35
Example display: ``` running 9 tests test a ... bench: 0 ns/iter (+/- 0) test b ... bench: 52 ns/iter (+/- 0) test c ... bench: 88 ns/iter (+/- 0) test d ... bench: 618 ns/iter (+/- 111) test e ... bench: 5,933 ns/iter (+/- 87) test f ... bench: 59,280 ns/iter (+/- 1,052) test g ... bench: 588,672 ns/iter (+/- 3,381) test h ... bench: 5,894,227 ns/iter (+/- 303,489) test i ... bench: 59,112,382 ns/iter (+/- 1,500,110) ``` Fixes #10953 Fixes #26109
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-1/+1
2015-05-26Enable colored test output when capturing output of testsJohannes Oertel-1/+1
The output of individual tests can be captured now so it's safe to use colorized output even when running tests in parallel. Closes #782.
2015-05-15libs: Move favicon URLs to HTTPSAlex Crichton-1/+1
Helps prevent mixed content warnings if accessing docs over HTTPS. Closes #25459
2015-05-14Auto merge of #24920 - alexcrichton:duration, r=aturonbors-6/+8
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes #24874
2015-05-13std: Redesign Duration, implementing RFC 1040Alex Crichton-6/+8
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes #24874
2015-05-11Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnikbors-2/+2
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-03Update old uses of ~ in comments and debugging statementsCarol Nichols-2/+2
2015-05-02Run benchmarks once, as a test by default.Huon Wilson-14/+45
E.g. if `foo.rs` looks like #![feature(test)] extern crate test; #[bench] fn bar(b: &mut test::Bencher) { b.iter(|| { 1 }) } #[test] fn baz() {} #[bench] fn qux(b: &mut test::Bencher) { b.iter(|| { panic!() }) } Then $ rustc --test foo.rs $ ./foo running 3 tests test baz ... ok test qux ... FAILED test bar ... ok failures: ---- qux stdout ---- thread 'qux' panicked at 'explicit panic', bench.rs:17 failures: qux test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured $ ./foo --bench ba running 2 tests test baz ... ignored test bar ... bench: 97 ns/iter (+/- 74) test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured In particular, the two benchmark are being run as tests in the default mode. This helps for the main distribution, since benchmarks are only run with `PLEASE_BENCH=1`, which is rarely set (and never set on the test bots), and helps for code-coverage tools: benchmarks are run and so don't count as dead code. Fixes #15842.
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-79/+76
Conflicts: src/libcore/result.rs
2015-04-21std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-2/+1
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types.
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-77/+75
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21Remove references to `old_{path,io}`Tamir Duberstein-1/+0
2015-04-18Auto merge of #23985 - erickt:derive-cleanup, r=ericktbors-7/+2
This extracts some of the minor cleanup patches from #23905.
2015-04-15test: PadOnLeft was never usedErick Tryzelaar-7/+2
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-7/+7
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14test: Fixup many library unit testsAlex Crichton-3/+3
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-1/+1
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-2/+2
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01Remove TODONiko Matsakis-1/+1
2015-04-01Remove `Thunk` struct and `Invoke` trait; change `Thunk` to be an aliasNiko Matsakis-14/+15
for `Box<FnBox()>`. I found the alias was still handy because it is shorter than the fully written type. This is a [breaking-change]: convert code using `Invoke` to use `FnBox`, which is usually pretty straight-forward. Code using thunk mostly works if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to `foo(arg)`.
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-2/+2
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-2/+2
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31rollup merge of #23875: aturon/revise-convert-2Alex Crichton-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change] r? @alexcrichton
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-2/+2
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-31Stabilize `std::convert` and related codeAaron Turon-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]