#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := sim/gli.lirs.gz
export DH_GOLANG_EXCLUDES := contrib
export DH_GOLANG_EXCLUDES_ALL := 1

%:
	dh $@ --builddirectory=_build --buildsystem=golang

ifneq (,$(filter $(DEB_TARGET_ARCH), i386 s390x riscv64))
override_dh_auto_test:
ifneq (,$(filter $(DEB_TARGET_ARCH), i386))
# i386: panic: test timed out after 25m0s -- should be quick, infloop?
	dh_auto_test $(DH_BUILD_OPT) -- --skip=TestAllocate
	-dh_auto_test $(DH_BUILD_OPT) -- --timeout=10m
endif
ifneq (,$(filter $(DEB_TARGET_ARCH), s390x ppc64el riscv64))
# --- FAIL: TestTreePersistent (0.08s)
# panic: mremap size mismatch: requested: 2097160 got: 1048576
# 	while trying to truncate file: /tmp/1937159950/tree.buf to size: 2097160 [recovered]
# 	panic: mremap size mismatch: requested: 2097160 got: 1048576
# 	while trying to truncate file: /tmp/1937159950/tree.buf to size: 2097160
	dh_auto_test $(DH_BUILD_OPT) -- --skip=TestTreePersistent
	-dh_auto_test $(DH_BUILD_OPT) -- --timeout=10m
endif
endif
