about summary refs log tree commit diff
path: root/library/test/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2021-10-07Rollup merge of #89082 - smoelius:master, r=kennytmJubilee-2/+9
Implement #85440 (Random test ordering) This PR adds `--shuffle` and `--shuffle-seed` options to `libtest`. The options are similar to the [`-shuffle` option](https://github.com/golang/go/blob/c894b442d1e5e150ad33fa3ce13dbfab1c037b3a/src/testing/testing.go#L1482-L1499) that was recently added to Go. Here are the relevant parts of the help message: ``` --shuffle Run tests in random order --shuffle-seed SEED Run tests in random order; seed the random number generator with SEED ... By default, the tests are run in alphabetical order. Use --shuffle or set RUST_TEST_SHUFFLE to run the tests in random order. Pass the generated "shuffle seed" to --shuffle-seed (or set RUST_TEST_SHUFFLE_SEED) to run the tests in the same order again. Note that --shuffle and --shuffle-seed do not affect whether the tests are run in parallel. ``` Is an RFC needed for this?
2021-09-29Implement #85440Samuel E. Moelius III-2/+9
2021-09-28Rename `std::thread::available_onccurrency` to ↵Yoshua Wuyts-1/+1
`std::thread::available_parallelism`
2021-07-18Fix compilation errors.Charles Lew-1/+2
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-1/+1
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-05-14Expose `Concurrent` (private type in public i'face)Alan Egerton-1/+1
2021-04-25move core::hint::black_box under its own feature gateRalf Jung-0/+1
2021-03-24libtest: Index tests by a unique TestIdAnders Kaseorg-23/+34
This more robustly avoids problems with duplicate TestDesc. See #81852 and #82274. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-03-14Remove Option::{unwrap_none, expect_none}.Mara Bos-3/+3
2021-02-26Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-seGuillaume Gomez-1/+0
Stabilize str_split_once Closes #74773
2021-02-19Rollup merge of #82274 - andersk:test-unwrap, r=Mark-SimulacrumDylan DPC-6/+7
libtest: Fix unwrap panic on duplicate TestDesc It is possible for different tests to collide to the same `TestDesc` when macros are involved. That is a bug, but it didn’t cause a panic until #81367. For now, change the code to ignore this problem. Fixes #81852. This will need to be applied to `beta` too.
2021-02-18libtest: Fix unwrap panic on duplicate TestDesc.Anders Kaseorg-6/+7
It is possible for different tests to collide to the same TestDesc when macros are involved. That is a bug, but it didn’t cause a panic until #81367. For now, change the code to ignore this problem. Fixes #81852. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-02-18Rollup merge of #81546 - hyd-dev:libtest-run-out-of-threads, r=Mark-SimulacrumDylan DPC-1/+12
[libtest] Run the test synchronously when hitting thread limit libtest currently panics if it hits the thread limit. This often results in spurious test failures (<code>thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }'</code> ... `error: test failed, to rerun pass '--lib'`). This PR makes it continue to run the test synchronously if it runs out of threads. Closes #78165. ``@rustbot`` label: A-libtest T-libs
2021-02-17[libtest] Run the test synchronously when hitting thread limithyd-dev-1/+12
2021-02-09Stabilize str_split_onceJacob Pratt-1/+0
2021-02-08Rollup merge of #81356 - ehuss:libtest-filters, r=m-ou-seMara Bos-2/+2
libtest: allow multiple filters Libtest ignores any filters after the first. This changes it so that if multiple filters are passed, it will test against all of them. This also affects compiletest to do the same. Closes #30422
2021-01-25libtest: Store pending timeouts in a dequeAnders Kaseorg-18/+27
This reduces the total complexity of checking timeouts from quadratic to linear, and should also fix an unwrap of None on completion of an already timed-out test. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-01-24libtest: Wait for test threads to exit after they report completionAnders Kaseorg-14/+45
Otherwise we can miss bugs where a test reports that it succeeded but then panics within a TLS destructor. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-01-24libtest: allow multiple filtersEric Huss-2/+2
2020-12-07Dogfood 'str_split_once()` in the std libEric Arellano-0/+1
2020-11-26Fix new 'unnecessary trailing semicolon' warningsAaron Hill-2/+2
2020-11-23Auto merge of #78439 - lzutao:rm-clouldabi, r=Mark-Simulacrumbors-1/+1
Drop support for all cloudabi targets `cloudabi` is a tier-3 target, and [it is no longer being maintained upstream][no]. This PR drops supports for cloudabi targets. Those targets are: * aarch64-unknown-cloudabi * armv7-unknown-cloudabi * i686-unknown-cloudabi * x86_64-unknown-cloudabi Since this drops supports for a target, I'd like somebody to tag `relnotes` label to this PR. Some other issues: * The tidy exception for `cloudabi` crate is still remained because * `parking_lot v0.9.0` and `parking_lot v0.10.2` depends on `cloudabi v0.0.3`. * `parking_lot v0.11.0` depends on `cloudabi v0.1.0`. [no]: https://github.com/NuxiNL/cloudabi#note-this-project-is-unmaintained
2020-11-22Drop support for cloudabi targetsLzu Tao-1/+1
2020-11-22Stabilise `then`varkor-1/+0
2020-11-10Merge set_panic and set_print into set_output_capture.Mara Bos-10/+5
There were no use cases for setting them separately. Merging them simplifies some things.
2020-11-10Remove io::LocalOutput and use Arc<Mutex<dyn>> for local streams.Mara Bos-6/+2
2020-10-16Add std::thread::available_concurrencyYoshua Wuyts-0/+1
2020-10-01Fix some clippy issuesJoshua Nelson-5/+3
Found while working on https://github.com/rust-lang/rust/pull/77351; these are just the ones that could be fixed automatically.
2020-09-21Dogfood total_cmp in the test crateest31-0/+1
2020-08-07Prevent `__rust_begin_short_backtrace` frames from being tail-call optimised ↵Alan Egerton-1/+4
away
2020-07-27mv std libs to library/mark-0/+644