derive Default trait for compiletest::common::Config

This commit is contained in:
ozkanonur 2023-05-20 14:40:46 +03:00
parent c36b2092bb
commit 6a347322a9
2 changed files with 11 additions and 3 deletions

View File

@ -16,19 +16,21 @@ pub enum ShouldPanic {
}
/// Whether should console output be colored or not
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Default, Debug)]
pub enum ColorConfig {
#[default]
AutoColor,
AlwaysColor,
NeverColor,
}
/// Format of the test results output
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
pub enum OutputFormat {
/// Verbose output
Pretty,
/// Quiet output
#[default]
Terse,
/// JSON output
Json,

View File

@ -69,6 +69,12 @@ pub enum Mode {
}
}
impl Default for Mode {
fn default() -> Self {
Mode::Ui
}
}
impl Mode {
pub fn disambiguator(self) -> &'static str {
// Pretty-printing tests could run concurrently, and if they do,
@ -125,7 +131,7 @@ pub enum PanicStrategy {
}
/// Configuration for compiletest
#[derive(Debug, Clone)]
#[derive(Debug, Default, Clone)]
pub struct Config {
/// `true` to overwrite stderr/stdout files instead of complaining about changes in output.
pub bless: bool,