bisect-run.sh 909 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. set -e
  3. path="$(dirname $0)"
  4. test="$1"
  5. makedir="$2"
  6. if [ -z $test ] ; then
  7. echo "This script helps bisect test failures, given a test case."
  8. echo ""
  9. echo "Use it like this:"
  10. echo " git bisect start"
  11. echo " git bisect bad <commit>"
  12. echo " git bisect good <commit>"
  13. echo " git bisect run $0 <test name> [<compile directory>]"
  14. echo ""
  15. echo "(the compile directory is optional, use it if you want to"
  16. echo "use an out-of-tree kernel build."
  17. echo ""
  18. echo "Note that, of course, you have to have a working vm-run setup."
  19. exit 200 # exit git bisect run if called that way
  20. fi
  21. if [ -n "$makedir" ] ; then
  22. cd "$makedir"
  23. fi
  24. yes '' | make oldconfig || exit 125
  25. make -j8 || exit 125
  26. output=$(mktemp)
  27. if [ $? -ne 0 ] ; then
  28. exit 202
  29. fi
  30. finish() {
  31. rm -f $output
  32. }
  33. trap finish EXIT
  34. "$path/vm-run.sh" $test 2>&1 | tee $output
  35. grep -q 'ALL-PASSED' $output && exit 0 || exit 1