diff options
author | Peter Portante <peter.portante@redhat.com> | 2013-06-02 21:28:56 -0400 |
---|---|---|
committer | Peter Portante <peter.portante@redhat.com> | 2013-06-10 10:30:40 -0400 |
commit | 9094c5cc66712ae2351b69cfc3a3d953ad8f045f (patch) | |
tree | 64c07116a2b386c3ffb39d2d86b797d84ba1c24f /.unittests | |
parent | 4077252f233888887b797208895bbd5f2beca0c9 (diff) | |
download | swift-9094c5cc66712ae2351b69cfc3a3d953ad8f045f.tar.gz |
Add branch coverage reporting
Except where the python-nose package version does not support the
"--cover-branches" option.
Change-Id: I9ea6452d9834b3ac414e14e628002f593dd4b8c8
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Diffstat (limited to '.unittests')
-rwxr-xr-x | .unittests | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/.unittests b/.unittests index ac7dba916..4b33e0055 100755 --- a/.unittests +++ b/.unittests @@ -1,7 +1,13 @@ #!/bin/bash +python -c 'from distutils.version import LooseVersion as Ver; import nose, sys; sys.exit(0 if Ver(nose.__version__) >= Ver("1.2.0") else 1)' +if [ $? != 0 ]; then + cover_branches="" +else + cover_branches="--cover-branches" +fi cd $(dirname $0)/test/unit -nosetests --exe --with-coverage --cover-package swift. --cover-erase $@ +nosetests --exe --with-coverage --cover-package swift. --cover-erase $cover_branches $@ rvalue=$? rm -f .coverage cd - |