#!/usr/bin/make -f

XVFB_OPTS=--auto-servernum --server-num=20 -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset"

EXCLUDED_TESTS :=
# Non-interactive tests
EXCLUDED_TESTS += not interactive
# PulseAudio related
EXCLUDED_TESTS += and not PulseAudio
EXCLUDED_TESTS += and not test_pulse
# Failing for unknown reason but looks harmless
EXCLUDED_TESTS += and not test_freetype_face
# These ones are failing in cowbuilder
# Fonts are related to missing "arial" font which is normal
# Driver one looks being related to not having ALSA stuff
# IssueNNN raises StopIteration
EXCLUDED_TESTS += and not test_fontconfig
EXCLUDED_TESTS += and not test_linux_fontconfig
EXCLUDED_TESTS += and not test_driver
EXCLUDED_TESTS += and not test_issue429
EXCLUDED_TESTS += and not test_issue241
EXCLUDED_TESTS += and not test_issue471
# cf. #929697
EXCLUDED_TESTS += and not ClockTimingTestCase

export PYBUILD_NAME=pyglet
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS=>/dev/null 2>&1; cd {build_dir}; xvfb-run $(XVFB_OPTS) python{version} -m pytest -v -k "$(EXCLUDED_TESTS)"

%:
	dh $@ --with python2,python3 --buildsystem=pybuild
