1#! /bin/bash
2
3make &> /dev/null
4
5for i in `ls tests/*.c`; do
6	testname=$(basename -s .c "$i")
7	gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null
8	echo -ne "$testname... "
9	if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then
10		echo "PASSED!"
11	else
12		echo "FAILED!"
13	fi
14	rm tests/$testname
15done
16
17for i in `ls tests/*.c`; do
18	testname=$(basename -s .c "$i")
19	gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null
20	echo -ne "(PRELOAD) $testname... "
21	if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then
22		echo "PASSED!"
23	else
24		echo "FAILED!"
25	fi
26	rm tests/$testname
27done
28