pub struct GenerationTest {
pub name: String,
pub spec: Value,
pub config_overrides: Option<GeneratorConfigOverrides>,
pub test_scenarios: Vec<TestScenario>,
pub run_tests: bool,
pub compile: bool,
pub extra_dependencies: Vec<(String, String)>,
}Expand description
Configuration for a generation test
Fields§
§name: StringName of the test (used for project name)
spec: ValueOpenAPI specification
config_overrides: Option<GeneratorConfigOverrides>Generator configuration (optional overrides)
test_scenarios: Vec<TestScenario>Test scenarios to generate
run_tests: boolWhether to run tests after compilation (only if compilation is enabled)
compile: boolWhether to compile the generated code (false by default, must opt-in)
extra_dependencies: Vec<(String, String)>Additional dependencies for Cargo.toml
Implementations§
Source§impl GenerationTest
impl GenerationTest
Sourcepub fn new(name: impl Into<String>, spec: Value) -> Self
pub fn new(name: impl Into<String>, spec: Value) -> Self
Create a new test with the given name and spec
Sourcepub fn with_compilation(self) -> Self
pub fn with_compilation(self) -> Self
Enable compilation for this test
Sourcepub fn with_env_compilation(self) -> Self
pub fn with_env_compilation(self) -> Self
Enable compilation only if OPENAPI_GEN_COMPILE_TESTS is set
Sourcepub fn with_scenario(self, scenario: TestScenario) -> Self
pub fn with_scenario(self, scenario: TestScenario) -> Self
Add a test scenario
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GenerationTest
impl RefUnwindSafe for GenerationTest
impl Send for GenerationTest
impl Sync for GenerationTest
impl Unpin for GenerationTest
impl UnwindSafe for GenerationTest
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