Skip to main content

TestToml

Struct TestToml 

Source
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

Source

pub fn parse(path: &Path) -> Result<Self>

Read and deserialize a test.toml file, then validate it.

Source

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.

Source

pub fn is_lifecycle(&self) -> bool

True if this is a lifecycle test (uses [[steps]] instead of [[tests]]).

Source

pub fn needs_browser(&self) -> bool

True if this test requires a browser VM image.

Source

pub fn ram_override(&self) -> Option<u32>

Explicit RAM override (MB) from test metadata, if set.

Source

pub fn requires_sudo(&self) -> bool

File-level [test] requires_sudo flag.

Source

pub fn name_or_default(&self, path: &Path) -> String

The test name from test metadata, or the file stem as a fallback.

Source

pub fn referenced_services(&self) -> Vec<String>

All services referenced: from setup.services + any add steps.

Source

pub fn quadlet_files(&self) -> Vec<String>

Quadlet files declared in [setup].

Trait Implementations§

Source§

impl Debug for TestToml

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TestToml

Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V