]> git.proxmox.com Git - mirror_iproute2.git/blame - testsuite/Makefile
tests: Move tc related tests to testsuite/tests/tc folder
[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
14f8854f 7rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
8
9TESTS := $(patsubst tests/%,%,$(call rwildcard,tests/,*.t))
10TESTS_DIR := $(dir $(TESTS))
11
82af5315 12IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*))
f2954312 13
14ifneq (,$(wildcard /proc/config.gz))
15 KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG)
16endif
82af5315 17
150a5bc3 18.PHONY: compile listtests alltests configure $(TESTS)
82af5315 19
150a5bc3
SH
20configure:
21 echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..;
82af5315 22
150a5bc3 23compile: configure
82af5315 24 echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;
25
26listtests:
27 @for t in $(TESTS); do \
28 echo "$$t"; \
29 done
30
31alltests: $(TESTS)
32
33clean:
9ecff68d 34 @rm -rf $(RESULTS_DIR)
82af5315 35
150a5bc3
SH
36distclean: clean
37 echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
38
82af5315 39$(TESTS):
9ecff68d 40 @mkdir -p $(RESULTS_DIR)
14f8854f 41
42 @for d in $(TESTS_DIR); do \
43 mkdir -p $(RESULTS_DIR)/$$d; \
44 done
45
82af5315 46 @for i in $(IPVERS); do \
82af5315 47 o=`echo $$i | sed -e 's/iproute2\///'`; \
150a5bc3
SH
48 echo -n "Running $@ [$$o/`uname -r`]: "; \
49 TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \
9ecff68d 50 ERRF="$(RESULTS_DIR)/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > $(RESULTS_DIR)/$@.$$o.out; \
150a5bc3
SH
51 if [ "$$?" = "127" ]; then \
52 echo "SKIPPED"; \
9ecff68d 53 elif [ -e "$(RESULTS_DIR)/$@.$$o.err" ]; then \
82af5315 54 echo "FAILED"; \
150a5bc3
SH
55 else \
56 echo "PASS"; \
57 fi; \
9ecff68d 58 dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \
82af5315 59 done