alpine:edge
-based dockerization of shUnit2, the "xUnit-based unit test framework for Bourne-based shell scripts."
The source code for this image is hosted on GitHub in the backplane/conex repo.
The image will set the SHUNIT_PATH
environment variable (to /shunit
). It will provide the latest version of shunit at /shunit
. At the end of your shell tests, load shunit with something like the following line:
# shellcheck source=/dev/null
. ${SHUNIT_PATH:-../shunit}
or simply
# shellcheck source=/dev/null
. "$SHUNIT_PATH"
Then with the interactive shunit2 alias below,
shunit2() {
docker run \
--rm \
--interactive \
--tty \
--volume "$(pwd):/work" \
"backplane/shunit2" \
"$@"
}
Simply run shunit2
from the project root directory.