Recognize table class: borderless, nolines, booktabs, standard.
[docutils.git] / test / coverage.sh
blob23e0adfdf102fc87f74a05cc264f872dc0e5e0f2
1 #!/bin/bash
3 # $Id$
4 # Author: Felix Wiemann <Felix.Wiemann@ososo.de>
5 # Copyright: This script has been placed in the public domain.
7 set -e
8 # Resolve all symlinks in current path.
9 cd -P .
10 proj="${PWD##*/}"
11 if test "$proj" == test; then
12 cd ..
13 proj="${PWD##*/}"
15 if test "$1"; then
16 proj="$1"
18 echo "Performing code coverage test for project \"$proj\"..."
19 echo
20 echo "Please be patient; coverage tracking slows test execution down by more"
21 echo "than factor 10."
22 echo
23 cd test
24 rm -rf cover
25 mkdir -p cover
26 python -u -m trace --count --coverdir=cover --missing alltests.py
27 cd ..
28 echo
29 echo
30 echo Uncovered lines
31 echo ===============
32 echo
34 find "$proj" -name \*.py | while read i; do
35 i="${i%.py}"
36 test -f test/cover/"${i//\//.}".cover -o "${i##*/}" == Template || echo "${i//\//.}" "`cat "$i.py" | wc -l`"
37 done
38 cd test/cover
39 find . \( -name . -o ! -name "$proj".\* -exec rm {} \; \)
40 for i in *.cover; do
41 sed 's/^>>>>>> \(.*"""\)/ \1/' < "$i" > "${i%.cover}"
42 rm "$i"
43 done
44 for i in *; do echo -n "$i "; grep -c '^>>>>>> ' "$i" || true; done
45 ) | grep -v ' 0$' | sort -nk 2