2010-07-12 22:03:45 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-11-13 19:40:27 +00:00
|
|
|
TOP_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))")
|
2013-11-27 17:07:42 +00:00
|
|
|
|
2013-06-03 01:28:56 +00:00
|
|
|
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
|
2013-11-27 17:07:42 +00:00
|
|
|
# Having the HTML reports is REALLY useful for achieving 100% branch
|
|
|
|
# coverage.
|
|
|
|
cover_branches="--cover-branches --cover-html --cover-html-dir=$TOP_DIR/cover"
|
2013-06-03 01:28:56 +00:00
|
|
|
fi
|
2013-11-27 17:07:42 +00:00
|
|
|
cd $TOP_DIR/test/unit
|
2014-04-24 16:50:03 +00:00
|
|
|
nosetests --exe --with-coverage --cover-package swift --cover-erase $cover_branches $@
|
2012-04-18 12:12:10 +00:00
|
|
|
rvalue=$?
|
2010-07-12 22:03:45 +00:00
|
|
|
rm -f .coverage
|
2012-03-12 21:54:31 +00:00
|
|
|
cd -
|
2012-11-26 15:58:09 +00:00
|
|
|
exit $rvalue
|