#!/usr/bin/make -f

# * The binaries under cmd/ are examples. They cannot be built and are not
#   generally useful to downstreams.
export DH_GOLANG_EXCLUDES := cmd

export DH_GOLANG_INSTALL_EXTRA := tests/data

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

# requires unpackaged github.com/hugelgpuf/vmtest
execute_after_dh_auto_build:
	rm -fv _build/src/github.com/foxboron/go-uefi/tests/integration_test.go
	rm -fv _build/src/github.com/foxboron/go-uefi/tests/tests/enroll_keys/enroll_keys_test.go
	rm -fv _build/src/github.com/foxboron/go-uefi/tests/tests/modify_dbx/modify_dbx_test.go
	rm -fv _build/src/github.com/foxboron/go-uefi/tests/tests/remove_pk/remove_pk_test.go
	rm -fv _build/src/github.com/foxboron/go-uefi/tests/tests/secure_boot_enabled/secure_boot_enabled_test.go

# timestamp_test.go:166: Failed to get timestamp from http://timestamp.digicert.com: failed to request timestamp: failed to send timestamp request: Post "http://timestamp.digicert.com": dial tcp: lookup timestamp.digicert.com on [::1]:53: read udp [::1]:50035->[::1]:53: read: connection refused
# --- FAIL: TestRealTimestampRequest (0.00s)
# timestamp_test.go:209: Failed to sign with timestamp: failed to get timestamp for unauthenticated attributes: failed to request timestamp: failed to send timestamp request: Post "http://timestamp.digicert.com": dial tcp: lookup timestamp.digicert.com on [::1]:53: read udp [::1]:38300->[::1]:53: read: connection refused
# --- FAIL: TestSignPKCS7WithTimestamp (0.61s)
override_dh_auto_test:
	dh_auto_test $(DH_BUILD_OPTS) -- -skip="TestRealTimestampRequest|TestSignPKCS7WithTimestamp"
	-dh_auto_test $(DH_BUILD_OPTS) -- -run="TestRealTimestampRequest|TestSignPKCS7WithTimestamp"
