#!/bin/sh
set -e
# This script runs both unit and functional tests using [coverage][1], and
# combine the results in one file to get the union of both tests.
#
# [1]: https://pypi.org/project/coverage/

cd $(dirname $0)/..

echo "# Running unit tests"
(cd tests/unit && python3 -m coverage run -p --source doxyqml tests.py)

echo "# Running functional tests"
(cd tests/functional && python3 -m coverage run -p --source doxyqml tests.py --import)

echo "# Combining"
python3 -m coverage combine tests/unit tests/functional
