blob: 1069d96248c168960b225fcda8a7bad60edf0db0 [file] [log] [blame]
Sasha Levin878f9682013-06-13 18:41:19 -04001#! /bin/bash
2
3make &> /dev/null
4
5for i in `ls tests/*.c`; do
Sedat Dileka189c012016-03-30 10:22:49 +02006 testname=$(basename "$i" .c)
Sasha Levin878f9682013-06-13 18:41:19 -04007 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
Sedat Dileka189c012016-03-30 10:22:49 +020014 if [ -f "tests/$testname" ]; then
15 rm tests/$testname
16 fi
Sasha Levin878f9682013-06-13 18:41:19 -040017done
18
19for i in `ls tests/*.c`; do
Sedat Dileka189c012016-03-30 10:22:49 +020020 testname=$(basename "$i" .c)
Sasha Levin878f9682013-06-13 18:41:19 -040021 gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null
22 echo -ne "(PRELOAD) $testname... "
23 if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then
24 echo "PASSED!"
25 else
26 echo "FAILED!"
27 fi
Sedat Dileka189c012016-03-30 10:22:49 +020028 if [ -f "tests/$testname" ]; then
29 rm tests/$testname
30 fi
Sasha Levin878f9682013-06-13 18:41:19 -040031done