#!/usr/bin/make -f

# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
export HOME=debian/fakehome
export PYBUILD_TEST_ARGS=-k 'not test_spiderfootthreadpool and not test_spiderfootscanner and not test_sf and not test_sfcli and not test_sfwebui and not test_spiderfootwebui'


%:
	dh $@ --with python3

override_dh_install:
	dh_install -XLICENSE

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Pytest 8.4 warns when pytest.mark.usefixtures is used without
	# specifying any fixtures, and spiderfoot is full of that.  See
	# https://docs.pytest.org/en/stable/changelog.html#id90 #12426.
	# Quick & dirty: remove this line in-place before running tests.
	find test/unit/ -name '*.py' | xargs sed -i '/^@pytest.mark.usefixtures$$/d'
	dh_auto_test
	mkdir debian/fakehome
	python3 -m pytest -k 'not test_spiderfootthreadpool and not test_spiderfootscanner and not test_sf and not test_sfcli and not test_sfwebui and not test_spiderfootwebui'
endif
