rtest - Resource based test framework
There are many unit-test frameworks in rust. This framework focuses on integration-testing, that means external software, not necessarily written in rust.
rtest works by using stateful resources.
It uses macros to build a executable binary that can handle all your filters and returns a nice output.
Imagine you are hosting a webshop and want to verify it works with integration-tests.
const SHOP: &str = "http://shop.example.com";
async
async
async
async
The test framework will know that in order to test the check_order function it first needs to have a Order.
But the only way to generate such a order is through the place_order test.
cancel_order will consume the order and no longer make it useable.
Yes, you can trick it by removing all tests that generate an Order - the framework will notice that on runtime and fail.
It might be possible that multiple routes are valid to test all functions, in case of an error the route it took will be dumped.
Let's assume checking an order with water will fail.
The framework might decide to create another Order with pizza because it cannot verify deletion otherwise, tests might be executed multiple times.
[✓] 4/4 dos.rs
[✓] 6/6 reviews.rs
[x] 1/5 sqlinjection.rs
[x] 1/3 main.rs
Path: place_order(order) -> check_order(order) -> cancel_order(order)
Features:
- Allow any Input/Output Resources (up to 5)
- Custom Errors
- Custom Context (though rarely needed)
- Reorder execution and no longer depend on random execution model
- Multithread support
- Async Support
- Automatically create new Resources on deband
- implement
#[setup]macro to create optional function to generate Ressource if necessary - Capture Panics (needed for asserts)
- Capture println
- Capture logs