randomtest.loop 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. run_testsuite=true
  3. test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
  4. test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
  5. export LIBC="uclibc"
  6. export CROSS_COMPILER_PREFIX="i686-"
  7. export MAKEOPTS="-j9"
  8. cnt=0
  9. fail=0
  10. while sleep 1; do
  11. echo "Passes: $cnt Failures: $fail"
  12. dir="test.$$"
  13. while test -e "$dir" -o -e "failed.$dir"; do
  14. dir="test.$$.$RANDOM"
  15. done
  16. echo "Running randconfig test in $dir..."
  17. if ! "$1/scripts/randomtest" "$1" "$dir" >/dev/null; then
  18. mv -- "$dir" "failed.$dir"
  19. echo "Failed build in: failed.$dir"
  20. exit 1 # you may comment this out...
  21. let fail++
  22. continue
  23. fi
  24. if $run_testsuite; then
  25. (
  26. cd -- "$dir/testsuite" || exit 1
  27. echo "Running testsuite in $dir..."
  28. SKIP_KNOWN_BUGS=1 SKIP_INTERNET_TESTS=1 ./runtest -v >runtest.log 2>&1
  29. )
  30. if test $? != 0; then
  31. echo "Failed runtest in $dir"
  32. exit 1 # you may comment this out...
  33. let fail++
  34. continue
  35. fi
  36. tail -n10 -- "$dir/testsuite/runtest.log"
  37. fi
  38. rm -rf -- "$dir"
  39. let cnt++
  40. done