pub struct BuilderTester { /* private fields */ }Expand description
A concurrent builder testing utility that can run tests against multiple files with timeout support.
The BuilderTester provides functionality to test builders against a directory
of files with specific extensions, comparing actual output against expected
results stored in JSON files, with configurable timeout protection.
Implementations§
Source§impl BuilderTester
impl BuilderTester
Sourcepub fn new<P: AsRef<Path>>(root: P) -> Self
pub fn new<P: AsRef<Path>>(root: P) -> Self
Creates a new builder tester with the specified root directory and default 10-second timeout.
Sourcepub fn with_extension(self, extension: impl ToString) -> Self
pub fn with_extension(self, extension: impl ToString) -> Self
Adds a file extension to test against.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sourcepub fn run_tests<L, B>(self, builder: &B) -> Result<(), OakError>
pub fn run_tests<L, B>(self, builder: &B) -> Result<(), OakError>
Run tests for the given builder against all files in the root directory with the specified extensions.
§Arguments
builder: The builder to test.
§Examples
ⓘ
use oak_core::helpers::building::BuilderTester;
let tester = BuilderTester::new("tests/builder").with_extension("valkyrie");
tester.run_tests(&my_builder)?;Auto Trait Implementations§
impl Freeze for BuilderTester
impl RefUnwindSafe for BuilderTester
impl Send for BuilderTester
impl Sync for BuilderTester
impl Unpin for BuilderTester
impl UnwindSafe for BuilderTester
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