-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.sh
executable file
·32 lines (26 loc) · 1.04 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# Write down the current git version just for future reference.
mkdir -p .coverage-results
git log | head -1 > .coverage-results/version-stamp.txt
# This script depends on trialcoverage >= 0.3.5 and on coverage.py >= 3.3.2a1z8.
# The following lines will print an ugly warning message if those two are not
# installed.
python -c 'import pkg_resources;pkg_resources.require("trialcoverage>=0.3.5")' &&
python -c 'import pkg_resources;pkg_resources.require("coverage>=3.3.2a1z8")' &&
python -tt setup.py flakes
RETVAL=$?
if [ ${RETVAL} != 0 ] ; then
echo "FAILED: pyflakes reported warnings -- exiting"
exit ${RETVAL}
fi
# Now run the tests once just to make sure all test_requires dependencies are
# installed before we start paying attention to code coverage.
python setup.py trial > /dev/null 2> /dev/null
python -tt setup.py trial --reporter=bwverbose-coverage --rterrors
RETVAL=$?
echo "To see coverage details run 'coverage report' or open htmlcov/index.html."
coverage html
if [ ${RETVAL} = 0 ]; then
echo SUCCESS
fi
exit $RETVAL