diff options
| -rwxr-xr-x | tools/lib/lockdep/run_tests.sh | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh index 2e570a188f16..9f31f84e7fac 100755 --- a/tools/lib/lockdep/run_tests.sh +++ b/tools/lib/lockdep/run_tests.sh | |||
| @@ -1,13 +1,17 @@ | |||
| 1 | #! /bin/bash | 1 | #! /bin/bash |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | 3 | ||
| 4 | make &> /dev/null | 4 | if ! make >/dev/null; then |
| 5 | echo "Building liblockdep failed." | ||
| 6 | echo "FAILED!" | ||
| 7 | exit 1 | ||
| 8 | fi | ||
| 5 | 9 | ||
| 6 | for i in `ls tests/*.c`; do | 10 | for i in `ls tests/*.c`; do |
| 7 | testname=$(basename "$i" .c) | 11 | testname=$(basename "$i" .c) |
| 8 | gcc -o tests/$testname -pthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null | ||
| 9 | echo -ne "$testname... " | 12 | echo -ne "$testname... " |
| 10 | if [ $(timeout 1 ./tests/$testname 2>&1 | wc -l) -gt 0 ]; then | 13 | if gcc -o "tests/$testname" -pthread "$i" liblockdep.a -Iinclude -D__USE_LIBLOCKDEP && |
| 14 | [ "$(timeout 1 "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then | ||
| 11 | echo "PASSED!" | 15 | echo "PASSED!" |
| 12 | else | 16 | else |
| 13 | echo "FAILED!" | 17 | echo "FAILED!" |
| @@ -19,9 +23,9 @@ done | |||
| 19 | 23 | ||
| 20 | for i in `ls tests/*.c`; do | 24 | for i in `ls tests/*.c`; do |
| 21 | testname=$(basename "$i" .c) | 25 | testname=$(basename "$i" .c) |
| 22 | gcc -o tests/$testname -pthread -Iinclude $i &> /dev/null | ||
| 23 | echo -ne "(PRELOAD) $testname... " | 26 | echo -ne "(PRELOAD) $testname... " |
| 24 | if [ $(timeout 1 ./lockdep ./tests/$testname 2>&1 | wc -l) -gt 0 ]; then | 27 | if gcc -o "tests/$testname" -pthread -Iinclude "$i" && |
| 28 | [ "$(timeout 1 ./lockdep "./tests/$testname" 2>&1 | wc -l)" -gt 0 ]; then | ||
| 25 | echo "PASSED!" | 29 | echo "PASSED!" |
| 26 | else | 30 | else |
| 27 | echo "FAILED!" | 31 | echo "FAILED!" |
