-
Couldn't load subscription status.
- Fork 2.7k
Description
Implementation: #6892
Rustc tracking issue: rust-lang/rust#64245
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile
Issues: https://github.com/rust-lang/cargo/labels/Z-doctest-xcompile
This PR adds the unstable -Zdoctest-xcompile flag to cargo. When present, instead of skipping doctests when host != target as it does now, cargo parses the runner field for target from .cargo/config and passes that to rustdoc. See here for the companion PR in rust that adds the necessary functionality to rustdoc. The flag also enables a new unstable --enable-per-target-ignores flag in rustdoc, allowing the use of compiletest-style --ignore-foo annotations for doctests so that they are ignored on a per-target basis. The motivation for these PRs, along with another modifying compiltest and bootstrap (not yet submitted), is to allow bootstrap to utilize the many doctests found in the various crates in the rust compiler, notably libstd and libcore.
This should add uniformity and expand testsuites for projects that build for other platforms, since the runner field is already used by cargo test.
Unresolved issues
- For stabilizing flags on rustdoc side, would it be better for cargo to take over the test execution responsibility? See doctests testing-devex-team#5.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status