Trait deqp_runner::TestCommand
source · pub trait TestCommand: Send + Sync {
Show 22 methods
// Required methods
fn name(&self) -> &str;
fn config(&self) -> &TestConfiguration;
fn prepare(
&self,
caselist_state: &CaselistState,
tests: &[&TestCase]
) -> Result<Command>;
fn parse_results(
&self,
caselist_state: &CaselistState,
tests: &[&TestCase],
stdout: TimeoutChildStdout<'_>,
timer: Option<Timer>
) -> Result<CaselistResult>;
// Provided methods
fn see_more(&self, _name: &str, _caselist_state: &CaselistState) -> String { ... }
fn skips(&self) -> &RegexSet { ... }
fn flakes(&self) -> &RegexSet { ... }
fn baseline(&self) -> &RunnerResults { ... }
fn baseline_status(&self, test: &str) -> Option<RunnerStatus> { ... }
fn translate_result(
&self,
result: &TestResult,
caselist_state: &CaselistState
) -> RunnerStatus { ... }
fn skip_test(&self, test: &str) -> bool { ... }
fn handle_result(
&self,
_caselist_state: &CaselistState,
_result: &TestResult,
_status: &RunnerStatus
) -> Result<()> { ... }
fn log_path(
&self,
caselist_state: &CaselistState,
_tests: &[&TestCase]
) -> Result<PathBuf> { ... }
fn should_save_log(
&self,
_caselist_state: &CaselistState,
_tests: &[&TestCase]
) -> bool { ... }
fn clean(
&self,
_caselist_state: &CaselistState,
_tests: &[&TestCase],
_results: &[RunnerResult]
) -> Result<()> { ... }
fn handle_exit_status(
&self,
code: Option<i32>,
some_result: Option<&mut TestResult>
) { ... }
fn run(
&self,
caselist_state: &CaselistState,
tests: &[&TestCase]
) -> Result<Vec<RunnerResult>> { ... }
fn run_caselist_and_flake_detect(
&self,
caselist: &[TestCase],
caselist_state: &mut CaselistState
) -> Result<Vec<RunnerResult>> { ... }
fn process_caselist(
&self,
tests: Vec<TestCase>,
caselist_id: u32
) -> Result<Vec<RunnerResult>> { ... }
fn split_tests_to_groups(
&self,
tests: Vec<TestCase>,
tests_per_group: usize,
min_tests_per_group: usize,
sub_config: &SubRunConfig,
include_filters: &[RegexSet]
) -> Result<Vec<(&dyn TestCommand, Vec<TestCase>)>>
where Self: Sized { ... }
fn caselist_file_path(
&self,
caselist_state: &CaselistState,
suffix: &str
) -> Result<PathBuf> { ... }
fn prefix(&self) -> &str { ... }
}
Expand description
This is implemented by each supported test suite.
Required Methods§
sourcefn name(&self) -> &str
fn name(&self) -> &str
Must be implemented, returns the name of this TestCommand for logging errors.
sourcefn config(&self) -> &TestConfiguration
fn config(&self) -> &TestConfiguration
Must be implemented, returns the shared test configuration for this TestCommand.
fn prepare( &self, caselist_state: &CaselistState, tests: &[&TestCase] ) -> Result<Command>
sourcefn parse_results(
&self,
caselist_state: &CaselistState,
tests: &[&TestCase],
stdout: TimeoutChildStdout<'_>,
timer: Option<Timer>
) -> Result<CaselistResult>
fn parse_results( &self, caselist_state: &CaselistState, tests: &[&TestCase], stdout: TimeoutChildStdout<'_>, timer: Option<Timer> ) -> Result<CaselistResult>
Invokes the test suite’s result parser on stdout.
Provided Methods§
sourcefn see_more(&self, _name: &str, _caselist_state: &CaselistState) -> String
fn see_more(&self, _name: &str, _caselist_state: &CaselistState) -> String
Optional (recommended) hook for logging on failure to point the user to more information about a specific failure (caselist, log file, etc).
fn skips(&self) -> &RegexSet
fn flakes(&self) -> &RegexSet
fn baseline(&self) -> &RunnerResults
fn baseline_status(&self, test: &str) -> Option<RunnerStatus>
fn translate_result( &self, result: &TestResult, caselist_state: &CaselistState ) -> RunnerStatus
fn skip_test(&self, test: &str) -> bool
sourcefn handle_result(
&self,
_caselist_state: &CaselistState,
_result: &TestResult,
_status: &RunnerStatus
) -> Result<()>
fn handle_result( &self, _caselist_state: &CaselistState, _result: &TestResult, _status: &RunnerStatus ) -> Result<()>
Used for doing any extra logging that might need to be done for failed tests.
fn log_path( &self, caselist_state: &CaselistState, _tests: &[&TestCase] ) -> Result<PathBuf>
sourcefn should_save_log(
&self,
_caselist_state: &CaselistState,
_tests: &[&TestCase]
) -> bool
fn should_save_log( &self, _caselist_state: &CaselistState, _tests: &[&TestCase] ) -> bool
Overrideable hook for whether a log should be always be saved. Sometimes there’s a test that collects general implementation details (API version, extensions) that might be useful for the user to always have, for sanity-checking that the run tested what they intended.
sourcefn clean(
&self,
_caselist_state: &CaselistState,
_tests: &[&TestCase],
_results: &[RunnerResult]
) -> Result<()>
fn clean( &self, _caselist_state: &CaselistState, _tests: &[&TestCase], _results: &[RunnerResult] ) -> Result<()>
Hook for cleaning up anything necessary after running a test binary (like removing logs that shouldn’t be saved for all the passing tests).
sourcefn handle_exit_status(
&self,
code: Option<i32>,
some_result: Option<&mut TestResult>
)
fn handle_exit_status( &self, code: Option<i32>, some_result: Option<&mut TestResult> )
By default, sets the last test result with Crash if the binary crashed after emitting test results. Can also be overridden if the exit status is what determines test success/failure.
sourcefn run(
&self,
caselist_state: &CaselistState,
tests: &[&TestCase]
) -> Result<Vec<RunnerResult>>
fn run( &self, caselist_state: &CaselistState, tests: &[&TestCase] ) -> Result<Vec<RunnerResult>>
Invokes the test command on a list of testcases. This is common code because of the trickiness in handling timeouts, whether logs should be saved, etc.
sourcefn run_caselist_and_flake_detect(
&self,
caselist: &[TestCase],
caselist_state: &mut CaselistState
) -> Result<Vec<RunnerResult>>
fn run_caselist_and_flake_detect( &self, caselist: &[TestCase], caselist_state: &mut CaselistState ) -> Result<Vec<RunnerResult>>
Loop invoking the list of cases, where we run again to check if it was just a flake if an unexpected result occurs.