A simple test framework, written in bash, for testing console applications.
It works by accepting a set of input
tests and comparing the program output to a set of expected result
files.
./ --> your project directory
/tests/tests-io.sh --> the test script
/input/ --> folder for **input** and **expected** test files
Test input files stay in the input
directory and have to match the following template - test-{number}
.
For every corresponding input file, there should be an expected
file.
It should be created in the same directory and match the template - test-{number}.exp
.
The number
in the expected file
name determines which is the corresponding input file
.
In order to run the testing script, execute the command
bash tests-io.sh {program-name}
The program-name
should be a valid executable. You should also specify the path
to the executable unless it is present in the PATH
environment variable.
After running the tests, there is an output
folder created, where you can inspect the actual program outputs for every test being ran.
There is currently not an option for automatically deleting the folder after running the tests. But I am accepting pull requests. :)