#!/usr/bin/make -f

XVFB_OPTS = --auto-servernum --server-num=20 -s "-noreset"

SKIP_TESTS = \
	test_logging_to_file

IGNORE_TESTS = \
	tests/test_graphical_units/test_opengl.py \
	tests/test_scene_rendering/opengl

space = $(eval) $(eval)
concat_with = $(subst $(space),$1,$2)

export PYBUILD_TEST_CUSTOM = 1
export PYBUILD_TEST_ARGS = xvfb-run $(XVFB_OPTS) {interpreter} -m pytest \
	-m 'not slow' \
	$(addprefix --ignore$(space),$(IGNORE_TESTS)) \
	$(if $(SKIP_TESTS),-k 'not ($(call concat_with,$(space)or$(space),$(SKIP_TESTS)))')

%:
	dh $@ --buildsystem=pybuild

