summary refs log tree commit diff
path: root/src/libtest
AgeCommit message (Collapse)AuthorLines
2017-11-19std: Add a new wasm32-unknown-unknown targetAlex Crichton-31/+50
This commit adds a new target to the compiler: wasm32-unknown-unknown. This target is a reimagining of what it looks like to generate WebAssembly code from Rust. Instead of using Emscripten which can bring with it a weighty runtime this instead is a target which uses only the LLVM backend for WebAssembly and a "custom linker" for now which will hopefully one day be direct calls to lld. Notable features of this target include: * There is zero runtime footprint. The target assumes nothing exists other than the wasm32 instruction set. * There is zero toolchain footprint beyond adding the target. No custom linker is needed, rustc contains everything. * Very small wasm modules can be generated directly from Rust code using this target. * Most of the standard library is stubbed out to return an error, but anything related to allocation works (aka `HashMap`, `Vec`, etc). * Naturally, any `#[no_std]` crate should be 100% compatible with this new target. This target is currently somewhat janky due to how linking works. The "linking" is currently unconditional whole program LTO (aka LLVM is being used as a linker). Naturally that means compiling programs is pretty slow! Eventually though this target should have a linker. This target is also intended to be quite experimental. I'm hoping that this can act as a catalyst for further experimentation in Rust with WebAssembly. Breaking changes are very likely to land to this target, so it's not recommended to rely on it in any critical capacity yet. We'll let you know when it's "production ready". --- Currently testing-wise this target is looking pretty good but isn't complete. I've got almost the entire `run-pass` test suite working with this target (lots of tests ignored, but many passing as well). The `core` test suite is still getting LLVM bugs fixed to get that working and will take some time. Relatively simple programs all seem to work though! --- It's worth nothing that you may not immediately see the "smallest possible wasm module" for the input you feed to rustc. For various reasons it's very difficult to get rid of the final "bloat" in vanilla rustc (again, a real linker should fix all this). For now what you'll have to do is: cargo install --git https://github.com/alexcrichton/wasm-gc wasm-gc foo.wasm bar.wasm And then `bar.wasm` should be the smallest we can get it! --- In any case for now I'd love feedback on this, particularly on the various integration points if you've got better ideas of how to approach them!
2017-11-06libtest: Force a newline every 100 dots when testing in quiet mode.kennytm-3/+14
Rationale: We use --quiet mode when testing a PR in the CI. Also, we use `stamp` to prefix every line with a timestamp. Previously, when testing in --quiet mode, we will only print a dot for each test without any line breaks. Combined with `stamp`, this means we'd need to wait for all tests to complete before writing the output. On Travis CI, if we don't print anything within 30 minutes, the job will be forcefully canceled. This makes it very easy to spuriously-timeout when testing non-default images like arm-android using the CI. This commit tries to workaround the issue by printing a new line every 100 dots, forcing `stamp` to emit something to reset Travis's countdown.
2017-10-05Remove nacl from libtestest31-4/+2
2017-08-27Platform gate libc in libtestTatsuyuki Ishi-1/+2
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-2/+3
Fixes #41701.
2017-08-20Make sure crates not opting in to staged_api don't use staged_apiRalf Jung-0/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-19/+19
Like #43008 (f668999), but _much more aggressive_.
2017-07-13Reduce the usage of features in compiletest and libtestOliver Schneider-2/+0
2017-06-25only show allowed failure count if there are allowed failuresPaul Woolcock-3/+13
2017-06-24fix some tests i missedPaul Woolcock-0/+13
2017-06-24Shorten some lines so this can pass the tidy checksPaul Woolcock-8/+10
2017-06-24add `allow_fail` test attributePaul Woolcock-3/+20
This change allows the user to add an `#[allow_fail]` attribute to tests that will cause the test to compile & run, but if the test fails it will not cause the entire test run to fail. The test output will show the failure, but in yellow instead of red, and also indicate that it was an allowed failure.
2017-06-20Switch to the crates.io `getopts` crateAlex Crichton-25/+26
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based `getopts` crate. The main difference here is with a new builder-style API, but otherwise everything else remains relatively standard.
2017-06-15Update older URLs pointing to the first edition of the BookWonwoo Choi-1/+1
`compiler-plugins.html` is moved into the Unstable Book. Explanation is slightly modified to match the change.
2017-05-11Number of filtered out tests in tests summaryMike Lubinets-2/+13
Closes #31905
2017-05-09Don't show the std frames before user code on unwinding.Yamakaky-5/+21
When `RUST_BACKTRACE=1`, remove all frames after `__rust_maybe_catch_panic`. Tested on `main`, threads, tests and benches. Cleaning of the top of the stacktrace is let to a future PR. Fixes #40201 See #41815
2017-05-05Add Options type in libtest and remove argumentGuillaume Gomez-13/+32
2017-05-02Add option to display warnings in rustdocGuillaume Gomez-3/+46
2017-04-04Fix linkssteveklabnik-2/+4
part of https://github.com/rust-lang/rust/issues/40912 []\n() is not actually a link.
2017-02-27fix typoking6cong-2/+2
2017-02-14make more types publicOliver Schneider-1/+1
2017-02-14enable tools to use test runners programmaticallyOliver Schneider-2/+2
2017-02-12Auto merge of #38945 - battisti:fix_thread_num, r=alexcrichtonbors-0/+2
treat setting the number of test-threads to 0 as an error It is currently possible to call `cargo test -- --test-threads=0` which will cause cargo to hang until aborted. This change will fix that and will report an appropriate error to the user.
2017-02-11removed trailing whitespaceAlexander Battisti-1/+1
2017-01-12Auto merge of #38779 - Craig-Macomber:bench, r=alexcrichtonbors-97/+148
Do not run outer setup part of benchmarks multiple times to fix issue 20142 Fix #20142 This is my first real rust code, so I expect the quality is quite bad. Please let me know in which ways it is horrible and I'll fix it. Previously the whole benchmark function was rerun many times, but with this change, only the callback passed to iter is rerun. This improves performances by saving benchmark startup time. The setup used to be called a minimum of 101 times, and now only runs once. I wasn't sure exactly what should be done for the case where iter is never called, so I left a FIXME for that: currently it does not error, and I added tests to cover that. I have left the algorithm and statistics unchanged: I don't like how the minimum number of runs is 301 (that's bad for very slow benchmarks) but I consider such changes out of scope for this fix.
2017-01-09Fix for for setting test-threads to 0Alexander Battisti-0/+2
Running test with cargo test -- --test-threads=0 causes cargo to hang as 0 is a valid usize. Adding zero threads as a special case to the error handling.
2017-01-02do not run outter part of benchmarks multimple times to fix issue 20142Craig Macomber-97/+148
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-15WIP: Cross-compilation for Redox targetJeremy Soller-0/+11
2016-12-14libtest: add --list option to list tests and benchmarksJeremy Fitzhardinge-20/+78
This option lists all the tests and benchmarks a binary provides. By default the listing is sent to stdout, but if --logfile is also specified, it is written there. If filters are specified, they're applied before the output is emitted.
2016-12-05libtest: add --exact to make filter matching exactJeremy Fitzhardinge-2/+90
Filter matching is by substring by default. This makes it impossible to run a single test if its name is a substring of some other test. For example, its not possible to run just "mymod::test" with these tests: mymod::test mymod::test1 mymod::test_module::moretests You could declare by convention that no test has a name that's a substring of another test, but that's not really practical. This PR adds the "--exact" flag, to make filter matching exactly match the complete name.
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-18Warn when a #[should_panic] test has an unexpected messageJosh Driver-13/+30
2016-10-31Changed most vec! invocations to use square bracesiirelu-2/+2
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-22Add Fuchsia supportRaph Levien-1/+2
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
2016-10-12Stabilise `?`Nick Cameron-1/+1
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-06std: Minor cleanup to libtestAlex Crichton-65/+65
* Don't spawn two threads for all tests, just one now that `catch_unwind` is stable. * Remove usage of the unstable `box` keyword * Remove usage of the unstable `FnBox` trait
2016-09-30Change the sigs of set_print/set_panic to allow restoring the default objectsBrian Anderson-10/+6
2016-09-30Update libtest for single-threaded emscripten supportBrian Anderson-16/+53
2016-09-30Preliminary wasm32 supportBrian Anderson-2/+2
2016-09-28Auto merge of #36604 - japaric:libtest-skip, r=alexcrichtonbors-0/+10
libtest: add a --skip flag to the test runner This flag takes a FILTER argument and instructs the test runner to skip the tests whose names contain the word FILTER. --skip can be used several times. --- My motivation for submitting this is that while using [smoke] to run `std` unit tests for cross targets I found that a few of the tests always fail due to limitations in QEMU (it can't handle too many threads) and I'd like to skip these problematic tests from the command line to be able to run the rest of the unit tests. [smoke]: https://github.com/japaric/smoke I know there is another mechanism to skip tests: `#[ignore]` but this doesn't work in my use case because I can't (easily) modify the source of the standard libraries to `#[ignore]` some tests. And even if I could, the change would involve conditionally ignoring some tests for some targets but that's not a perfect solution because those tests should pass if executed on real hardware so they should not be `#[ignored]` in that scenario. r? @alexcrichton cc @brson
2016-09-25Haiku: Style, TODO to FIXMEAlexander von Gluck IV-1/+1
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-0/+6
* Hand rebased from Niels original work on 1.9.0
2016-09-20libtest: add a --skip flag to the test runnerJorge Aparicio-0/+10
This flag takes a FILTER argument and instructs the test runner to skip the tests whose names contain the word FILTER. --skip can be used several times.
2016-08-19std: Stabilize APIs for the 1.12 releaseAlex Crichton-1/+0
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-08-13Auto merge of #35414 - jupp0r:feature/test-threads-flag, r=alexcrichtonbors-4/+23
Add --test-threads option to test binaries This change allows parallelism of test runs to be specified by a command line flag names --test-threads in addition to the existing environment variable RUST_TEST_THREADS. Fixes #25636.
2016-08-07save an Instant for the timeout instead of a DurationFelix Rath-24/+35
requires less bookkeeping. also move some functionality into functions, to keep the loop cleaner.
2016-08-07Add --test-threads option to test binariesJupp Müller-4/+23
This change allows parallelism of test runs to be specified by a command line flag names --test-threads in addition to the existing environment variable RUST_TEST_THREADS. Fixes #25636.
2016-08-06add warning timeout for tests that run >1minFelix Rath-1/+47
this makes it easier to identify hanging tests
2016-07-12Use `ptr::{null, null_mut}` instead of `0 as *{const, mut}`Tobias Bucher-2/+6