diff --git a/library/test/src/options.rs b/library/test/src/options.rs index 75ec0b616e1..3eaad59474a 100644 --- a/library/test/src/options.rs +++ b/library/test/src/options.rs @@ -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, diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 9059a145b43..1dd8cf04b25 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -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,