#!/bin/sh
export AXI_PLUGIN_DIR=`pwd`/plugins
export AXI_DB_PATH=`pwd`/testdb
export AXI_CACHE_PATH=`pwd`/testdb
export PYTHONPATH="$PYTHONPATH:`pwd`"

case "$1" in
	--cov)
		echo "Run with code coverage..."
		shift
		nosetests -w test --with-coverage --cover-package axi --cover-html --cover-html-dir=test-coverage "$@"
		echo "Coverage information found at file://`pwd`/test/test-coverage"
		;;
	--clean)
		rm -rf test/test-coverage test/.coverage testdb
		;;
	*)
		nosetests -w test "$@"
		;;
esac
