#!/usr/bin/make -f
# -*- makefile -*-

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --without build_stamp

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd obj-* && $(MAKE) install DESTDIR=$(CURDIR)/test_root
	mkdir -p "$(CURDIR)/test_root/tmp"
	xvfb-run -a dbus-run-session dh_auto_test -- QT_PLUGIN_PATH=$(CURDIR)/test_root/usr/lib/$(DEB_HOST_MULTIARCH)/qt6/plugins XDG_DATA_DIRS=$(CURDIR)/test_root/usr/share:/usr/local/share:/usr/share TMPDIR="$(CURDIR)/test_root/tmp"
	# check leftover temporary files
	cd "$(CURDIR)/test_root/tmp" && find | sort
endif
