Skip to content

Tracking Issue for compiletest documentation #125706

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
11 tasks
jieyouxu opened this issue May 29, 2024 · 1 comment
Open
11 tasks

Tracking Issue for compiletest documentation #125706

jieyouxu opened this issue May 29, 2024 · 1 comment
Labels
A-compiletest Area: The compiletest test runner A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-testsuite Area: The testsuite used to check the correctness of rustc C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC E-help-wanted Call for participation: Help is requested to fix this issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jieyouxu
Copy link
Member

jieyouxu commented May 29, 2024

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

@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-help-wanted Call for participation: Help is requested to fix this issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC A-compiletest Area: The compiletest test runner labels May 29, 2024
@Zalathar
Copy link
Contributor

Zalathar commented Jun 9, 2024

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-compiletest Area: The compiletest test runner A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools A-testsuite Area: The testsuite used to check the correctness of rustc C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC E-help-wanted Call for participation: Help is requested to fix this issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Development

No branches or pull requests

2 participants