about summary refs log tree commit diff
path: root/src/libtest
AgeCommit message (Collapse)AuthorLines
2020-04-14Add illumos triplePatrick Mooney-0/+1
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-04-06Stop importing float module in libtestLinus Färnstrand-1/+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-23Request "-Z unstable-options" for unstable optionsJubilee-1/+1
Explicitly requests the "-Z unstable-options" flag if someone attempts to use a cargo option gated by it. This enhances discoverability, particularly in the instance where the user is on the nightly compiler but isn't using the flag.
2020-03-14Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPCYuki Okushi-14/+14
fix more clippy findings * reduce references on match patterns (clippy::match_ref_pats) * Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) * libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) * remove unneeded mutable references (cippy::unnecessary_mut_passed) * libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) * rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) * call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) * iterate over a maps values directly. (clippy::for_kv_map) * rustdoc: simplify boolean condition (clippy::nonminimal_bool) * Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) * rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) * rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)
2020-03-07reduce references on match patterns (clippy::match_ref_pats)Matthias Krüger-4/+4
2020-03-07Use writeln!(fmt, "word") instead of write!(fmt, "word\n") ↵Matthias Krüger-1/+1
(clippy::write_with_newline)
2020-03-07libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string)Matthias Krüger-1/+1
2020-03-07libtest: declare variables as floats instead of casting them ↵Matthias Krüger-8/+8
(clippy::unnecessary_cast)
2020-03-06fix various typosMatthias Krüger-3/+3
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-03-01Rollup merge of #69580 - matthiaskrgr:map_clone, r=CentrilYuki Okushi-1/+1
use .copied() instead of .map(|x| *x) on iterators
2020-02-29Make it build againVadim Petrochenkov-2/+2
2020-02-29use .copied() instead of .map(|x| *x) on iteratorsMatthias Krüger-1/+1
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-06Respect --nocapture in panic=abort test modeTyler Mandry-9/+17
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-3/+0
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
2020-01-10Clarify test timeout evironment variablesMikail Bagishov-0/+2
2019-12-22Format the worldMark Rousskov-390/+219
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-19Simplify if else as suggested in PR feedbackThomas Etter-20/+16
2019-11-18replace some asserts with assert_eq for better error readabilityThomas Etter-6/+6
2019-11-18print a more useful error message on should_panic mismatchThomas Etter-7/+50
2019-11-15Add --force-run-in-process unstable libtest optionTyler Mandry-1/+6
2019-11-06Replace `array.into_iter()` with `iter()` in `libtest/tests.rs`Lukas Kalbertodt-2/+2
2019-10-29Rollup merge of #65898 - hermitcore:rusty-hermit, r=kennytmTyler Mandry-1/+7
add basic HermitCore support within libtest This an extension to #65167. The current pull request extend libtest to support HermitCore as target OS.
2019-10-28removing trailing whitespacesStefan Lankes-1/+1
2019-10-28add basic HermitCore support within libtestStefan Lankes-1/+7
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-23Rollup merge of #64178 - mati865:clippy, r=scottmcmMazdak Farrokhzad-4/+4
More Clippy fixes for alloc, core and std Continuation of https://github.com/rust-lang/rust/pull/63805
2019-10-23Public some types for compiletest_rsLzu Tao-3/+4
2019-10-22Apply clippy::needless_return suggestionsMateusz Mikuła-4/+4
2019-10-21Remove unneccessary use under cfg(unix)Igor Aleksanov-12/+2
2019-10-18Add public re-exports for benchesIgor Aleksanov-2/+4
2019-10-17Improve code styleIgor Aleksanov-21/+41
2019-10-17Add more explaining comments to the codeIgor Aleksanov-68/+94
2019-10-17Split options parsing into several functionsIgor Aleksanov-123/+179
2019-10-17Make enum usage explicit and fix testsIgor Aleksanov-161/+289
2019-10-17Extract ConsoleTestStateIgor Aleksanov-286/+317
2019-10-17Split libtest into several smaller modulesIgor Aleksanov-1385/+1462
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-5/+16
- 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-117/+593
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