use crate::{
build_manager::BuildManager, parser::Comments, per_test_config::TestConfig, Config, Errored,
};
use std::{
panic::{RefUnwindSafe, UnwindSafe},
process::{Command, Output},
};
#[cfg(feature = "rustc")]
pub mod edition;
#[cfg(feature = "rustc")]
pub mod revision_args;
#[cfg(feature = "rustc")]
pub mod run;
pub mod rustfix;
pub trait Flag: Send + Sync + UnwindSafe + RefUnwindSafe + std::fmt::Debug {
fn clone_inner(&self) -> Box<dyn Flag>;
fn apply(
&self,
_cmd: &mut Command,
_config: &TestConfig,
_build_manager: &BuildManager,
) -> Result<(), Errored> {
Ok(())
}
fn test_condition(&self, _config: &Config, _comments: &Comments, _revision: &str) -> bool {
false
}
fn post_test_action(
&self,
_config: &TestConfig,
_output: &Output,
_build_manager: &BuildManager,
) -> Result<(), Errored> {
Ok(())
}
fn must_be_unique(&self) -> bool;
}
impl Flag for () {
fn clone_inner(&self) -> Box<dyn Flag> {
Box::new(())
}
fn must_be_unique(&self) -> bool {
true
}
}
impl Clone for Box<dyn Flag> {
fn clone(&self) -> Self {
self.clone_inner()
}
}