diff options
| -rwxr-xr-x | tools/lib/lockdep/run_tests.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh index 5334ad9d39b7..1069d96248c1 100755 --- a/tools/lib/lockdep/run_tests.sh +++ b/tools/lib/lockdep/run_tests.sh | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | make &> /dev/null | 3 | make &> /dev/null |
| 4 | 4 | ||
| 5 | for i in `ls tests/*.c`; do | 5 | for i in `ls tests/*.c`; do |
| 6 | testname=$(basename -s .c "$i") | 6 | testname=$(basename "$i" .c) |
| 7 | gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null | 7 | gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null |
| 8 | echo -ne "$testname... " | 8 | echo -ne "$testname... " |
| 9 | if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then | 9 | if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then |
| @@ -11,11 +11,13 @@ for i in `ls tests/*.c`; do | |||
| 11 | else | 11 | else |
| 12 | echo "FAILED!" | 12 | echo "FAILED!" |
| 13 | fi | 13 | fi |
| 14 | rm tests/$testname | 14 | if [ -f "tests/$testname" ]; then |
| 15 | rm tests/$testname | ||
| 16 | fi | ||
| 15 | done | 17 | done |
| 16 | 18 | ||
| 17 | for i in `ls tests/*.c`; do | 19 | for i in `ls tests/*.c`; do |
| 18 | testname=$(basename -s .c "$i") | 20 | testname=$(basename "$i" .c) |
| 19 | gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null | 21 | gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null |
| 20 | echo -ne "(PRELOAD) $testname... " | 22 | echo -ne "(PRELOAD) $testname... " |
| 21 | if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then | 23 | if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then |
| @@ -23,5 +25,7 @@ for i in `ls tests/*.c`; do | |||
| 23 | else | 25 | else |
| 24 | echo "FAILED!" | 26 | echo "FAILED!" |
| 25 | fi | 27 | fi |
| 26 | rm tests/$testname | 28 | if [ -f "tests/$testname" ]; then |
| 29 | rm tests/$testname | ||
| 30 | fi | ||
| 27 | done | 31 | done |
