Bash-Tester is a framework for testing, based on bash scripts. It is well suited for cases when an application or system is tested using scripts. For example, if you create command-line utilities or create your own filesystem, bash-tester is suitable for system testing.
Links to the repository:
https://github.com/evgenykislov/bash-tester,
https://gitflic.ru/project/evgenykislov/bash-tester.
Features:
- uses the native method of interaction;
- support for fixtures: using Setup and TearDown functions;
- running test scripts from multiple folders (by mask);
- filter support for tests;
- calculating the execution time of individual tests and the total;
- print general statistics.
Test example:
Download the code from the repository (see the links above), go to the example folder and execute the command:
../bash-tester.sh .
As a result, you will receive something like this report:
[ RUN ] Test with errors
[ FAILED ] Test with errors (2 ms)
[ RUN ] Test with fixture
SetUp function. Parameter 'Fixture parameter'
Test after SetUp
Finalization by TearDown function
[ OK ] Test with fixture (2 ms)
[ RUN ] Single-function test
[ OK ] Single-function test (3 ms)
[==========] 3 tests. (23 ms total)
[ PASSED ] 2 tests.
[ FAILED ] 1 tests, listed below:
[ FAILED ] Test with errors