# Testing signals — rust-lang/rust

> Canonical page: https://codevetter.com/unpack/rust/testing-signals

# Testing signals — rust-lang/rust

Scanned commit c64de18c55c70d62aa88a5722dea8f8e263bacf3 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Testing is dominated by compiletest-driven suites under tests/ (~27k .rs files; tests/ui alone has ~21k), organized by 15 TestModes with //@-style file directives. Unit tests live inside compiler crates as #[cfg(test)] modules and in library/coretests + alloctests. tidy enforces repo-wide hygiene. CI runs everything via the citool-computed matrix in jobs.yml, and bootstrap itself has python and Rust self-tests. Coverage tests exercise LLVM source-based coverage; rustdoc has html/json/js/gui suites.
- tests/ contains suites: ui, ui-fulldeps, mir-opt, codegen-llvm, codegen-units, assembly-llvm, coverage, coverage-run-rustdoc, crashes, debuginfo, incremental, pretty, run-make, run-make-cargo, rustdoc-html, rustdoc-js, rustdoc-js-std, rustdoc-json, rustdoc-gui, build-std; tests/ui alone contains ~21,000 .rs files. — [tests](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/tests) [tests/COMPILER_TESTS.md](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/tests/COMPILER_TESTS.md)
- compiletest's TestMode enum (common.rs) maps each suite to a mode; each mode has a runner module under src/tools/compiletest/src/runtest/ (ui.rs, mir_opt.rs, codegen.rs, incremental.rs, run_make.rs, coverage.rs, debuginfo.rs, rustdoc.rs, rustdoc_json.rs, js_doc.rs, crashes.rs, pretty.rs, assembly.rs, codegen_units.rs). — [src/tools/compiletest/src/common.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/common.rs) [src/tools/compiletest/src/runtest.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/runtest.rs)
- Test files declare behavior via directives parsed by src/tools/compiletest/src/directives.rs: KNOWN_DIRECTIVE_NAMES_SET in directive_names.rs, a DIRECTIVE_HANDLERS_MAP in directives/handlers.rs, ignore-*/only-*/needs-* cfg conditions precompiled in DirectivesCache, and AuxProps for aux builds. — [src/tools/compiletest/src/directives.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/directives.rs) [src/tools/compiletest/src/directives/handlers.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/directives/handlers.rs)
- UI tests compare compiler output against checked-in .stderr/.stdout/.svg snapshots; compute_diff in runtest produces line diffs and `--bless` regenerates expectations (per AGENTS.md, bless runs only after a human authors new diagnostic text). — [src/tools/compiletest/src/runtest.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/runtest.rs) [AGENTS.md](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/AGENTS.md)
- Compiler crates carry in-tree unit tests: e.g. compiler/rustc_interface/src/tests.rs, compiler/rustc_middle/src/tests.rs, compiler/rustc_feature/src/tests.rs, rustc_target/src/tests.rs, compiletest/src/tests.rs; bootstrap has src/bootstrap/bootstrap_test.py and builder/tests.rs. — [compiler/rustc_interface/src/tests.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_interface/src/tests.rs) [src/bootstrap/bootstrap_test.py](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/bootstrap/bootstrap_test.py)
- Standard library tests live in separate crates in the library workspace: coretests and alloctests exercise core/alloc without running inside std; library/test is the user-facing #[test] harness crate. — [library/Cargo.toml](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/library/Cargo.toml) [library/test/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/library/test/src/lib.rs)
- tidy acts as a repo-wide lint gate: src/tools/tidy/src/main.rs spawns per-check threads (style, alphabetical ordering, deps/extdeps allowlist, error_codes, features, ui_tests conventions, target_policy, unit_tests placement, edition, mir_opt_tests) runnable via ./x test tidy. — [src/tools/tidy/src/main.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/tidy/src/main.rs)
- run-make tests are driven by the src/tools/run-make-support library and live in tests/run-make and tests/run-make-cargo; coverage tests use the coverage-map/coverage-run modes sharing tests/coverage files. — [src/tools/compiletest/src/runtest.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/runtest.rs) [src/tools/compiletest/src/common.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/common.rs)
- CI executes tests through the matrix in src/ci/github-actions/jobs.yml computed by src/ci/citool (calculate-job-matrix), with the actual build/test run delegated to src/ci/scripts/run-build-from-ci.sh inside ci.yml's 'run the build' step. — [.github/workflows/ci.yml](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/.github/workflows/ci.yml) [src/ci/github-actions/jobs.yml](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/ci/github-actions/jobs.yml)
- rustdoc-gui tests are a separate excluded workspace (tests/rustdoc-gui in Cargo.toml exclude list) driven by src/tools/rustdoc-gui-test and compiletest's rustdoc_gui_test module. — [Cargo.toml](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/Cargo.toml) [src/tools/compiletest/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/lib.rs)
- tests/crashes is a dedicated ICE-regression suite, and tests/debuginfo is skipped on emscripten targets (run_tests special-cases TestMode::DebugInfo for emscripten). — [src/tools/compiletest/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/lib.rs) [src/tools/compiletest/src/common.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/common.rs)
- Cross/remote testing is supported by src/tools/remote-test-client and remote-test-server, and test-float-parse is an optimized dev/release binary used to validate float parsing. — [Cargo.toml](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/Cargo.toml)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
