#!/usr/bin/bash

export XPRA_UTIL_DEBUG=${XPRA_UTIL_DEBUG:-0}
export XPRA_TEST_DEBUG=${XPRA_TEST_DEBUG:-0}
export XPRA_HIDE_SUBPROCESS_OUTPUT=${XPRA_HIDE_SUBPROCESS_OUTPUT:-1}
#SAVED_PYTHONPATH=$PYTHONPATH

UNITTESTS_DIR=`dirname $(readlink -f $0)`
SRC_DIR=`dirname $UNITTESTS_DIR`

INSTALL_ROOT="$SRC_DIR/install/python3"
pushd $SRC_DIR
python3 ./setup.py install --home=$INSTALL_ROOT
popd

export PYTHONPATH=`ls -d $INSTALL_ROOT/lib*/python`:.
export PATH=$INSTALL_ROOT/bin:$PATH
export XPRA_COMMAND=$INSTALL_ROOT/bin/xpra
export XPRA_CONF_DIR=$INSTALL_ROOT/etc/xpra/

pushd $UNITTESTS_DIR
python3 ./unit/run.py
popd
