| Crates.io | predate |
| lib.rs | predate |
| version | 0.1.5 |
| created_at | 2024-12-05 03:14:58.59638+00 |
| updated_at | 2025-01-07 01:38:44.698037+00 |
| description | Catch bugs and performance regressions through automated system testing |
| homepage | https://github.com/Rbfinch/predate |
| repository | https://github.com/Rbfinch/predate |
| max_upload_size | |
| id | 1472840 |
| size | 145,936 |
Catch bugs and performance regressions through automated system testing
Many CLI applications take an input file and generate an output file and/or write some value(s) to standard out, with various options set by the user. predate is a simple example of how to test that the application is producing correct output given the arguments specified on the command line. Whilst there are libraries that can be used to test CLI applications, predate is a simple example of how to do this without the need for additional dependencies, and where the commands and expected output are conveniently specified in a YAML file.
predate is used to test the output of grepq (https://crates.io/crates/grepq), and record the execution time of grepq commands to avoid performance regression. Whilst predate is specific to testing of grepq, the code should be easily adapted for testing other CLI applications.
predate has been tested on Linux and macOS. It might work on Windows, but it has not been testedrustup updateFrom crates.io
cargo install predateFrom source
cd into the predate directorycargo build --release./target/releasePATH or use the full path to the executable[!NOTE]
predateis specifically used to testgrepq
cd /path/to/grepq/examples
predate [OPTIONS] <PATH_TO_TESTS_YAML>
Usage: predate [OPTIONS] <PATH_TO_TESTS_YAML>
Arguments:
<PATH_TO_TESTS_YAML> Path to the tests YAML file
Options:
-j, --json-out Write test output to a JSON file
-c, --control Set the control
-h, --help Print help
see CHANGELOG
MIT