run_tests.sh 753 B

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