#!/usr/bin/make -f

export DH_GOLANG_EXCLUDES
export DH_GOLANG_EXCLUDES_ALL := 0

%:
	dh $@ --buildsystem=golang --with=golang

# no buildable Go source files in following dir
override_dh_auto_build: DH_GOLANG_EXCLUDES := \
    openstack/networking/v2/extensions/vpnaas/endpointgroups/testing \
    openstack/networking/v2/extensions/vpnaas/ikepolicies/testing \
    openstack/networking/v2/extensions/vpnaas/ipsecpolicies/testing \
    openstack/networking/v2/extensions/vpnaas/services/testing \
    openstack/networking/v2/extensions/vpnaas/siteconnections/testing \
    openstack/workflow/v2/crontriggers/testing \
    openstack/workflow/v2/executions/testing \
    openstack/workflow/v2/workflows/testing

override_dh_auto_test: DH_GOLANG_EXCLUDES := acceptance/openstack
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Ignore tests which access openstack api
	dh_auto_test
endif
