Struct sqlness::Runner

source ·
pub struct Runner<E: EnvController> { /* private fields */ }
Expand description

The entrypoint of this crate.

To run your integration test cases, simply new a Runner and run it.

async fn run_integration_test() {
    let runner = Runner::new(root_path, env).await;
    runner.run().await;
}

For more detailed explaination, refer to crate level documentment.

Implementations§

source§

impl<E: EnvController> Runner<E>

source

pub async fn try_new<P: AsRef<Path>>(
config_path: P,
env_controller: E
) -> Result<Self, SqlnessError>

source

pub async fn new_with_config(
config: Config,
env_controller: E
) -> Result<Self, SqlnessError>

Examples found in repository?
examples/bad.rs (line 57)
51
52
53
54
55
56
57
58
59
60
61
62
63
64
async fn main() {
    let env = MyController;
    let config = ConfigBuilder::default()
        .case_dir("examples/bad-case".to_string())
        .build()
        .unwrap();
    let runner = Runner::new_with_config(config, env)
        .await
        .expect("Create Runner failed");

    println!("Run testcase...");

    runner.run().await.unwrap();
}
More examples
Hide additional examples
examples/basic.rs (line 52)
46
47
48
49
50
51
52
53
54
55
56
57
58
59
async fn main() {
    let env = MyController;
    let config = ConfigBuilder::default()
        .case_dir("examples/basic-case".to_string())
        .build()
        .unwrap();
    let runner = Runner::new_with_config(config, env)
        .await
        .expect("Create Runner failed");

    println!("Run testcase...");

    runner.run().await.unwrap();
}
source

pub async fn run(&self) -> Result<(), SqlnessError>

Examples found in repository?
examples/bad.rs (line 63)
51
52
53
54
55
56
57
58
59
60
61
62
63
64
async fn main() {
    let env = MyController;
    let config = ConfigBuilder::default()
        .case_dir("examples/bad-case".to_string())
        .build()
        .unwrap();
    let runner = Runner::new_with_config(config, env)
        .await
        .expect("Create Runner failed");

    println!("Run testcase...");

    runner.run().await.unwrap();
}
More examples
Hide additional examples
examples/basic.rs (line 58)
46
47
48
49
50
51
52
53
54
55
56
57
58
59
async fn main() {
    let env = MyController;
    let config = ConfigBuilder::default()
        .case_dir("examples/basic-case".to_string())
        .build()
        .unwrap();
    let runner = Runner::new_with_config(config, env)
        .await
        .expect("Create Runner failed");

    println!("Run testcase...");

    runner.run().await.unwrap();
}

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for Runner<E>where
E: RefUnwindSafe,

§

impl<E> Send for Runner<E>where
E: Send,

§

impl<E> Sync for Runner<E>where
E: Sync,

§

impl<E> Unpin for Runner<E>where
E: Unpin,

§

impl<E> UnwindSafe for Runner<E>where
E: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.