Debian Codegraph @

test/Makefile

raw
1 # Foomuuri - Multizone bidirectional nftables firewall.
2
3 SUBDIRS ?= $(sort $(wildcard ??-*))
4 SOURCE ?= ../src/foomuuri ../src/tests/ ../prometheus/prometheus-foomuuri-exporter
5
6 .PHONY: all lint test clean distclean $(SUBDIRS)
7
8 ifdef COVERAGE
9 export RUN = unshare --map-root-user --net coverage run --append --data-file=$(CURDIR)/../.coverage
10 else
11 export RUN = python3
12 endif
13
14 all: lint test
15
16 lint:
17 ruff check $(SOURCE)
18 ruff format --diff $(SOURCE)
19 ty check --ignore=unresolved-import --ignore=unused-ignore-comment $(SOURCE)
20 pylint $(SOURCE)
21
22 test: $(SUBDIRS)
23 cd ../ ; $(RUN) -m unittest
24
25 clean distclean:
26 rm -f */*.fw
27 rm -f */iplist-cache.json
28 rm -f */zone
29
30 $(SUBDIRS):
31 [ ! -f $@/Makefile ] || $(MAKE) -C $@
32 $(RUN) ../src/foomuuri --set=etc_dir=$@ --set=share_dir=../etc --set=state_dir=$@ --set=run_dir=$@ check
33 diff -u $@/golden.txt $@/next.fw