A framework for regression testing.
atest - see atest.example.sh
ucmp - cmp(1) for numbers
udiff - diff(1) for numbers
uscale - scale all numbers
make PREFIX=<prefix directory>
scripts are installed to $PREFIX/bin and man pages are to $PREFIX/man.
ATEST(1) General Commands Manual ATEST(1) NAME atest - run atests SYNOPSIS atest [ file ... ] TUTORIAL Lets create a test for a program `./example'. it outputs `1 2 3' and you want to modify `./example' and make sure the output stay the same. Create a file with a test `test/0' # cTEST: 0 ./example > example.out.txt The lines after `# cTEST: 0' are executed as a script. The script creates a file example.out.txt which contains a "magic" pattern `.out.'. This pattern tells atest to consider this file as a ref‐ erence output. $ atest test/0 end of the output says: atest: 0/0 test(s) passed atest: 1 test(s) created atest stored a reference output to the directory `test_data'. To run a test replace `cTEST' by `TEST' in `test/0' and execute $ atest test/0 It returns atest: RUNNING: 0 atest: PASSED : 0 atest: 1/1 test(s) passed Now if you "break" `./example' and run atest test/0 it get noticed. atest: 0/1 test(s) passed atest: failed tests: atest: 0 DESCRIPTION A test consists of a header line and lines which are executed as a shell script. An empty line ends a script. # TEST: name <script> <scirpt> <script> <not a script> cTEST means "create" mode. In this mode the script updates the reference file. # cTEST: name nTEST is "numerical" comparison mode. In this mode every number in the output is compared with the reference up to a tolerance 0.1. For a reference output `1 2 3'. A program which outputs `1.01 2 3' passes a test and one which outputs `1.11 2 3' does not. ENVIRONMENT VARIABLES The following environment variables affect `atest'. ATEST_DIR a directory with the reference values, if ATEST_C is set re-create all then test. EXAMPLES atest atest.examples.sh Run tests in atest.examples.sh SOURCE https://github.com/slitvinov/atest ATEST(1)