summaryrefslogtreecommitdiffstats
path: root/testsuite/Makefile
blob: 5661cea554b3793d2131530f799e65ab0fd564cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
TESTS := $(patsubst tests/%,%,$(wildcard tests/*))
IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*))

DEV := eth0

.PHONY: compile listtests alltests $(TESTS)

compile:
	echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;

listtests:
	@for t in $(TESTS); do \
		echo "$$t"; \
	done

alltests: $(TESTS)

clean:
	@rm -rf results/*

$(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 "FAILED"; \
		fi \
	done