It occurs to me that you might be able to do something like
override_dh_auto_test:
dbus-run-session -- xvfb-run -a sh -c 'DBUS_SYSTEM_BUS_ADDRESS=$$DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp-xdg-runtime-dir dh_auto_test'
That'll probably fail in the same was as it did for me above, but I reckon you'd be able to get a build-time test going like that.
It occurs to me that you might be able to do something like
override_ dh_auto_ test: run-session -- xvfb-run -a sh -c 'DBUS_SYSTEM_ BUS_ADDRESS= $$DBUS_ SESSION_ BUS_ADDRESS XDG_RUNTIME_ DIR=$(CURDIR) /debian/ tmp-xdg- runtime- dir dh_auto_test'
dbus-
That'll probably fail in the same was as it did for me above, but I reckon you'd be able to get a build-time test going like that.