summary refs log tree commit diff
path: root/library/test/src
AgeCommit message (Collapse)AuthorLines
2022-09-11Fix naming format of IEEE 754 standardLingMan-1/+1
Currently the documentation of f64::min refers to "IEEE-754 2008" while the documentation of f64::minimum refers to "IEEE 754-2019". Note that one has the format IEEE,hyphen,number,space,year while the other is IEEE,space,number,hyphen,year. The official IEEE site [1] uses the later format and it is also the one most commonly used throughout the codebase. Update all comments and - more importantly - documentation to consistently use the official format. [1] https://standards.ieee.org/ieee/754/4211/
2022-08-07test: skip terminfo parsing in MiriRalf Jung-0/+20
2022-07-22Lock stdout once when listing testsBen Kimock-1/+1
2022-07-09Fix binary name in help message for test binariesSmitty-1/+2
2022-06-03Fully stabilize NLLJack Huey-1/+0
2022-04-07Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrumbors-51/+12
Bump bootstrap compiler to 1.61.0 beta This PR bumps the bootstrap compiler to the 1.61.0 beta. The first commit changes the stage0 compiler, the second commit applies the "mechanical" changes and the third and fourth commits apply changes explained in the relevant comments. r? `@Mark-Simulacrum`
2022-04-07Rollup merge of #95709 - nnethercote:improve-terse-test-output, r=Dylan-DPCDylan DPC-3/+4
Improve terse test output. The current terse output gives 112 chars per line, which causes wraparound for people using 100 char wide terminals, which is very common. This commit changes it to be exactly 100 wide, which makes the output look much nicer.
2022-04-06Improve terse test output.Nicholas Nethercote-3/+4
The current terse output gives 112 chars per line, which causes wraparound for people using 100 char wide terminals, which is very common. This commit changes it to be exactly 100 wide, which makes the output look much nicer.
2022-04-05trivial cfg(bootstrap) changesPietro Albini-51/+12
2022-04-04Stabilize total_cmpPyry Kontio-1/+0
2022-03-29Rollup merge of #93840 - ↵Dylan DPC-2/+1
yaahc:termination-stabilization-celebration-station, r=joshtriplett Stabilize Termination and ExitCode From https://github.com/rust-lang/rust/issues/43301 This PR stabilizes the Termination trait and associated ExitCode type. It also adjusts the ExitCode feature flag to replace the placeholder flag with a more permanent name, as well as splitting off the `to_i32` method behind its own permanently unstable feature flag. This PR stabilizes the termination trait with the following signature: ```rust pub trait Termination { fn report(self) -> ExitCode; } ``` The existing impls of `Termination` are effectively already stable due to the prior stabilization of `?` in main. This PR also stabilizes the following APIs on exit code ```rust #[derive(Clone, Copy, Debug)] pub struct ExitCode(_); impl ExitCode { pub const SUCCESS: ExitCode; pub const FAILURE: ExitCode; } impl From<u8> for ExitCode { /* ... */ } ``` --- All of the previous blockers have been resolved. The main ones that were resolved recently are: * The trait's name: We decided against changing this since none of the alternatives seemed particularly compelling. Instead we decided to end the bikeshedding and stick with the current name. ([link to the discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Termination.2FExit.20Status.20Stabilization/near/269793887)) * Issues around platform specific representations: We resolved this issue by changing the return type of `report` from `i32` to the opaque type `ExitCode`. That way we can change the underlying representation without affecting the API, letting us offer full support for platform specific exit code APIs in the future. * Custom exit codes: We resolved this by adding `From<u8> for ExitCode`. We choose to only support u8 initially because it is the least common denominator between the sets of exit codes supported by our current platforms. In the future we anticipate adding platform specific extension traits to ExitCode for constructors from larger or negative numbers, as needed.
2022-03-29Remove unnecessary .as_ref().Mara Bos-1/+1
2022-03-29Refactor after reviewAntonio Yang-22/+14
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2022-03-11Show ignore message in console and json outputAntonio Yang-6/+36
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-40/+40
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-02-25Switch bootstrap cfgsMark Rousskov-40/+0
2022-02-24Include ignore message in libtest outputAntonio Yang-2/+57
As an example: #[test] #[ignore = "not yet implemented"] fn test_ignored() { ... } Will now render as: running 2 tests test tests::test_ignored ... ignored, not yet implemented test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
2022-02-22Stabilize Termination and ExitCodeJane Lusby-2/+1
2022-02-17Rollup merge of #93479 - smoelius:master, r=yaahcMatthias Krüger-16/+6
Use `optflag` for `--report-time` Essentially, what is described here: https://github.com/rust-lang/rust/issues/64888#issuecomment-1008047228 There is one difference. The comment proposes to add a `--report-time-color` option. This change instead uses libtest's existing `--color` option for that purpose.
2022-02-07Rollup merge of #93416 - name1e5s:chore/remove_allow_fail, r=m-ou-seMara Bos-93/+55
remove `allow_fail` test flag close #93345
2022-02-03Rollup merge of #93600 - last-partizan:fix-junit-formatter, r=yaahcYuki Okushi-2/+1
fix: Remove extra newlines from junit output This PR fixes extra newline in junit output https://github.com/rust-lang/rust/issues/93454
2022-02-02fix: Remove extra newlines from junit outputSerg Tereshchenko-2/+1
2022-01-30Use `optflag` for `--report-time`Samuel E. Moelius III-16/+6
Essentially, what is described here: https://github.com/rust-lang/rust/issues/64888#issuecomment-1008047228 There is one difference. The comment proposes to add a `--report-time-color` option. This change instead uses libtest's existing `--color` option for that purpose.
2022-01-28Change Termination::report return type to ExitCodeJane Lusby-1/+2
2022-01-28add allow_fail field in TestDesc to pass checkyuhaixin.hx-0/+40
2022-01-28remove allow_fail test flagyuhaixin.hx-93/+15
2022-01-09eplace usages of vec![].into_iter with [].into_iterLucas Kent-1/+1
2022-01-07Stabilize `#[feature(available_parallelism)]`Yoshua Wuyts-1/+0
2021-12-29Remove unused allow deprecatedbjorn3-1/+0
2021-12-29Remove unused feature gates from libtestbjorn3-3/+0
2021-12-29Remove #![crate_name] attribute from libtestbjorn3-5/+0
The crate name is already set in Cargo.toml. The comment says there is some logic in the compiler that reads #![crate_name] and not --crate-name, but I can't find it. Removing it seems to work fine.
2021-12-29Replace TDynBenchFn with Fn(&mut Bencher)bjorn3-12/+5
2021-11-10Update more rustc/libtest things for wasm64Alex Crichton-3/+3
* Add wasm64 variants for inline assembly along the same lines as wasm32 * Update a few directives in libtest to check for `target_family` instead of `target_arch` * Update some rustc codegen and typechecks specialized for wasm32 to also work for wasm64.
2021-11-04clippy::perf fixesMatthias Krüger-2/+2
2021-10-07Rollup merge of #89082 - smoelius:master, r=kennytmJubilee-39/+276
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-10-06Rollup merge of #89324 - yoshuawuyts:hardware-parallelism, r=m-ou-seManish Goregaokar-2/+2
Rename `std::thread::available_conccurrency` to `std::thread::available_parallelism` _Tracking issue: https://github.com/rust-lang/rust/issues/74479_ This PR renames `std::thread::available_conccurrency` to `std::thread::available_parallelism`. ## Rationale The API was initially named `std::thread::hardware_concurrency`, mirroring the [C++ API of the same name](https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency). We eventually decided to omit any reference to the word "hardware" after [this comment](https://github.com/rust-lang/rust/pull/74480#issuecomment-662045841). And so we ended up with `available_concurrency` instead. --- For a talk I was preparing this week I was reading through ["Understanding and expressing scalable concurrency" (A. Turon, 2013)](http://aturon.github.io/academic/turon-thesis.pdf), and the following passage stood out to me (emphasis mine): > __Concurrency is a system-structuring mechanism.__ An interactive system that deals with disparate asynchronous events is naturally structured by division into concurrent threads with disparate responsibilities. Doing so creates a better fit between problem and solution, and can also decrease the average latency of the system by preventing long-running computations from obstructing quicker ones. > __Parallelism is a resource.__ A given machine provides a certain capacity for parallelism, i.e., a bound on the number of computations it can perform simultaneously. The goal is to maximize throughput by intelligently using this resource. For interactive systems, parallelism can decrease latency as well. _Chapter 2.1: Concurrency is not Parallelism. Page 30._ --- _"Concurrency is a system-structuring mechanism. Parallelism is a resource."_ — It feels like this accurately captures the way we should be thinking about these APIs. What this API returns is not "the amount of concurrency available to the program" which is a property of the program, and thus even with just a single thread is effectively unbounded. But instead it returns "the amount of _parallelism_ available to the program", which is a resource hard-constrained by the machine's capacity (and can be further restricted by e.g. operating systems). That's why I'd like to propose we rename this API from `available_concurrency` to `available_parallelism`. This still meets the criteria we previously established of not attempting to define what exactly we mean by "hardware", "threads", and other such words. Instead we only talk about "concurrency" as an abstract resource available to our program. r? `@joshtriplett`
2021-09-30Check `allow_unstable` before checking environment variablesSamuel E. Moelius III-2/+2
2021-09-29Add testsSamuel E. Moelius III-25/+92
2021-09-29Implement #85440Samuel E. Moelius III-14/+184
2021-09-28Rename `std::thread::available_onccurrency` to ↵Yoshua Wuyts-2/+2
`std::thread::available_parallelism`
2021-09-27Apply suggestions from code reviewJane Lusby-2/+2
Co-authored-by: kennytm <kennytm@gmail.com>
2021-09-24make junit output more consistent with default formatJane Lusby-1/+4
2021-09-11don't clone types that are Copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-0/+1
2021-07-18Remove unused stuff and switch to pub(crate) whenever possible.Charles Lew-299/+58
2021-07-18Fix compilation errors.Charles Lew-30/+13
2021-07-18Move `library/term/src` to `library/test/src/term/`.Charles Lew-0/+1788
2021-06-28Update to new bootstrap compilerMark Rousskov-46/+0
2021-06-23Use HTTPS links where possibleSmitty-1/+1
2021-06-17Use as_secs_f64 in JunitFormatterDeadbeef-4/+4