Skip to content

Commit a573880

Browse files
committed
coverage: Rename the run-coverage test mode to coverage-run
This makes it more consistent with the `coverage-map` mode and the shared `tests/coverage` test directory.
1 parent 91cfcb0 commit a573880

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

src/bootstrap/src/core/build_steps/test.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ impl Step for Coverage {
14341434

14351435
fn run(self, builder: &Builder<'_>) {
14361436
self.run_unified_suite(builder, CoverageMap::MODE);
1437-
self.run_unified_suite(builder, RunCoverage::MODE);
1437+
self.run_unified_suite(builder, CoverageRun::MODE);
14381438
}
14391439
}
14401440

@@ -1444,16 +1444,16 @@ coverage_test_alias!(CoverageMap {
14441444
default: true,
14451445
only_hosts: false,
14461446
});
1447-
coverage_test_alias!(RunCoverage {
1448-
alias_and_mode: "run-coverage",
1447+
coverage_test_alias!(CoverageRun {
1448+
alias_and_mode: "coverage-run",
14491449
default: true,
14501450
only_hosts: true,
14511451
});
14521452

1453-
host_test!(RunCoverageRustdoc {
1454-
path: "tests/run-coverage-rustdoc",
1455-
mode: "run-coverage",
1456-
suite: "run-coverage-rustdoc"
1453+
host_test!(CoverageRunRustdoc {
1454+
path: "tests/coverage-run-rustdoc",
1455+
mode: "coverage-run",
1456+
suite: "coverage-run-rustdoc"
14571457
});
14581458

14591459
// For the mir-opt suite we do not use macros, as we need custom behavior when blessing.
@@ -1640,7 +1640,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
16401640
|| (mode == "ui" && is_rustdoc)
16411641
|| mode == "js-doc-test"
16421642
|| mode == "rustdoc-json"
1643-
|| suite == "run-coverage-rustdoc"
1643+
|| suite == "coverage-run-rustdoc"
16441644
{
16451645
cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler));
16461646
}
@@ -1662,7 +1662,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
16621662
cmd.arg("--coverage-dump-path").arg(coverage_dump);
16631663
}
16641664

1665-
if mode == "run-coverage" {
1665+
if mode == "coverage-run" {
16661666
// The demangler doesn't need the current compiler, so we can avoid
16671667
// unnecessary rebuilds by using the bootstrap compiler instead.
16681668
let rust_demangler = builder
@@ -1854,11 +1854,11 @@ note: if you're sure you want to do this, please open an issue as to why. In the
18541854
}
18551855

18561856
if !builder.config.dry_run()
1857-
&& (matches!(suite, "run-make" | "run-make-fulldeps") || mode == "run-coverage")
1857+
&& (matches!(suite, "run-make" | "run-make-fulldeps") || mode == "coverage-run")
18581858
{
18591859
// The llvm/bin directory contains many useful cross-platform
18601860
// tools. Pass the path to run-make tests so they can use them.
1861-
// (The run-coverage tests also need these tools to process
1861+
// (The coverage-run tests also need these tools to process
18621862
// coverage reports.)
18631863
let llvm_bin_path = llvm_config
18641864
.parent()

src/bootstrap/src/core/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ impl<'a> Builder<'a> {
729729
test::RunPassValgrind,
730730
test::Coverage,
731731
test::CoverageMap,
732-
test::RunCoverage,
732+
test::CoverageRun,
733733
test::MirOpt,
734734
test::Codegen,
735735
test::CodegenUnits,
@@ -740,7 +740,7 @@ impl<'a> Builder<'a> {
740740
test::CodegenCranelift,
741741
test::CodegenGCC,
742742
test::Rustdoc,
743-
test::RunCoverageRustdoc,
743+
test::CoverageRunRustdoc,
744744
test::Pretty,
745745
test::Crate,
746746
test::CrateLibrustc,

src/tools/compiletest/src/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ string_enum! {
6767
MirOpt => "mir-opt",
6868
Assembly => "assembly",
6969
CoverageMap => "coverage-map",
70-
RunCoverage => "run-coverage",
70+
CoverageRun => "coverage-run",
7171
}
7272
}
7373

@@ -91,7 +91,7 @@ impl Mode {
9191
// Coverage tests use the same test files for multiple test modes,
9292
// so each mode should have a separate output directory.
9393
match self {
94-
CoverageMap | RunCoverage => self.to_str(),
94+
CoverageMap | CoverageRun => self.to_str(),
9595
_ => "",
9696
}
9797
}

src/tools/compiletest/src/header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -911,11 +911,11 @@ pub fn make_test_description<R: Read>(
911911
let mut should_fail = false;
912912

913913
let extra_directives: &[&str] = match config.mode {
914-
// The run-coverage tests are treated as having these extra directives,
914+
// The coverage-run tests are treated as having these extra directives,
915915
// without needing to specify them manually in every test file.
916916
// (Some of the comments below have been copied over from
917917
// `tests/run-make/coverage-reports/Makefile`, which no longer exists.)
918-
Mode::RunCoverage => {
918+
Mode::CoverageRun => {
919919
&[
920920
"needs-profiler-support",
921921
// FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works

src/tools/compiletest/src/runtest.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::common::{Assembly, Incremental, JsDocTest, MirOpt, RunMake, RustdocJs
66
use crate::common::{Codegen, CodegenUnits, DebugInfo, Debugger, Rustdoc};
77
use crate::common::{CompareMode, FailMode, PassMode};
88
use crate::common::{Config, TestPaths};
9-
use crate::common::{CoverageMap, Pretty, RunCoverage, RunPassValgrind};
9+
use crate::common::{CoverageMap, CoverageRun, Pretty, RunPassValgrind};
1010
use crate::common::{UI_COVERAGE, UI_COVERAGE_MAP, UI_RUN_STDERR, UI_RUN_STDOUT};
1111
use crate::compute_diff::{write_diff, write_filtered_diff};
1212
use crate::errors::{self, Error, ErrorKind};
@@ -257,7 +257,7 @@ impl<'test> TestCx<'test> {
257257
Assembly => self.run_assembly_test(),
258258
JsDocTest => self.run_js_doc_test(),
259259
CoverageMap => self.run_coverage_map_test(),
260-
RunCoverage => self.run_coverage_test(),
260+
CoverageRun => self.run_coverage_run_test(),
261261
}
262262
}
263263

@@ -510,7 +510,7 @@ impl<'test> TestCx<'test> {
510510
}
511511
}
512512

513-
fn run_coverage_test(&self) {
513+
fn run_coverage_run_test(&self) {
514514
let should_run = self.run_if_enabled();
515515
let proc_res = self.compile_test(should_run, Emit::None);
516516

@@ -549,7 +549,7 @@ impl<'test> TestCx<'test> {
549549
let mut profraw_paths = vec![profraw_path];
550550
let mut bin_paths = vec![self.make_exe_name()];
551551

552-
if self.config.suite == "run-coverage-rustdoc" {
552+
if self.config.suite == "coverage-run-rustdoc" {
553553
self.run_doctests_for_coverage(&mut profraw_paths, &mut bin_paths);
554554
}
555555

@@ -2193,7 +2193,7 @@ impl<'test> TestCx<'test> {
21932193
|| self.is_vxworks_pure_static()
21942194
|| self.config.target.contains("bpf")
21952195
|| !self.config.target_cfg().dynamic_linking
2196-
|| matches!(self.config.mode, CoverageMap | RunCoverage)
2196+
|| matches!(self.config.mode, CoverageMap | CoverageRun)
21972197
{
21982198
// We primarily compile all auxiliary libraries as dynamic libraries
21992199
// to avoid code size bloat and large binaries as much as possible
@@ -2395,7 +2395,7 @@ impl<'test> TestCx<'test> {
23952395
}
23962396
}
23972397
DebugInfo => { /* debuginfo tests must be unoptimized */ }
2398-
CoverageMap | RunCoverage => {
2398+
CoverageMap | CoverageRun => {
23992399
// Coverage mappings and coverage reports are affected by
24002400
// optimization level, so they ignore the optimize-tests
24012401
// setting and set an optimization level in their mode's
@@ -2478,7 +2478,7 @@ impl<'test> TestCx<'test> {
24782478
// by `compile-flags`.
24792479
rustc.arg("-Copt-level=2");
24802480
}
2481-
RunCoverage => {
2481+
CoverageRun => {
24822482
rustc.arg("-Cinstrument-coverage");
24832483
// Coverage reports are sometimes sensitive to optimizations,
24842484
// and the current snapshots assume `opt-level=2` unless
File renamed without changes.

tests/coverage/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ The tests in this directory are shared by two different test modes, and can be
22
run in multiple different ways:
33

44
- `./x.py test coverage-map` (compiles to LLVM IR and checks coverage mappings)
5-
- `./x.py test run-coverage` (runs a test binary and checks its coverage report)
6-
- `./x.py test coverage` (runs both `coverage-map` and `run-coverage`)
5+
- `./x.py test coverage-run` (runs a test binary and checks its coverage report)
6+
- `./x.py test coverage` (runs both `coverage-map` and `coverage-run`)
77

88
## Maintenance note
99

1010
These tests can be sensitive to small changes in MIR spans or MIR control flow,
1111
especially in HIR-to-MIR lowering or MIR optimizations.
1212

1313
If you haven't touched the coverage code directly, and the tests still pass in
14-
`run-coverage` mode, then it should usually be OK to just re-bless the mappings
14+
`coverage-run` mode, then it should usually be OK to just re-bless the mappings
1515
as necessary with `./x.py test coverage-map --bless`, without worrying too much
1616
about the exact changes.

0 commit comments

Comments
 (0)