This is a list of test frameworks and related tools in pure shell.
Sort order is random.
Last commits for the frameworks are noted by 2017-04-03.
Last commit: Jan 27, 2015
Features:
- test autorunner
- test case fails and aborts on first non-zero exit code
- setup/teardown
- skipping tests
Test cases:
- coded in spearate functions with naming like
it_.*()
(RSpec-like) - are searched in files passed as commandline parameters or in a current file with special shebang
Output: custom human-readable format.
Installer: configure-make-based installer provided.
Codebase consists of a single file.
Last commit: Feb 19, 2016
Features:
- test autorunner
- test case fails and aborts on first non-zero exit code
- setup/teardown
- helper functions to ease doing several asserts per test case
- no tests skipping (probably can be done by modifying function names)
Test cases:
- coded in spearate functions with naming like
@test ".*"()
- are searched in files passed as commandline parameters or in a current file with special shebang
Output: TAP format.
Installer: install.sh provided to do installation Codebase consists of several files
Last commit: Sep 9, 2016
- assertions are eval-ed
Last commit: Apr 2, 2017
Features:
- test autorunner (RSpec-like): accepts parameter with tests
- describe/it blocks
- various assert functions
- custom matchers supported
- assertions are eval-ed
- stubbing commands
- failing assertion continues evaluation
- no setup/teardown functions
- color output
Test cases:
- run in the same process
Outuput: RSpec-like format.
Installer: installation not needed but can be done via install.sh or a makefile
Codebase is very small and clear although looks not to be very portable.
Last commit: 2 Nov 2008
Last commit: Mar 16, 2017
Features:
- test autorunner
- various assertXXX functions
- failing assertion produces message but does not abort test case
- setup/teardown
- failing/skipping tests
Test cases:
- coded in spearate functions with naming like
test.*()
- are searched in currently loaded plain shell script
Wide range of shells and OSes is supported.
This can also be obtained by apt-get install shunit2
in Ubuntu or searched for various forks/clones on github.
Output: custom human-readable format. Codebase consists of a single file.
See also shflags and log4sh of the same author which are commandline param processing library and logging library respectively.
Last commit: Apr 30, 2012
(3 commits in total for the whole lifetime)
shell-unittest of ALTLinux's libshell
Last commit: 18 Nov 2016
Test autorunner searches for test cases in a file pointed to by specific function invocation.
Has very poor documentation. A part of libshell and not usable without the rest of the library.
Features:
- test autorunner
- various assertXXX functions
- setup/teardown
Test cases:
- coded in spearate functions with special comment placed after function name:
# UnitTest
- are searched by a special function invocation from a separate file
Output: custom human-readable format. Codebase for the whole library consists of several files.
Installer: make-based installer provided.
Last commit: 22 Sep 2014
Not an actually testing framework but a library to easily produce output from your script in TAP format.
It seems to carry much legacy stuff in it and I could not actually run it (although I didn't try very hard with it).
Output: TAP format.
Last commit: 13 Feb 2013
Last commit: Jun 1, 2016
Last commit: Jun 9, 2015
Not an actually testing framework but a library to easily produce output in custom test-result format.