This project is a command line universal behavior testing tool inspired by rere.py. I was inspired by the simple, elegant solution presented in the original project to the problem of universal testing, but wanted a compiled binary for more ubiquitous and comprehensive usage. This project provides a significant extension on top of the original concept. The rere tool makes use of the bi format, a simple structured human readable binary format.
The project is split into two parts:
bi-parser
: A library crate providing functionality for validating, reading, and writing bi formatted files.rere-app
: A binary crate which uses thebi-parser
library to create the actual command line tool.
- Download the release binary or build the crate from source.
- From your project's root directory, run
rere init
, this will create:- A config at
rere/rere.toml
- A directory to store the record snapshots at
rere/snapshots/
- A test file at
rere/test.list
- A config at
- Add some shell commands to the test file (i.e.
echo "Hello World!
). - Record the expected behavior with
rere record
. This will create the.bi
snapshot file here:rere/snapshots/test.list.bi
. - Later, you can run
rere replay
to replay the test file (the defaultfail_fast
setting istrue
so the replay will report the first difference, if any, and exit).
Much more comprehensive usage documentation can be found here .
Note: All these features are configurable either through command line arguments or by manually building/editing the .toml
config file.
Several features over the original project were built into the rere.rs app, including:
- Command line tool
- Config file for persisting and tracking testing configurations
- Init command functionality for easy test structure setup and cleanup
- Dedicated snapshot and recording directory
- Ability to version snapshot files for testing history
- Basic metadata tracking
- Fast fail options for snapshot replaying
- Single line comment (
//
) support in test files
In addition, this project supports a minor extension on original the bi format:
- A signed integer marker type (
:s
)
- Ability to capture file system changes (for testing scripts that write to log files instead of to stdout)
- Additional metadata tracking
- Warnings if significant deviation from previous processing times
- Standardized readme
- Tab completions