From 8f85d3e3390fb81fedfc42b709266a823cdba373 Mon Sep 17 00:00:00 2001 From: wiemann Date: Wed, 15 Jun 2005 23:56:28 +0000 Subject: renamed testcoverage.sh to coverage.sh git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3489 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/coverage.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 test/coverage.sh (limited to 'test/coverage.sh') diff --git a/test/coverage.sh b/test/coverage.sh new file mode 100755 index 000000000..e2005448d --- /dev/null +++ b/test/coverage.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Author: Felix Wiemann +# Contact: Felix_Wiemann@ososo.de +# Revision: $Revision$ +# Date: $Date$ +# Copyright: This script has been placed in the public domain. + +set -e +proj="${PWD##*/}" +if test "$proj" == test; then + cd .. + proj="${PWD##*/}" +fi +if test "$1"; then + proj="$1" +fi +echo Performing code coverage test for project \""$proj"\"... +echo +cd test +rm -rf cover +mkdir -p cover +python -u -m trace --count --coverdir=cover --missing alltests.py +cd .. +echo +echo +echo Uncovered lines +echo =============== +echo +( + find "$proj" -name \*.py | while read i; do + i="${i%.py}" + test -f test/cover/"${i//\//.}".cover -o "${i##*/}" == Template || echo "${i//\//.}" "`cat "$i.py" | wc -l`" + done + cd test/cover + find . \( -name . -o ! -name "$proj".\* -exec rm {} \; \) + for i in *.cover; do + sed 's/^>>>>>> \(.*"""\)/ \1/' < "$i" > "${i%.cover}" + rm "$i" + done + for i in *; do echo -n "$i "; grep -c '^>>>>>> ' "$i" || true; done +) | grep -v ' 0$' | sort -nk 2 -- cgit v1.2.1 From 133e6176272678623431d07c7187147ec8172150 Mon Sep 17 00:00:00 2001 From: wiemann Date: Mon, 27 Jun 2005 12:47:29 +0000 Subject: added note about slowdown git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3603 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/coverage.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/coverage.sh') diff --git a/test/coverage.sh b/test/coverage.sh index e2005448d..3edea0e2a 100755 --- a/test/coverage.sh +++ b/test/coverage.sh @@ -15,7 +15,10 @@ fi if test "$1"; then proj="$1" fi -echo Performing code coverage test for project \""$proj"\"... +echo "Performing code coverage test for project \"$proj\"..." +echo +echo "Please be patient; coverage tracking slows test execution down by more" +echo "than factor 10." echo cd test rm -rf cover -- cgit v1.2.1