X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=testsuite%2FMakefile;h=2a4e0ba9bfca8615b0dc312c8ed80f39d2f40f4d;hb=fcabec0aee42af28e2846ef3674ed7ba7be72c42;hp=5661cea554b3793d2131530f799e65ab0fd564cb;hpb=cb820e861caa85bb3942ab0c673e04b9408be0ad;p=iproute2.git diff --git a/testsuite/Makefile b/testsuite/Makefile index 5661cea..2a4e0ba 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -1,11 +1,18 @@ -TESTS := $(patsubst tests/%,%,$(wildcard tests/*)) +## -- Config -- +DEV := lo +PREFIX := sudo +## -- End Config -- + +TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t)) IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*)) +KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG) -DEV := eth0 +.PHONY: compile listtests alltests configure $(TESTS) -.PHONY: compile listtests alltests $(TESTS) +configure: + echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..; -compile: +compile: configure echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..; listtests: @@ -18,16 +25,21 @@ alltests: $(TESTS) clean: @rm -rf results/* +distclean: clean + echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..; + $(TESTS): @for i in $(IPVERS); do \ - echo -n "Running $@ with $$i on `uname -r`: "; \ - logger "TESTMARK: $@"; \ o=`echo $$i | sed -e 's/iproute2\///'`; \ - TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" sudo tests/$@ > results/$@.$$o.out 2> results/$@.$$o.err; \ - dmesg > results/$@.$$o.dmesg; \ - if [ -z "`cat results/$@.$$o.err`" ]; then \ - echo "PASS"; \ - else \ + echo -n "Running $@ [$$o/`uname -r`]: "; \ + TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \ + ERRF="results/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > results/$@.$$o.out; \ + if [ "$$?" = "127" ]; then \ + echo "SKIPPED"; \ + elif [ -e "results/$@.$$o.err" ]; then \ echo "FAILED"; \ - fi \ + else \ + echo "PASS"; \ + fi; \ + dmesg > results/$@.$$o.dmesg; \ done