]> git.proxmox.com Git - mirror_iproute2.git/blame - testsuite/Makefile
tests: Allow policer test to be ran
[mirror_iproute2.git] / testsuite / Makefile
CommitLineData
150a5bc3
SH
1## -- Config --
2DEV := lo
9ecff68d 3PREFIX := sudo -E
4RESULTS_DIR := results
150a5bc3
SH
5## -- End Config --
6
7TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t))
82af5315 8IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*))
150a5bc3 9KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG)
82af5315 10
150a5bc3 11.PHONY: compile listtests alltests configure $(TESTS)
82af5315 12
150a5bc3
SH
13configure:
14 echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..;
82af5315 15
150a5bc3 16compile: configure
82af5315 17 echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;
18
19listtests:
20 @for t in $(TESTS); do \
21 echo "$$t"; \
22 done
23
24alltests: $(TESTS)
25
26clean:
9ecff68d 27 @rm -rf $(RESULTS_DIR)
82af5315 28
150a5bc3
SH
29distclean: clean
30 echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
31
82af5315 32$(TESTS):
9ecff68d 33 @mkdir -p $(RESULTS_DIR)
82af5315 34 @for i in $(IPVERS); do \
82af5315 35 o=`echo $$i | sed -e 's/iproute2\///'`; \
150a5bc3
SH
36 echo -n "Running $@ [$$o/`uname -r`]: "; \
37 TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \
9ecff68d 38 ERRF="$(RESULTS_DIR)/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > $(RESULTS_DIR)/$@.$$o.out; \
150a5bc3
SH
39 if [ "$$?" = "127" ]; then \
40 echo "SKIPPED"; \
9ecff68d 41 elif [ -e "$(RESULTS_DIR)/$@.$$o.err" ]; then \
82af5315 42 echo "FAILED"; \
150a5bc3
SH
43 else \
44 echo "PASS"; \
45 fi; \
9ecff68d 46 dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \
82af5315 47 done