From 500b9d2c322ad100d8ff6b2bb1ca2c512f8f2e33 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Fri, 21 Apr 2023 07:32:45 +0000 Subject: [PATCH] Support [profile.default-llvm-cov] Depends on https://github.com/taiki-e/cargo-llvm-cov/pull/259 This is done similarly for miri and makes sense since both increase running times. --- cargo-nextest/src/dispatch.rs | 2 ++ nextest-runner/src/config/config_impl.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cargo-nextest/src/dispatch.rs b/cargo-nextest/src/dispatch.rs index 7c1aa3ce292..e91a7dd5d0e 100644 --- a/cargo-nextest/src/dispatch.rs +++ b/cargo-nextest/src/dispatch.rs @@ -1128,6 +1128,8 @@ impl App { // https://github.com/rust-lang/miri/pull/2398#issuecomment-1190747685 if std::env::var_os("MIRI_SYSROOT").is_some() { NextestConfig::DEFAULT_MIRI_PROFILE + } else if std::env::var_os("CARGO_LLVM_COV").is_some() { + NextestConfig::DEFAULT_LLVM_COV_PROFILE } else { NextestConfig::DEFAULT_PROFILE } diff --git a/nextest-runner/src/config/config_impl.rs b/nextest-runner/src/config/config_impl.rs index 370cac6b6ba..bfc0f240473 100644 --- a/nextest-runner/src/config/config_impl.rs +++ b/nextest-runner/src/config/config_impl.rs @@ -73,9 +73,12 @@ impl NextestConfig { /// The name of the default profile used for miri. pub const DEFAULT_MIRI_PROFILE: &'static str = "default-miri"; + /// The name of the default profile used for cargo-llvm-cov + pub const DEFAULT_LLVM_COV_PROFILE: &'static str = "default-llvm-cov"; + /// A list containing the names of the Nextest defined reserved profile names. pub const DEFAULT_PROFILES: &'static [&'static str] = - &[Self::DEFAULT_PROFILE, Self::DEFAULT_MIRI_PROFILE]; + &[Self::DEFAULT_PROFILE, Self::DEFAULT_MIRI_PROFILE, Self::DEFAULT_LLVM_COV_PROFILE]; /// Reads the nextest config from the given file, or if not specified from `.config/nextest.toml` /// in the workspace root.