Revision 31a639f6

View differences:

Makefile
12 12
$(LIBGRAPES):
13 13
	$(MAKE) -C $(GRAPES)
14 14

  
15
tests:
16
	$(MAKE) -C test
17
	test/run_tests.sh
18

  
15 19
clean:
16 20
	$(MAKE) -C src/ clean
21
	$(MAKE) -C test/ clean
17 22
	rm -f pstreamer
18 23

  
19 24
.PHONY: clean
test/run_tests.sh
1 1
#!/bin/bash
2 2

  
3
info() {
4
	echo -e "\E[33m$@\033[0m"
5
}
6

  
7
error() {
8
	echo -e "\E[31m$@\033[0m"
9
}
10

  
11
success() {
12
	echo -e "\E[32m$@\033[0m"
13
}
14

  
3 15
TDIR="$(dirname $0)"
4
for t in $(ls $TDIR/*.test); do
5
	./$t
16
FILES=(`ls $TDIR/*.test`)
17
i=0
18
while [ $i -lt ${#FILES[@]} ]; do
19
	info "Running ${FILES[$i]}"
20
	res=$(${FILES[$i]} 2>&1)
21
	if [ $? -ne 0 ]; then
22
		error "$res"
23
		exit 1
24
	fi
25
	info "Valgrind on ${FILES[$i]}"
26
	res=$(valgrind --leak-check=full ${FILES[$i]} 2>&1 | awk '/ERROR SUMMARY/ {print $4}')
27
	if [ $res -gt 0 ]; then
28
		error "Memory error on ${FILES[$i]}"
29
		error $(valgrind --leak-check=full ${FILES[$i]})
30
		exit 1
31
	fi
32
	success "Test Passed"
33
	i=$((i+1))
6 34
done

Also available in: Unified diff