pub struct TestContext {
pub package_name: Option<String>,
pub target_type: TestTargetType,
pub module_path: Vec<String>,
pub test_name: Option<String>,
pub features: Vec<String>,
pub env_vars: Vec<(String, String)>,
pub working_dir: Option<PathBuf>,
}
Expand description
Enhanced test context for precise command generation
Fields§
§package_name: Option<String>
Package name for the test
target_type: TestTargetType
Target type (lib, bin, test, etc.)
module_path: Vec<String>
Full module path to the test (e.g., [“middleware”, “csrf”, “tests”])
test_name: Option<String>
Specific test function name
features: Vec<String>
Required feature flags
env_vars: Vec<(String, String)>
Environment variables needed for the test
working_dir: Option<PathBuf>
Working directory for the test command
Implementations§
Source§impl TestContext
impl TestContext
Sourcepub fn module_path_string(&self) -> Option<String>
pub fn module_path_string(&self) -> Option<String>
Get the full module path as a string (e.g., “middleware::csrf::tests”)
Sourcepub fn full_test_path(&self) -> Option<String>
pub fn full_test_path(&self) -> Option<String>
Get the full test path including module and test name
Sourcepub fn is_precise(&self) -> bool
pub fn is_precise(&self) -> bool
Check if this context has enough information for a precise test command
Trait Implementations§
Source§impl Clone for TestContext
impl Clone for TestContext
Source§fn clone(&self) -> TestContext
fn clone(&self) -> TestContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TestContext
impl Debug for TestContext
Source§impl Default for TestContext
impl Default for TestContext
Source§impl<'de> Deserialize<'de> for TestContext
impl<'de> Deserialize<'de> for TestContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TestContext
impl PartialEq for TestContext
Source§impl Serialize for TestContext
impl Serialize for TestContext
impl Eq for TestContext
impl StructuralPartialEq for TestContext
Auto Trait Implementations§
impl Freeze for TestContext
impl RefUnwindSafe for TestContext
impl Send for TestContext
impl Sync for TestContext
impl Unpin for TestContext
impl UnwindSafe for TestContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.