Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variable to track bats call arguments #882

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soda480
Copy link

@soda480 soda480 commented Mar 7, 2024

Having such a variable is useful for use cases where downstream functions can call bats with the original arguments, for example I am defining a setup_suite to automatically generate a coverage report and badge, I can use this variable like:

coverage() {
    if which kcov; then
        echo "# generating coverage report using kcov" >&3
        # strip --setup-suite-file argument to prevent infinite loop condition
        kcov --include-path=$WORK_DIR $WORK_DIR/coverage bats ${BATS_ARGS%--setup-suite-file*}
        coverage_badge
    else
        echo "# unable to generate coverage report because kcov is not installed" >&3
    fi
}

@soda480 soda480 requested a review from a team as a code owner March 7, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant