pub struct CargoFramework { /* private fields */ }Expand description
Test framework for Rust projects using cargo nextest.
Uses cargo nextest list for test discovery and generates commands
with JUnit XML output for structured result parsing.
§Configuration
See CargoFrameworkConfig for available options including:
package: Package to test (for workspaces)features: Cargo features to enablebin: Binary target nameinclude_ignored: Include#[ignore]tests
Implementations§
Source§impl CargoFramework
impl CargoFramework
Sourcepub fn new(config: CargoFrameworkConfig) -> Self
pub fn new(config: CargoFrameworkConfig) -> Self
Creates a new cargo test framework with the given configuration.
§Example
use offload::framework::cargo::CargoFramework;
use offload::config::CargoFrameworkConfig;
let framework = CargoFramework::new(CargoFrameworkConfig {
package: Some("my-lib".into()),
features: vec!["test-utils".into()],
..Default::default()
});Trait Implementations§
Source§impl TestFramework for CargoFramework
impl TestFramework for CargoFramework
Source§fn discover<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_paths: &'life1 [PathBuf],
filters: &'life2 str,
) -> Pin<Box<dyn Future<Output = FrameworkResult<Vec<TestRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn discover<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_paths: &'life1 [PathBuf],
filters: &'life2 str,
) -> Pin<Box<dyn Future<Output = FrameworkResult<Vec<TestRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Discovers tests in the given paths. Read more
Source§fn produce_test_execution_command(
&self,
tests: &[TestInstance<'_>],
result_path: &str,
) -> Command
fn produce_test_execution_command( &self, tests: &[TestInstance<'_>], result_path: &str, ) -> Command
Generates a command to run the specified tests. Read more
Source§fn parse_results(
&self,
_output: &ExecResult,
result_file: Option<&str>,
) -> FrameworkResult<Vec<TestResult>>
fn parse_results( &self, _output: &ExecResult, result_file: Option<&str>, ) -> FrameworkResult<Vec<TestResult>>
Parses test results from command execution. Read more
Auto Trait Implementations§
impl Freeze for CargoFramework
impl RefUnwindSafe for CargoFramework
impl Send for CargoFramework
impl Sync for CargoFramework
impl Unpin for CargoFramework
impl UnsafeUnpin for CargoFramework
impl UnwindSafe for CargoFramework
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more