Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
11a64a1
don't panic in BorrowedCursor::write
zachs18 Sep 2, 2023
eed8918
bump some deps
klensy Nov 7, 2023
f2fd8ad
Document clippy_config in nightly-rustc docs
Alexendoo Nov 7, 2023
fcdd99e
Add -Zcross-crate-inline-threshold=yes
saethlin Nov 7, 2023
783d4b8
Clarify `space_between`.
nnethercote Oct 31, 2023
438b9a6
More tests for token stream pretty-printing with adjacent punctuation.
nnethercote Oct 31, 2023
a573880
coverage: Rename the `run-coverage` test mode to `coverage-run`
Zalathar Nov 2, 2023
b9b7982
Add AIX platform-support doc
ecnelises Aug 1, 2023
93b1c1f
handle the case when the change-id isn't found
onur-ozkan Oct 27, 2023
820e833
bootstrap: improve `fn check_version`
onur-ozkan Oct 27, 2023
966c102
bootstrap: add more detail on change-id comments
onur-ozkan Nov 7, 2023
ca1ca41
Rollup merge of #114316 - ecnelises:aix_doc, r=workingjubilee
fmease Nov 8, 2023
7b11383
Rollup merge of #115460 - zachs18:borrowedcursor_write_no_panic, r=dt…
fmease Nov 8, 2023
cb6a53c
Rollup merge of #117263 - onur-ozkan:change-id-fix, r=saethlin
fmease Nov 8, 2023
823395e
Rollup merge of #117650 - saethlin:inline-me-please, r=davidtwco
fmease Nov 8, 2023
d27beed
Rollup merge of #117663 - klensy:bump-deps, r=davidtwco
fmease Nov 8, 2023
733e271
Rollup merge of #117667 - Alexendoo:doc-clippy-config, r=albertlarsan68
fmease Nov 8, 2023
01ff59a
Rollup merge of #117698 - nnethercote:space_between-2, r=petrochenkov
fmease Nov 8, 2023
d180529
Rollup merge of #117700 - Zalathar:rename-run-coverage, r=onur-ozkan
fmease Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
Zalathar committed Nov 8, 2023
commit a5738803735db820f0c4e1d45edf706526308cf6
22 changes: 11 additions & 11 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ impl Step for Coverage {

fn run(self, builder: &Builder<'_>) {
self.run_unified_suite(builder, CoverageMap::MODE);
self.run_unified_suite(builder, RunCoverage::MODE);
self.run_unified_suite(builder, CoverageRun::MODE);
}
}

