.. default-domain:: bash ================================ J.U.S.T. Bash Coverage Functions ================================ .. file:: just_bashcov_functions.bsh Plugin for running `bashcov `_ which uses `simplecov `_ under the hood. ----------------------- J.U.S.T. bashcov plugin ----------------------- .. function:: bashcov_defaultify Plugin for running unit tests through bash coverage in any project .. envvar:: ${JUST_PROJECT_PREFIX}_BASHCOV_SOURCE_DIR The location of the source code directory on the host. The coverage results will be stored in a ``coverage`` subdirectory. .. rubric:: Bugs Changing the ``coverage_dir`` in the settings may not work. Default: ``${${JUST_PROJECT_PREFIX}_CWD}`` .. envvar:: BASHCOV_IMAGE The image name used to run bashcov. If you want to use your own customized image with your own dependencies installed, override the set :envvar:`BASHCOV_IMAGE` in your :file:`local.env` file to the image you want to use, and do NOT run :cmd:`bashcov_build` or it will rebuild the bashconv image, tagging it with that image name. Default: ``vsiri/bashcov:latest`` Bashcov can be configured with a ``.simplecov`` file in the the ``${JUST_PROJECT_PREFIX}_BASHCOV_SOURCE_DIR`` directory. See `simplecov `_ for more information on configuring ``.simplecov`` .. rubric:: Example .. code-block:: ruby :caption: .simplecov SimpleCov.start do # Exclude the tests and docs dir from the coverage report add_filter "/tests/" add_filter "/docs/" # Customize the no coverage flag, default is nocov nocov_token "nocov" end .. command:: bashcov Run bashcov on a single command. :Arguments: ``$1``... - Arguments passed into bashcov call .. command:: bashcov_multiple Run multiple commands in bashcov in parallel. The results are all merged together and allows you to only rerun a single file at a time and update the aggregate result. :Arguments: ``$1``... - Arguments passed to bashcov, one argument per call. .. command:: bashcov_resume Similar to :cmd:`bashcov_multiple`, except only executes each argument if it hasn't been run before. Useful for resuming a long run, the first time. :Arguments: ``$1``... - Arguments passed to bashcov, one argument per call. .. command:: bashcov_shell Enter the bashcov container; for debugging .. command:: bashcov_build Builds the bashcov image. This is done automatically the first time you run a bashcov container, but this will rebuild it if needed. .. command:: bashcov_open Opens the bashcov report in a web browser