pub struct TestToml {
pub test: Option<TestMeta>,
pub setup: Option<SetupSection>,
pub tests: Vec<TestDef>,
pub steps: Vec<StepDef>,
}Expand description
Parsed test.toml — the unified test definition format.
Fields§
§test: Option<TestMeta>§setup: Option<SetupSection>§tests: Vec<TestDef>§steps: Vec<StepDef>Implementations§
Source§impl TestToml
impl TestToml
Sourcepub fn parse(path: &Path) -> Result<Self>
pub fn parse(path: &Path) -> Result<Self>
Read and deserialize a test.toml file, then validate it.
Sourcepub fn validate(&self, path: &Path) -> Result<()>
pub fn validate(&self, path: &Path) -> Result<()>
Validate structural invariants after deserialization.
Most field-level validation is handled by serde (the tagged enum rejects missing required fields at parse time). This only checks cross-field invariants that serde can’t express.
Sourcepub fn is_lifecycle(&self) -> bool
pub fn is_lifecycle(&self) -> bool
True if this is a lifecycle test (uses [[steps]] instead of [[tests]]).
Sourcepub fn needs_browser(&self) -> bool
pub fn needs_browser(&self) -> bool
True if this test requires a browser VM image.
Sourcepub fn ram_override(&self) -> Option<u32>
pub fn ram_override(&self) -> Option<u32>
Explicit RAM override (MB) from test metadata, if set.
Sourcepub fn requires_sudo(&self) -> bool
pub fn requires_sudo(&self) -> bool
File-level [test] requires_sudo flag.
Sourcepub fn name_or_default(&self, path: &Path) -> String
pub fn name_or_default(&self, path: &Path) -> String
The test name from test metadata, or the file stem as a fallback.
Sourcepub fn referenced_services(&self) -> Vec<String>
pub fn referenced_services(&self) -> Vec<String>
All services referenced: from setup.services + any add steps.
Sourcepub fn quadlet_files(&self) -> Vec<String>
pub fn quadlet_files(&self) -> Vec<String>
Quadlet files declared in [setup].
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TestToml
impl<'de> Deserialize<'de> for TestToml
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
Auto Trait Implementations§
impl Freeze for TestToml
impl RefUnwindSafe for TestToml
impl Send for TestToml
impl Sync for TestToml
impl Unpin for TestToml
impl UnsafeUnpin for TestToml
impl UnwindSafe for TestToml
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