swift/.unittests
Chuck Thier 5b8fad754c Fix coverage report for newer versions of coverage
With newer versions of coverage (at least what is installed with ubuntu
trusty), code coverage isn't working.  Making this change allows the
coverage library to find the swift package.

Change-Id: I3b3792622904a86096064c0e03c8095636f83973
2014-04-24 16:50:03 +00:00

19 lines
611 B
Bash
Executable File

#!/bin/bash
TOP_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))")
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
# Having the HTML reports is REALLY useful for achieving 100% branch
# coverage.
cover_branches="--cover-branches --cover-html --cover-html-dir=$TOP_DIR/cover"
fi
cd $TOP_DIR/test/unit
nosetests --exe --with-coverage --cover-package swift --cover-erase $cover_branches $@
rvalue=$?
rm -f .coverage
cd -
exit $rvalue