From d9770a2698e4e4f9a4f31b0120a15d589608005c Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Tue, 12 Mar 2013 19:47:19 +0100 Subject: [PATCH] run-tests.sh: Add support for coverage report This requires the coverage python module. You enable it by calling run-tests.sh with the --coverage (-c) flag. --- run-tests.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/run-tests.sh b/run-tests.sh index c319e05..55dd6bd 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,2 +1,25 @@ #!/bin/sh -PYTHONPATH=lib nosetests --all-modules + +OPTS='--all-modules ' + +die() { + echo Error: "$@" + exit 1 +} + +while [ "$#" -gt 0 ]; do + case $1 in + -c|--coverage) + OPTS="$OPTS --with-coverage" + ;; + -*) + die "Unknown option: '$1'" + ;; + *) + die "Unknown argument: '$1'" + ;; + esac + shift +done + +PYTHONPATH=lib nosetests $OPTS