Skip to content

Tracking Issue for compiletest documentation #125706

Open
1 of 4 issues completed
Open
1 of 4 issues completed
@jieyouxu

Description

Context

compiletest is the main test harness of rustc and other tools inside this repository, but there is a significant lack of documentation for it. We should write some documentation for compiletest. There are some documentation in rustc-dev-guide, but compiletest is a lot more complex than that.

Areas lacking documentation

  • High-level architecture and overview
  • Interaction between bootstrap <-> compiletest <-> tests
  • compiletest-as-a-binary: CLI interface options and docs
  • Filtering tests
  • How are test modes and test suites created, registered, built and run
    • When can tests be ignored? cached test results and their invalidation: dependency stamps
    • Some test mode / test suite tests can be run in parallel / concurrently:
      • Concurrency assumptions: what if the test modifies external state?
  • Test mode and test suite specific behavior, assumptions and quirks
    • UI tests: auxiliary crates and bins, compile-flags, compare modes, assumptions and conventions on stdout/stderr output, blessing
    • run-make and run-make-fulldeps tests: how the whole build pipeline is setup, concepts, how tests are built and executed, provided env vars, assumed dependencies
    • codegen tests: filecheck, revisions magic behavior
    • coverage tests: how to bless?
    • ui-fulldeps have some non-trivial behavior: e.g. Port tests/run-make-fulldeps/obtain-borrowck to ui-fulldeps #126073 (comment)
  • Error handling strategy/design and diagnostics
  • Interaction with CI
  • Test directive collection, parsing and validation
    • Which directives can be used in which test suites?
    • What do the directives even mean/do?
  • Test output normalization special syntax
    • e.g. const CWD: &str = "{{cwd}}";
  • Setting current_dir when running tests

Related issues

Unresolved questions

  • Where do we keep compiletest docs?
    • Maybe alongside the source? Maybe a mdBook? rustc-dev-guide?
    • Ideally we would like this easy to read and reference and improve.
  • How to we keep compiletest documentation update-to-date?
    • Periodic triage?

Documentation improvement history

TODO

Sub-issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsA-testsuiteArea: The testsuite used to check the correctness of rustcC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions