about summary refs log tree commit diff
path: root/src/libtest/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-644/+0
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-1/+0
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-05Don't always eval arguments inside .expect(), use unwrap_or_else and ↵Matthias Krüger-1/+1
closure. (clippy::expect_fun_call)
2020-03-05Const items have by default a static lifetime, there's no need to annotate ↵Matthias Krüger-1/+1
it. (clippy::redundant_static_lifetimes)
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-06Respect --nocapture in panic=abort test modeTyler Mandry-9/+17
2020-01-17Rollup merge of #68301 - tmandry:dont-propagate-test-invoke, r=alexcrichtonDylan DPC-1/+2
Don't propagate __RUST_TEST_INVOKE to subprocess When -Z panic_abort_tests is enabled, we use an environment variable to tell the subprocess which test to invoke. If that subprocess then invokes another Rust test binary, chaos ensues. r? @alexcrichton
2020-01-16Don't propagate __RUST_TEST_INVOKE to subprocessTyler Mandry-1/+2
When -Z panic_abort_tests is enabled, we use an environment variable to tell the subprocess which test to invoke. If that subprocess then invokes another Rust test binary, chaos ensues.
2020-01-16don't clone types that are copyMatthias Krüger-3/+1
found via clippy
2020-01-15remove redundant clones, found by clippyMatthias Krüger-2/+2
2019-12-22Format the worldMark Rousskov-82/+53
2019-12-06Use `Instant::now` lazilyvarkor-2/+2
2019-12-06Rename to `then_some` and `then`varkor-2/+2
2019-12-06Use `to_option` in various placesvarkor-10/+3
2019-11-15Add --force-run-in-process unstable libtest optionTyler Mandry-1/+1
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-2/+2
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-23Public some types for compiletest_rsLzu Tao-3/+4
2019-10-18Add public re-exports for benchesIgor Aleksanov-1/+2
2019-10-17Improve code styleIgor Aleksanov-4/+8
2019-10-17Make enum usage explicit and fix testsIgor Aleksanov-94/+90
2019-10-17Extract ConsoleTestStateIgor Aleksanov-282/+6
2019-10-17Split libtest into several smaller modulesIgor Aleksanov-1375/+42
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-3/+3
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-12Auto merge of #64873 - popzxc:prettify-test-time, r=wesleywiserbors-60/+378
Enhance report-time option ## Short overview This PR is a follow-up to a previously closed #64714 PR. ## Changes introduced by this PR * `libtest` now retrieves the type of the test within `TestDesc` (available types are: `UnitTest`, `IntegrationTest`, `DocTest`, `Unknown`). * `--report-time` subcommand of the `libtest` now supports colored output (disabled by default). * Colorized output depends on the threshold values. Default values (proposed by @wesleywiser): - For unit-tests: 50ms warn/100ms critical, - For integration-tests: 500ms warn/1000ms critical, - For doctests: same as for integration tests, - For unknown tests: `TEST_WARN_TIMEOUT_S` warn/ `TEST_WARN_TIMEOUT_S * 2` critical (it will only applied single-threaded mode, because otherwise test will be interrupted after reaching `TEST_WARN_TIMEOUT_S`). - These values can be overrided by setting environment variables (since those thresholds are somewhat constant for every project, it's more flexible to use environment variables than command line arguments). * New optional flag `--ensure-test-time` for `libtest`. With this flag applied, exectuion time limit excesss will cause test failure. ## What have not been done There was a comment that it would be nice to have an entry in the Cargo book about it. However, changes introduced by this PR (and #64663 in which `report-time` flag was added) aren't related directly to `cargo`, it's more about `libtest` itself. I'm considering that [The Unstable Book](https://doc.rust-lang.org/unstable-book/) is more appropriate place, but not sure if I'm right (and if so, how exactly it should be described). As one possible option, this PR may be merged without denoting it in the documentation, and in the next PR adding support of this feature to the `cargo` itself, I'll add a note in the Cargo book. ## Scope of this PR Logical scope of this PR is `libtest` only. However, to get test types, I had to modify also `libsyntax_ext` and `librustdoc` for them to provide information about test type. ## Rationale Rationale for colored output was submitted in #64714 Providing the information about kind of test was also proposed in #64714, and as an additional benefit this information may be useful for the tools using `libtest` (e.g. `cargo`). Adding flag to treat time limits excess seems logical to me, so projects that do care about test execution time won't have to invent a wheel. ## Backward compatibility All the changes are completely backward compatible. ## Demo ![rustc_enhanced_time](https://user-images.githubusercontent.com/12111581/65818381-c04f6800-e219-11e9-9875-322463abe24f.gif) r? @wesleywiser
2019-10-09Follow the styling guideIgor Aleksanov-2/+10
2019-10-09Make interface of the feature more convenientIgor Aleksanov-5/+19
2019-10-09Resolve divergency with masterIgor Aleksanov-25/+53
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-3/+3
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Fix ABI, run and fix more tests, re-enable CI for PRsThomas Lively-3/+3
2019-10-02Remove rustdoc warningGuillaume Gomez-1/+1
2019-09-29libtest: encapsulate time-related logic and avoid unnecessary allocationsIgor Aleksanov-19/+39
2019-09-29Enhance report-time optionIgor Aleksanov-38/+286
2019-09-28Spawn one subprocess per unit test when panic=abortTyler Mandry-90/+274
2019-09-26Include message on tests that should panicKenny Goodin-0/+1
2019-09-22libtest: Make --report-time an unstable optionJakob Schikowski-1/+7
2019-09-21libtest: Add --report-time flag to print test execution timeJakob Schikowski-24/+77
2019-08-27Rollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbgMazdak Farrokhzad-6/+12
libtest: add --show-output flag to print stdout of successful tests This pull request adds a new flag `--show-output` for tests to show the output of successful tests. For most formatters this was already supported just not exposed via the CLI (apparently only used by `librustdoc`). I've also added support for this option in the JSON formatter. This kind of fixes https://github.com/rust-lang/rust/issues/54669 which wants `--format json` to work with `--nocapture`, which is... well, impossible. What this issue really calls for is `--show-output` as implemented here.
2019-08-21revert num_cpus changenewpavlov-1/+6
2019-08-21fix num_cpusArtyom Pavlov-7/+2
2019-08-21fix libtestArtyom Pavlov-2/+1
2019-08-02Remove some more `cfg(test)`sVadim Petrochenkov-22/+0
2019-08-02libtest: Unconfigure tests during normal buildVadim Petrochenkov-59/+15
2019-07-31Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]`Vadim Petrochenkov-1/+1
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-16Add supporting for vxWorksBaoshan Pang-0/+6
r? @alexcrichton
2019-07-12libtest: support display_output in JSON formatterPaul Emmerich-1/+1
2019-07-11libtest: add --show-output optionPaul Emmerich-5/+11
this new flag enables printing the captured stdout of successful tests utilizing the already existing display_output test runner option
2019-06-16Separate libtest modulechansuke-455/+1
2019-05-30Make "panic did not include expected string" message consistentvarkor-2/+2
Note messages are typically lowercase.
2019-05-24Use FnOnce instead of FnBox in libtestSimon Sapin-4/+2