Awesome Rust Testing
WANT TO HELP?? please help up by adding more things or even better: evaluating the things on the list
- Are the things still maintained? Can we add badges here? short descriptions? Quality Control
Books
Crates
Turns out, there is an entire subcategory on crates.io Development tools::Testing
Extensions
- rstest - Fixture-based test framework for Rust
- ntest - Testing framework for rust enhancing the built-in library with some useful features
- nextest - test runner
- assay - super powered testing macro
Mocking
- MockAll (Examples, Derive Macro)
- Mocktopus
- mock_derive
- mockers
- simulacrum
- Mockiato
- mockito(http mocks)
- faux
- wiremock
- unimock
Snapshop Testing
Matchers
Generated output matchers
- specker A framework to collect test inputs and expected outputs from multiple files and check them. Used to test code generation (last update 2017, needs way more examples)
Diffing
Assertions
FFI Testing
Coverage
Fuzzing
- see the book section
- afl.rs
- cargo-fuzz
- honggfuzz
Property Testing
-
https://crates.io/crates/quickcheck https://crates.io/crates/quickcheck_macros
-
https://crates.io/crates/proptest https://crates.io/crates/proptest-derive
Parameterized Testing
Mutation Testing
Harnesses/Frameworks
Test Generation
- test-generator creates tests based on files
Model Based Testing
Testing Webservices
More Cargo Tools
- Testing feature combinations: cargo featomatic (incomplete, help welcome)
- "Testing" licenses https://github.com/Nemo157/cargo-lichking
- Look for possible security vulnerabilities: https://github.com/RustSec/cargo-audit
Testing Documentation
Testing CommandLine Applications
- https://crates.io/crates/assert_cmd
- assert_cli: the sucessor is assert_cmd
CI
- crate-ci book contains general suggestions on maintaining high crate quality
- Azure Pipelines contains great templates for cross-platform testing
BlogPosts
- How Rust is Tested
- Mocking libraries comparison
- On Mocking Rust
- Mocking in Rust with conditional compilation
- How to Mock Time in Rust Tests and Cargo Gotchas We Met
- Kcov and tarpaulin code coverage
- Tutorial: How to collect test coverages for Rust project
- Rust Code Coverage Guide: kcov + Travis CI + Codecov / Coveralls
- Performance Testing on Travis CI
- Coverage with kcov + Travis CI + Codecov / Coveralls
- Testing a Rust Command Line Tool(for assert_cli)
- Rust Mutation Testing(for mutagem)
- Testing With Unused Arguments