diff options
author | Jeff Quast <contact@jeffquast.com> | 2014-11-23 18:10:53 -0800 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2014-11-23 18:10:53 -0800 |
commit | 67a789ae2546637e95f83fa691f7c735329d8eeb (patch) | |
tree | 248893aa495b54dbc7281838ce1ddbb7a4e1d01a /tools/teamcity-runtests.sh | |
parent | 053710c7a969421f6e9c62b60d9e4ae130c230fb (diff) | |
download | pexpect-git-67a789ae2546637e95f83fa691f7c735329d8eeb.tar.gz |
Provide test-runner for teamcity
Diffstat (limited to 'tools/teamcity-runtests.sh')
-rwxr-xr-x | tools/teamcity-runtests.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/teamcity-runtests.sh b/tools/teamcity-runtests.sh new file mode 100755 index 0000000..ff89c9d --- /dev/null +++ b/tools/teamcity-runtests.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# This script assumes that the project 'ptyprocess' is +# available in the parent of the project's folder. +set -e +set -o pipefail + +function usage() { + echo "$0 (2.6|2.7|3.3|3.4)" +} +if [ -z $1 ]; then + usage + exit 1 +fi + +pyversion=$1 +here=$(cd `dirname $0`; pwd) +osrel=$(uname -s) + +. `which virtualenvwrapper.sh` +rmvirtualenv teamcity-pexpect || true +mkvirtualenv -p `which python${pyversion}` teamcity-pexpect + +# install ptyprocess +cd $here/../../ptyprocess +python setup.py install + +# run tests +cd $here/.. +py.test-${pyversion} \ + --cov pexpect \ + --cov-config .coveragerc \ + --junit-xml=results.${osrel}.py${pyversion}.xml \ + --verbose \ + --verbose + +# combine all coverage to single file, publish as build +# artifact in {pexpect_projdir}/build-output +mkdir -p build-output +coverage combine +mv .coverage build-output/.coverage.${osrel}.py{$pyversion}.$RANDOM.$$ |