#!/bin/bash

set -e

for i in python python3; do
  echo "===> Testing with Python $i"
  rm -rf .testrepository
  testr init
  TEMP_REZ=`mktemp -t`
  PYTHON=$i PYTHONPATH=`pwd` testr run --subunit 'tests\.(?!.*TestCore.test_console_script.*)' | tee $TEMP_REZ | subunit2pyunit
  cat $TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats
  rm -f $TEMP_REZ
  testr slowest
done
