asyncio-taskpool/coverage.sh

26 lines
891 B
Bash
Raw Normal View History

2022-04-03 12:34:14 +02:00
#!/usr/bin/env bash
2022-02-03 20:06:30 +01:00
2022-04-03 12:34:14 +02:00
# This file is part of asyncio-taskpool.
# asyncio-taskpool is free software: you can redistribute it and/or modify it under the terms of
# version 3.0 of the GNU Lesser General Public License as published by the Free Software Foundation.
# asyncio-taskpool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with asyncio-taskpool.
# If not, see <https://www.gnu.org/licenses/>.
2022-04-06 21:47:39 +02:00
coverage erase
coverage run 2> /dev/null
2022-04-03 12:34:14 +02:00
2022-04-06 21:47:39 +02:00
typeset report=$(coverage report)
typeset total=$(echo "${report}" | awk '$1 == "TOTAL" {print $NF; exit}')
2022-04-03 12:34:14 +02:00
2022-04-06 21:47:39 +02:00
if [[ ${total} == 100% ]]; then
echo ${total}
2022-04-03 12:34:14 +02:00
else
2022-04-06 21:47:39 +02:00
echo "${report}"
2022-04-03 12:34:14 +02:00
fi