Expand All @@ -1444,16 +1444,16 @@ coverage_test_alias!(CoverageMap {
default: true,
only_hosts: false,
});
coverage_test_alias!(RunCoverage {
alias_and_mode: "run-coverage",
coverage_test_alias!(CoverageRun {
alias_and_mode: "coverage-run",
default: true,
only_hosts: true,
});

host_test!(RunCoverageRustdoc {
path: "tests/run-coverage-rustdoc",
mode: "run-coverage",
suite: "run-coverage-rustdoc"
host_test!(CoverageRunRustdoc {
path: "tests/coverage-run-rustdoc",
mode: "coverage-run",
suite: "coverage-run-rustdoc"
});

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

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

if !builder.config.dry_run()
&& (matches!(suite, "run-make" | "run-make-fulldeps") || mode == "run-coverage")
&& (matches!(suite, "run-make" | "run-make-fulldeps") || mode == "coverage-run")
{
// The llvm/bin directory contains many useful cross-platform
// tools. Pass the path to run-make tests so they can use them.
// (The run-coverage tests also need these tools to process
// (The coverage-run tests also need these tools to process
// coverage reports.)
let llvm_bin_path = llvm_config
.parent()
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ impl<'a> Builder<'a> {
test::RunPassValgrind,
test::Coverage,
test::CoverageMap,
test::RunCoverage,
test::CoverageRun,
test::MirOpt,
test::Codegen,
test::CodegenUnits,
Expand All @@ -740,7 +740,7 @@ impl<'a> Builder<'a> {
test::CodegenCranelift,
test::CodegenGCC,
test::Rustdoc,
test::RunCoverageRustdoc,
test::CoverageRunRustdoc,
test::Pretty,
test::Crate,
test::CrateLibrustc,
Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ string_enum! {
MirOpt => "mir-opt",
Assembly => "assembly",
CoverageMap => "coverage-map",
RunCoverage => "run-coverage",
CoverageRun => "coverage-run",
}
}

Expand All @@ -91,7 +91,7 @@ impl Mode {
// Coverage tests use the same test files for multiple test modes,
// so each mode should have a separate output directory.
match self {
CoverageMap | RunCoverage => self.to_str(),
CoverageMap | CoverageRun => self.to_str(),
_ => "",
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,11 +911,11 @@ pub fn make_test_description<R: Read>(
let mut should_fail = false;

let extra_directives: &[&str] = match config.mode {
// The run-coverage tests are treated as having these extra directives,
// The coverage-run tests are treated as having these extra directives,
// without needing to specify them manually in every test file.
// (Some of the comments below have been copied over from
// `tests/run-make/coverage-reports/Makefile`, which no longer exists.)
Mode::RunCoverage => {
Mode::CoverageRun => {
&[
"needs-profiler-support",
// FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
Expand Down
14 changes: 7 additions & 7 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::common::{Assembly, Incremental, JsDocTest, MirOpt, RunMake, RustdocJs
use crate::common::{Codegen, CodegenUnits, DebugInfo, Debugger, Rustdoc};
use crate::common::{CompareMode, FailMode, PassMode};
use crate::common::{Config, TestPaths};
use crate::common::{CoverageMap, Pretty, RunCoverage, RunPassValgrind};
use crate::common::{CoverageMap, CoverageRun, Pretty, RunPassValgrind};
use crate::common::{UI_COVERAGE, UI_COVERAGE_MAP, UI_RUN_STDERR, UI_RUN_STDOUT};
use crate::compute_diff::{write_diff, write_filtered_diff};
use crate::errors::{self, Error, ErrorKind};
Expand Down Expand Up @@ -257,7 +257,7 @@ impl<'test> TestCx<'test> {
Assembly => self.run_assembly_test(),
JsDocTest => self.run_js_doc_test(),
CoverageMap => self.run_coverage_map_test(),
RunCoverage => self.run_coverage_test(),
CoverageRun => self.run_coverage_run_test(),
}
}

Expand Down Expand Up @@ -510,7 +510,7 @@ impl<'test> TestCx<'test> {
}
}

fn run_coverage_test(&self) {
fn run_coverage_run_test(&self) {
let should_run = self.run_if_enabled();
let proc_res = self.compile_test(should_run, Emit::None);

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

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

Expand Down Expand Up @@ -2193,7 +2193,7 @@ impl<'test> TestCx<'test> {
|| self.is_vxworks_pure_static()
|| self.config.target.contains("bpf")
|| !self.config.target_cfg().dynamic_linking
|| matches!(self.config.mode, CoverageMap | RunCoverage)
|| matches!(self.config.mode, CoverageMap | CoverageRun)
{
// We primarily compile all auxiliary libraries as dynamic libraries
// to avoid code size bloat and large binaries as much as possible
Expand Down Expand Up @@ -2395,7 +2395,7 @@ impl<'test> TestCx<'test> {
}
}
DebugInfo => { /* debuginfo tests must be unoptimized */ }
CoverageMap | RunCoverage => {
CoverageMap | CoverageRun => {
// Coverage mappings and coverage reports are affected by
// optimization level, so they ignore the optimize-tests
// setting and set an optimization level in their mode's
Expand Down Expand Up @@ -2478,7 +2478,7 @@ impl<'test> TestCx<'test> {
// by `compile-flags`.
rustc.arg("-Copt-level=2");
}
RunCoverage => {
CoverageRun => {
rustc.arg("-Cinstrument-coverage");
// Coverage reports are sometimes sensitive to optimizations,
// and the current snapshots assume `opt-level=2` unless
Expand Down
6 changes: 3 additions & 3 deletions tests/coverage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ The tests in this directory are shared by two different test modes, and can be
run in multiple different ways:

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

## Maintenance note

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

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