/docker-bashtest

Image with kcov and shunit2 to execute tests and generate a code coverage report

Primary LanguageDockerfileBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Docker bash tests   Tweet

Fun programming with bash and docker!

Image with kcov and shunit2 to execute tests and generate a code coverage report.

Build Status Docker Stars Docker Pulls Price License: BSD-3 Contributions welcome

Built with ❤︎ by Anderson Santos and contributors

Table of contents

Features

  • Shunit2: Has shunit2 installed
  • Kcov: has kcov installed

Getting Started

You must mount the source code and execute the test script inside the image with kcov command. The example is bellow.

There is a repository with a example of a bash script using this image at: https://github.com/supergarotinho/bashtest-example

Example of use:

docker run --rm \
  --security-opt seccomp=unconfined \
  -v "$(pwd)":/source \
  -e "TERM=xterm-256color" supergarotinho/bashtest kcov --exclude-path=/root/shunit2 ./coverage ./test/unit-test.sh

Prerequisites

  • Docker installed

Built With

  • Shunit2 - The bash testing framework
  • Kcov - Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the BSD-3 License - see the LICENSE.md file for details