Skip to content

Rustdoc should run all doctests in one binary #75341

Closed
@jyn514

Description

@jyn514

Raised by @Lokathor on discord:

Doctests are slower to run than integration tests. Each individual doctest block runs as a unique binary/process when testing, but each entire integration test file runs as a single process with integration tests. So the test themselves aren't different speeds, but because you're building less bins and spawning less child processes it's faster to go through the integration tests.

I don't think there's any intrinsic reason the tests have to be their own process? The only issue is that many of them have fn main, which would have to be rewritten somehow. This could speed up CI times across the Rust ecosystem, including for the rust compiler itself.

Somewhat related to #51228.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocC-enhancementCategory: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions