about summary refs log tree commit diff
path: root/library/test/src/console.rs
AgeCommit message (Collapse)AuthorLines
2025-08-04Add new `test::print_merged_doctests_times` used by rustdoc to display more ↵Guillaume Gomez-11/+15
detailed time information and add new `OutputFormatter::write_merged_doctests_times` method to handle it
2025-02-09fix(libtest): Enable Instant on Emscripten targetsAlisa Sireneva-2/+3
`Instant::now()` works correctly on Emscripten since https://github.com/rust-lang/libc/pull/3962. All wasm-family targets with OS support can now handle instants.
2025-01-20test: add `#![warn(unreachable_pub)]`Urgau-9/+9
2024-07-29Reformat `use` declarations.Nicholas Nethercote-12/+12
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-04-15libtest: also measure time in MiriRalf Jung-4/+2
2024-03-12Remove unused fields in some structuresArthur Carcano-8/+1
The dead_code lint was previously eroneously missing those. Since this lint bug has been fixed, the unused fields need to be removed.
2024-03-11libtest: Print timing information on WASIAlex Crichton-3/+4
This commit updates the libtest conditionals to use `std::time::Instant` on WASI targets where it's implemented. Previously all wasm targets wouldn't use this type.
2024-01-22rustc: implement support for `riscv32im_risc0_zkvm_elf`Erik Kaneda-1/+2
This also adds changes in the rust test suite in order to get a few of them to pass. Co-authored-by: Frank Laub <flaub@risc0.com> Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
2023-05-26add StaticBenchAsTestFn and DynBenchAsTestFn to convert benches to testsPietro Albini-1/+1
Before this commit, both static and dynamic benches were converted to a DynTestFn, with a boxed closure that ran the benchmarks exactly once. While this worked, it conflicted with -Z panic-abort-tests as the flag does not support dynamic tests. With this change, a StaticBenchFn is converted to a StaticBenchAsTestFn, avoiding any dynamic test creation. DynBenchFn is also converted to DynBenchAsTestFn for completeness.
2023-03-15Implementing "<test_binary> --list --format json" #107307 #49359Partha P. Das-26/+57
2023-01-22Print why a test was ignored if it's the only test specified.Lenko Donchev-1/+6
2023-01-03Fix a few clippy lints in libtestJoshua Nelson-3/+3
- Remove unnecessary references and dereferences - Use `.contains` instead of `a <= x && x <= b` - Use `mem::take` instead of `mem::replace` where possible
2022-12-01Create a hacky fail-fast mode that stops tests at the first failureOli Scherer-1/+1
2022-10-27Do fewer passes and generally be more efficient when filtering testsBen Kimock-3/+3
2022-09-01Sort tests at compile time, not at startupBen Kimock-1/+1
Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately.
2022-07-22Lock stdout once when listing testsBen Kimock-1/+1
2022-04-05trivial cfg(bootstrap) changesPietro Albini-9/+1
2022-03-11Show ignore message in console and json outputAntonio Yang-1/+1
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-8/+8
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-24Include ignore message in libtest outputAntonio Yang-2/+17
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-01-28remove allow_fail test flagyuhaixin.hx-5/+1
2021-11-10Update more rustc/libtest things for wasm64Alex Crichton-1/+1
* 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-09-29Implement #85440Samuel E. Moelius III-2/+2
2021-07-18Fix compilation errors.Charles Lew-1/+1
2021-04-25feat(libtest): Add JUnit formatterAndrey Cherkashin-1/+2
2020-11-27libtest: Print the total time taken to execute a test suiteJakob Schikowski-1/+11
2020-07-27mv std libs to library/mark-0/+293