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

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
	    -DSCITOKENS_BUILD_UNITTESTS:BOOL=ON \
	    -DSCITOKENS_EXTERNAL_GTEST:BOOL=ON

override_dh_auto_test:
	# Filter out tests that require network connection
	# Use a key cache directory outside HOME since HOME might not exit
	cd obj-$(DEB_HOST_GNU_TYPE) && \
		GTEST_FILTER=-KeycacheTest.RefreshTest:KeycacheTest.RefreshExpiredTest \
		XDG_CACHE_HOME=$(CURDIR)/.cache \
		ctest --output-on-failure

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .cache
