]> git.proxmox.com Git - cargo.git/commit - tests/testsuite/doc.rs
Auto merge of #9892 - ehuss:cargo_test-ignore-reason, r=weihanglo
authorbors <bors@rust-lang.org>
Mon, 1 Aug 2022 00:51:01 +0000 (00:51 +0000)
committerbors <bors@rust-lang.org>
Mon, 1 Aug 2022 00:51:01 +0000 (00:51 +0000)
commit2e35678c3967f500ff885df54ceff0cd439e2687
tree9b9232f0daef89514be65f9863d3a8776dd63bb8
parent85e79fcc2956cdaf7fe643e1ca3878b977b612e0
parent8e35e2f044a8a042f9f2eedc35cb6db4649533c9
Auto merge of #9892 - ehuss:cargo_test-ignore-reason, r=weihanglo

Add requirements to cargo_test.

This extends the `#[cargo_test]` attribute to support some additional requirements to control whether or not a test can run. The motivation for this is:

* Can more clearly see when a test is disabled when it prints "ignored"
* Can more easily scan for disabled tests when I do version bumps to see which ones should be enabled on stable (to pass on CI).

The form is a comma separated list of requirements, and if they don't pass the test is ignored.  The requirements can be:

* `nightly` — The test only runs on nightly.
* `>=1.55` — The test only runs on rustc with the given version or newer.
* `requires_git` — Requires the given command to be installed.  Can be things like `requires_rustfmt` or `requires_hg`, etc.

This also enforces that the author must write a reason why it is ignored (for some of the requirements) so that when I look for tests to update, I know why it is disabled.

This also removes the `CARGO_TEST_DISABLE_GIT_CLI` option, which appears to no longer be necessary since we have migrated to GitHub Actions.