@@ -67,11 +67,8 @@ The following test suites are available, with links for more information:
6767- ` run-make-fulldeps ` — ` run-make ` tests which require a linkable build of ` rustc ` ,
6868 or the rust demangler
6969- [ ` run-pass-valgrind ` ] ( #valgrind-tests ) — tests run with Valgrind
70- - [ ` coverage-map ` ] ( #coverage-tests ) - tests for coverage maps produced by
71- coverage instrumentation
72- - [ ` run-coverage ` ] ( #coverage-tests ) - tests that run an instrumented program
73- and check its coverage report
74- - [ ` run-coverage-rustdoc ` ] ( #coverage-tests ) - coverage tests that also run
70+ - [ ` coverage ` ] ( #coverage-tests ) - tests for coverage instrumentation
71+ - [ ` coverage-run-rustdoc ` ] ( #coverage-tests ) - coverage tests that also run
7572 instrumented doctests
7673- [ Rustdoc tests] ( ../rustdoc.md#tests ) :
7774 - ` rustdoc ` — tests for rustdoc, making sure that the generated files
@@ -402,7 +399,28 @@ These may be removed in the future.
402399
403400### Coverage tests
404401
405- The tests in [ ` tests/coverage-map ` ] test the mappings between source code
402+ The tests in [ ` tests/coverage ` ] are shared by multiple test modes that test
403+ coverage instrumentation in different ways.
404+ Running the ` coverage ` test suite will automatically run each test in all of
405+ the different coverage modes.
406+
407+ Each mode also has an alias to run the coverage tests in just that mode:
408+
409+ ``` bash
410+ ./x test coverage # runs all of tests/coverage in all coverage modes
411+ ./x test tests/coverage # same as above
412+
413+ ./x test tests/coverage/if.rs # runs the specified test in all coverage modes
414+
415+ ./x test coverage-map # runs all of tests/coverage in "coverage-map" mode only
416+ ./x test coverage-run # runs all of tests/coverage in "coverage-run" mode only
417+
418+ ./x test coverage-map -- tests/coverage/if.rs # runs the specified test in "coverage-map" mode only
419+ ```
420+
421+ ---
422+
423+ In ` coverage-map ` mode, these tests verify the mappings between source code
406424regions and coverage counters that are emitted by LLVM.
407425They compile the test with ` --emit=llvm-ir ` ,
408426then use a custom tool ([ ` src/tools/coverage-dump ` ] )
@@ -416,18 +434,18 @@ coverage reports.
416434
417435As a rule of thumb, any PR that doesn't change coverage-specific
418436code should ** feel free to re-bless** the ` coverage-map ` tests as necessary,
419- without worrying about the actual changes, as long as the ` run- coverage` tests
437+ without worrying about the actual changes, as long as the ` coverage-run ` tests
420438still pass.
421439
422440---
423441
424- The tests in [ ` tests/run- coverage` ] perform an end-to-end test of coverage reporting.
442+ In ` coverage-run ` mode, these tests perform an end-to-end test of coverage reporting.
425443They compile a test program with coverage instrumentation, run that program to
426444produce raw coverage data, and then use LLVM tools to process that data into a
427445human-readable code coverage report.
428446
429447Instrumented binaries need to be linked against the LLVM profiler runtime,
430- so ` run- coverage` tests are ** automatically skipped**
448+ so ` coverage-run ` tests are ** automatically skipped**
431449unless the profiler runtime is enabled in ` config.toml ` :
432450
433451``` toml
@@ -439,14 +457,15 @@ profiler = true
439457This also means that they typically don't run in PR CI jobs,
440458though they do run as part of the full set of CI jobs used for merging.
441459
442- The tests in [ ` tests/run-coverage-rustdoc ` ] also run instrumented doctests and
460+ ---
461+
462+ The tests in [ ` tests/coverage-run-rustdoc ` ] also run instrumented doctests and
443463include them in the coverage report. This avoids having to build rustdoc when
444- only running the main ` run- coverage` suite.
464+ only running the main ` coverage ` suite.
445465
446- [ `tests/coverage-map ` ] : https://github.com/rust-lang/rust/tree/master/tests/coverage-map
466+ [ `tests/coverage` ] : https://github.com/rust-lang/rust/tree/master/tests/coverage
447467[ `src/tools/coverage-dump` ] : https://github.com/rust-lang/rust/tree/master/src/tools/coverage-dump
448- [ `tests/run-coverage` ] : https://github.com/rust-lang/rust/tree/master/tests/run-coverage
449- [ `tests/run-coverage-rustdoc` ] : https://github.com/rust-lang/rust/tree/master/tests/run-coverage-rustdoc
468+ [ `tests/coverage-run-rustdoc` ] : https://github.com/rust-lang/rust/tree/master/tests/coverage-run-rustdoc
450469
451470
452471## Building auxiliary crates
0 commit comments