iotest is a small tool for testing programs based on input and output.
Project description
writeup v0 Dedicated to the public domain under CC0: https://creativecommons.org/publicdomain/zero/1.0/.
# iotest
iotest is a small tool for testing command line programs. By default it writes the stdout and stderr of the program under test to files, and then compares them to expected results using git diff. Here are some reasons I like it: - Specify complicated, multiline text expectations without fiddling with escape characters in test code. - Clearly differentiate between stdout and stderr, with default success/failure status code expectations. - Test output is placed sensibly in the _build directory for easy inspection. - Simple test case prototyping reduces test case redundancy without complicated inheritence overrides (conflicts result in an error).
iotest is available via pip for easy distribution. Alternatively, the script can be freely copied into a project; there is a single python dependency (pithy utility library), also available through pip.
# License
iotest dedicated to the public domain. It is written and maintained by George King.
# Usage
To run all tests in the test directory: $ iotest test/
iotest will look for test cases, which are indicated by the presence of a .iot, .out, or .err file. The filename stem (the part before dot/extension) indicates the name of the test case. This is then used to find a test executable with the matching stem. For example, if we have a test case file thing.iot and corresponding executable file thing.py, iotest will run thing.py and compare its output to the expectations specified in thing.iot. If there is more than one test case file, e.g. thing.iot and thing.err, then they will be combined together as long as they do not conflict (in other words, thing.iot cannot also specify a stderr expectation).
# Issues
Please file issues to the github repository: github.com/gwk/iotest.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file iotest-0.1.tar.gz
.
File metadata
- Download URL: iotest-0.1.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2988b3b0893fe3442017541f3aca3ef529e7b7df421cbe85eefce0bf7ab3ddf1 |
|
MD5 | 62fe614a28ced52009ef9815543a359f |
|
BLAKE2b-256 | e71c12cca0feb58cb45743ce6410269e80b0dcac5e1b7e07e876aeb4bbd640ac |