Testing in rust: are there any useful crates, macros etc that you use to make this easier and less verbose?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • rstest

    Fixture-based test framework for Rust

  • bolero

    property testing and verification front-end for Rust (by camshaft)

  • This one is nice too. https://github.com/camshaft/bolero

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • kani

    Kani Rust Verifier

  • It gives u the advantage to develop harnesses that can be used for verification using Kani - https://github.com/model-checking/kani

  • lets_expect

    Clean tests in Rust

  • For that reason I've recently created lets_expect. It's a procedural macro that introduces its own syntax for unit tests inspired by RSpec's one-liner syntax. I think it looks very clean and concise. I consider it experimental at this point, so I haven't announced it anywhere yet, but I use it to test some of my Rust code. Basic structure is as follows:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts