File: unittests

package info (click to toggle)
python-os-testr 1.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 432 kB
  • sloc: python: 1,920; sh: 79; makefile: 45
file content (23 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

PYTHONS=$(pyversions -vr)
PYTHON3S=$(py3versions -vr)

BINARIES="ostestr subunit-trace subunit2html"

set -e
echo "===> Running tests"
for i in ${PYTHONS} ${PYTHON3S}; do
  PYMAJOR=`echo $i | cut -d'.' -f1`
  echo "===> Testing with python$i (python$PYMAJOR)"
  for bin in $BINARIES; do
    update-alternatives --set $bin /usr/bin/python$PYMAJOR-$bin
  done
  rm -rf .testrepository
  testr-python$PYMAJOR init
  TEMP_REZ=`mktemp -t` 
  PYTHONPATH=`pwd` PYTHON=python$i testr-python$PYMAJOR run --subunit | tee $TEMP_REZ | subunit2pyunit ; \
  cat $TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
  rm -f $TEMP_REZ ; \
  testr-python$PYMAJOR slowest ; \
done