marshmallow-generic/scripts/test.sh

13 lines
394 B
Bash
Raw Normal View History

2023-03-09 12:14:37 +01:00
#!/usr/bin/env bash
# Runs unit tests and reports coverage percentage.
2023-03-09 12:14:37 +01:00
source "$(dirname $(realpath $0))/util.sh"
2023-03-09 12:14:37 +01:00
echo 'Running unit tests...'
coverage run
typeset percentage
typeset color
percentage="$(coverage report | awk '$1 == "TOTAL" {print $NF; exit}')"
[[ $percentage == "100%" ]] && color="${bold_green}" || color="${yellow}"
echo -e "${color}${percentage} coverage${color_reset}\n"