summaryrefslogtreecommitdiff
path: root/.unittests
diff options
context:
space:
mode:
authorDarrell Bishop <darrell@swiftstack.com>2013-11-27 12:07:42 -0500
committerDarrell Bishop <darrell@swiftstack.com>2013-11-27 12:07:42 -0500
commit39032c359f01a5e397fce2eb8326b961c9673607 (patch)
treee8b79799ff89ab3b00e43e46ddca77b69f948016 /.unittests
parentd8e46eba474a65471712add5575036b6bdb29ac2 (diff)
downloadswift-39032c359f01a5e397fce2eb8326b961c9673607.tar.gz
Add HTML reporting for test branch coverage.
When including branch coverage results, also generate HTML reports into a "cover" subdirectory under the directory in which .unittests resides (i.e. known location at the top of the swift tree). Change-Id: I493d74f38755f7bf0d7043052585efb27840b238
Diffstat (limited to '.unittests')
-rwxr-xr-x.unittests8
1 files changed, 6 insertions, 2 deletions
diff --git a/.unittests b/.unittests
index 4b33e0055..ffce146d6 100755
--- a/.unittests
+++ b/.unittests
@@ -1,12 +1,16 @@
#!/bin/bash
+TOP_DIR=$(dirname $(python -c 'import os,sys;print os.path.realpath(sys.argv[1])' $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
- cover_branches="--cover-branches"
+ # 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 $(dirname $0)/test/unit
+cd $TOP_DIR/test/unit
nosetests --exe --with-coverage --cover-package swift. --cover-erase $cover_branches $@
rvalue=$?
rm -f .coverage