| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
PYTHON=${1} |
| 6 |
if [ -z "$PYTHON" ]; then |
| 7 |
echo "ERROR: Missing python version argument" |
| 8 |
echo "Usage: pkgos-testr <python-version> [<test-scope>]" |
| 9 |
exit 1 |
| 10 |
fi |
| 11 |
|
| 12 |
PY_MAJOR=$(echo $PYTHON | cut -d . -f 1) |
| 13 |
SCOPE=${2} |
| 14 |
|
| 15 |
TEMP_REZ=`mktemp -t` |
| 16 |
|
| 17 |
function finish { |
| 18 |
rm -rf .testrepository |
| 19 |
rm -f $TEMP_REZ |
| 20 |
} |
| 21 |
trap finish EXIT |
| 22 |
|
| 23 |
echo "===> Testing for python$PYTHON" |
| 24 |
rm -rf .testrepository |
| 25 |
testr init |
| 26 |
PYTHON=python$PYTHON PYTHONPATH=`pwd` testr run --subunit $SCOPE | tee $TEMP_REZ | subunit2pyunit |
| 27 |
cat $TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats |
| 28 |
testr slowest |
| 29 |
echo "===> Testing with python$PYTHON complete." |