1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/usr/bin/env bash
# Run busted and collect spec coverage using LuaCov.
# Output will be found at /luacov.report.out.
#
# Usage:
#
# $ ./bin/coverage
# $ cat luacov.report.out
which luacov &> /dev/null
if [ $? -ne 0 ]; then
echo "You must have luacov installed."
echo "Run 'luarocks install luacov' then try again".
exit 1
fi
which busted &> /dev/null
if [ $? -ne 0 ]; then
echo "You must have luacov installed."
echo "Run 'luarocks install busted' then try again".
exit 1
fi
busted -c
luacov src/
rm luacov.stats.out
grep -zPo "(?s)={10,}\nSummary\n={10,}.+" luacov.report.out
|