#test-collector

test-collector-utils

A utils libraty for test collector

2 releases

Uses new Rust 2021

0.1.2 Jun 17, 2022
0.1.0 May 28, 2022

36 downloads per month
Used in 2 crates

MIT/Apache

3KB

test-collector-derive will give you '#[collect_test]' which you can use to collect the tests this lib using inventory

    #[collect_test]
    #[test]
    pub fn sync_test_success() {
        println!("Executed sync!");
        assert_eq!(true, true);
    }

    #[collect_test(async)]
    #[actix_web::test]
    pub async fn async_test_success() {
        let client = reqwest::Client::builder()
            .build()
            .expect("error during client build");
        let response = client.get("http://localhost:9090/").send().await;
        assert!(response.is_ok());
    }

test-collector-lib introduce custom test runner. You will need to create your own main function and in Cargo.toml of you project add this with needed name and path:

[[test]]
name = "integration"
path = "integration-tests/main.rs"
harness = false

example of the main can be found in test-collector-lib/src/lib.rs:88

Dependencies

~240–650KB
~15K SLoC