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