Declare a run-coverage test mode/suite in bootstrap

This commit is contained in:
Zalathar 2023-06-12 18:07:04 +10:00
parent 6b46c996e1
commit d8d09b0681
2 changed files with 11 additions and 4 deletions

View File

@ -686,6 +686,7 @@ macro_rules! describe {
test::Tidy,
test::Ui,
test::RunPassValgrind,
test::RunCoverage,
test::MirOpt,
test::Codegen,
test::CodegenUnits,

View File

@ -1319,6 +1319,8 @@ fn run(self, builder: &Builder<'_>) {
default_test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly" });
host_test!(RunCoverage { path: "tests/run-coverage", mode: "run-coverage", suite: "run-coverage" });
// For the mir-opt suite we do not use macros, as we need custom behavior when blessing.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct MirOpt {
@ -1516,7 +1518,7 @@ fn run(self, builder: &Builder<'_>) {
.arg(builder.ensure(tool::JsonDocLint { compiler: json_compiler, target }));
}
if mode == "run-make" {
if mode == "run-make" || mode == "run-coverage" {
let rust_demangler = builder
.ensure(tool::RustDemangler {
compiler,
@ -1703,17 +1705,21 @@ fn run(self, builder: &Builder<'_>) {
add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd);
}
// Only pass correct values for these flags for the `run-make` suite as it
// requires that a C++ compiler was configured which isn't always the case.
if !builder.config.dry_run() && matches!(suite, "run-make" | "run-make-fulldeps") {
if !builder.config.dry_run()
&& (matches!(suite, "run-make" | "run-make-fulldeps") || mode == "run-coverage")
{
// 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
// coverage reports.)
let llvm_bin_path = llvm_config
.parent()
.expect("Expected llvm-config to be contained in directory");
assert!(llvm_bin_path.is_dir());
cmd.arg("--llvm-bin-dir").arg(llvm_bin_path);
}
if !builder.config.dry_run() && matches!(suite, "run-make" | "run-make-fulldeps") {
// If LLD is available, add it to the PATH
if builder.config.lld_enabled {
let lld_install_root =