| Crates.io | autokani |
| lib.rs | autokani |
| version | 0.0.2 |
| created_at | 2025-01-07 02:09:25.538229+00 |
| updated_at | 2025-01-07 03:20:21.773672+00 |
| description | A simple macro for generating kani harness. |
| homepage | |
| repository | https://github.com/mirthfulLee/autokani |
| max_upload_size | |
| id | 1506558 |
| size | 21,570 |
Generate test harness for target function accoding to its signature. The test harness will be checked by kani.
The generated harness is capable to catch some common errors, e.g., arithmetic overflow, illegal raw pointer dereference, illegal memory access, run-time panic.
Support for target struct:
Add #[kani_arbitrary] to target struct or add #[extend_arbitrary] to the basic impl block of target struct;
One struct can only deploy one of
#[kani_arbitrary]or#[extend_arbitrary];#[extend_arbitrary]is more recommended for less false alarms.
Run the kani harness:
#[kani_test] for target functioncargo kani --harness check_{function_name} for specific target or cargo kani for all selected functions.If the code involves raw pointers, use
cargo kani -Z mem-predicates.