195 Commits

Author SHA1 Message Date
Weihang Lo
8f0664f02a
test: normalize raw string indentation. 2020-10-10 07:44:57 +08:00
Weihang Lo
5e3dc46753
test: be consistent on error message styles 2020-10-10 06:58:06 +08:00
Weihang Lo
6fb6b94a33
test(test): glob support for package selection 2020-10-05 01:24:43 +08:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Oliver Scherer
95b22d2874 Emit the test field in cargo metadata 2020-07-30 09:50:46 +02:00
Eric Huss
eac3b66bd4 Rework how Cargo computes the rustc file outputs. 2020-05-05 14:32:52 -07:00
bors
90931d9b31 Auto merge of #8077 - faern:use-assoc-int-consts, r=ehuss
Use associated constants directly on primitive types instead of modules

This PR is in no way critical. It's more of a code cleanup. It comes as a result of me making https://github.com/rust-lang/rust/pull/70857 and search-and-replacing all usage of the soft-deprecated ways of reaching primitive type constants.

It makes the code slightly shorter, that's basically it. And showcases the recommended way of reaching these consts on new code :)
2020-04-28 01:56:59 +00:00
Linus Färnstrand
c428c0ef41 Use associated constants directly on primitive types instead of modules 2020-04-06 23:37:06 +02:00
Eric Huss
c889bbfba8 Add "build-finished" JSON message. 2020-04-04 18:56:50 -07:00
Jiajie Chen
9f07c83417 Don't create hardlink for library test, integrations tests and benches, fixing #7960 2020-03-05 13:03:49 +08:00
Matthias Krüger
1d912002e9 fix most remaining clippy findings (mostly redundant imports) 2020-02-21 12:15:16 +01:00
Eric Huss
0a2f691381 Switch azure to macOS 10.15. 2020-02-19 16:46:29 -08:00
Eric Huss
499f917c03 Switch to case-sensitive environment variable. 2020-02-06 08:30:09 -08:00
Eric Huss
3489428921 Set an environment variable for tests to find executables. 2020-02-06 08:15:08 -08:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Eric Huss
3beb139034 Fix some tests failing on Windows nightly. 2019-10-23 08:14:40 -07:00
Alex Crichton
9cfdf4d8bf Inherit panic settings in test/bench profiles
We've always ignored the `panic` settings configured in test/bench
profiles, so this just continues to ignore them but in a slightly
different way.
2019-10-21 08:53:15 -07:00
Alex Crichton
f37f3aea14 Support rustc's -Z panic-abort-tests in Cargo
Recently added in rust-lang/rust#64158 the `-Z panic-abort-tests` flag
to the compiler itself will activate a mode in the `test` crate which
enables running tests even if they're compiled with `panic=abort`.  It
effectively runs a test-per-process.

This commit brings the same support to Cargo, adding a `-Z
panic-abort-tests` flag to Cargo which allows building tests in
`panic=abort` mode. While I wanted to be sure to add support for this in
Cargo before we stabilize the flag in `rustc`, I don't actually know how
we're going to stabilize this here. Today Cargo will automatically
switch test targets to `panic=unwind`, and so if we actually were to
stabilize this flag then this configuration would break:

    [profile.dev]
    panic = 'abort'

In that case tests would be compiled with `panic=unwind` (due to how
profiles work today) which would clash with crates also being compiled
with `panic=abort`. I'm hopeful though that we can perhaps either figure
out a solution for this and maybe even integrate it with the ongoing
profiles work.
2019-10-21 08:51:01 -07:00
Dan Aloni
33d5c837e2 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-25 20:05:51 +03:00
Eric Huss
4850f9b9d8 Fix xcompile tests. 2019-09-21 16:30:38 -07:00
Dan Aloni
fb75361226 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-21 08:10:31 +03:00
Dario Gonzalez
a2209fc590 added tests 2019-09-18 11:57:46 -07:00
Dan Aloni
375a46f18b Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-18 08:56:13 +03:00
Alex Crichton
ebd10526f3 Run rustfmt 2019-09-16 12:00:12 -07:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Aaron Hill
5bc05b40f0
Add tests 2019-09-12 13:38:10 -04:00
Dan Aloni
f0896975be Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-08 21:43:41 +03:00
k-nasa
7176df01d6 Change --all to --workspace 2019-09-03 17:14:34 -07:00
Dan Aloni
27da33c67d Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-07-28 09:24:31 +03:00
Eric Huss
9fa65608e4 Fix some clippy warnings. 2019-07-14 15:19:33 -07:00
Dan Aloni
87183146d9 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-06-20 16:18:42 +03:00
Jethro Beekman
0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Jethro Beekman
e157b6d84c Fix intermittent test failure due to interleaved stdout 2019-06-07 12:41:25 -07:00
Jethro Beekman
04a9a7cc34 Fix tests when running with RUST_TEST_THREADS=1 2019-06-07 12:41:25 -07:00
Dan Aloni
e25f6a4255 tests: fix finished line for 'cargo test' 2019-06-07 21:47:45 +03:00
vlad20012
e1d433d30f Add doctest field into metadata
Some tools can support rust doctests (e.g. highlighting
or launching). So it should be possible to find out if
doctests are enabled for a target or not. This commit
adds `doctest` field to `cargo metadata` output.
2019-05-17 18:39:23 +03:00
Zach Lute
782266aaee Changed RUST_LOG usage to CARGO_LOG to avoid confusion. 2019-05-08 10:53:02 -07:00
Eric Huss
a9ae668c1b Attempt to debug a spurious test. 2019-04-28 19:25:24 -07:00
Alex Crichton
f16efff150 Run cargo fmt 2019-04-10 10:42:07 -07:00
Eric Huss
44c535ab09 Improve error message to rerun a test in a workspace. 2019-04-05 18:52:22 -07:00
Eric Huss
50277e88fe Testsuite: remove some unnecessary is_nightly checks. 2019-03-26 13:56:14 -07:00
bors
d74d879d63 Auto merge of #6358 - collin5:b4325, r=ehuss
Add --quiet option for `cargo test`

Fixes #4325
2019-03-11 17:00:13 +00:00
Collins Abitekaniza
d93b2d75e6 test --quiet option with and without harness 2019-03-11 03:02:06 +03:00
Dale Wijnand
110c813902
Cargo test quicker by not building untested examples when filtered 2019-02-25 15:14:07 +00:00
Alexander Regueiro
f7c91ba622
Various cosmetic improvements. 2019-02-20 10:58:27 +00:00
Dale Wijnand
fabda179f4
Bail when trying to run "test --doc --no-run" 2019-02-04 15:39:51 +01:00
Alex Crichton
fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
bors
41a7e150fc Auto merge of #6387 - dwijnand:rust-2018, r=dwijnand
Upgrade to Rust 2018 & fix edition idioms

None
2018-12-07 16:37:19 +00:00
Eric Huss
503af8a522 Fix spurious error for test json_artifact_includes_test_flag
There is a race condition for which job finishes first. On CI I am able
to reproduce the error about 1% of the time.

Recent failures:
- https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/20151768/job/oghwemec7b19turs
- https://travis-ci.org/rust-lang/cargo/jobs/464717439
2018-12-06 20:44:45 -08:00
Dale Wijnand
04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00