3
0

randomtest.loop 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/sh
  2. run_testsuite=false
  3. run_testsuite=true
  4. run_single_test=false
  5. run_single_test=true
  6. test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
  7. test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
  8. export LIBC="uclibc"
  9. export CROSS_COMPILER_PREFIX="i686-"
  10. export MAKEOPTS="-j9"
  11. cnt=0
  12. fail=0
  13. while sleep 1; do
  14. echo "Passes: $cnt Failures: $fail"
  15. dir="test.$$"
  16. while test -e "$dir" -o -e "failed.$dir"; do
  17. dir="test.$$.$RANDOM"
  18. done
  19. echo "Running randconfig test in $dir..."
  20. if ! "$1/scripts/randomtest" "$1" "$dir" >/dev/null; then
  21. mv -- "$dir" "failed.$dir"
  22. echo "Failed build in: failed.$dir"
  23. exit 1 # you may comment this out...
  24. let fail++
  25. continue
  26. fi
  27. if $run_testsuite; then
  28. (
  29. cd -- "$dir/testsuite" || exit 1
  30. echo "Running testsuite in $dir..."
  31. SKIP_KNOWN_BUGS=1 SKIP_INTERNET_TESTS=1 ./runtest -v >runtest.log 2>&1
  32. )
  33. if test $? != 0; then
  34. echo "Failed runtest in $dir"
  35. grep ^FAIL -- "$dir/testsuite/runtest.log"
  36. exit 1 # you may comment this out...
  37. let fail++
  38. continue
  39. fi
  40. tail -n10 -- "$dir/testsuite/runtest.log"
  41. fi
  42. if $run_single_test; then
  43. (
  44. cd -- "$dir" || exit 1
  45. echo "Running make_single_applets.sh in $dir..."
  46. if grep -q '# CONFIG_FEATURE_TFTP_GET is not set' .config \
  47. && grep -q '# CONFIG_FEATURE_TFTP_PUT is not set' .config \
  48. ; then
  49. # If both off, tftp[d] is ifdefed out and test fails.
  50. # Enable one:
  51. sed 's/# CONFIG_FEATURE_TFTP_GET is not set/CONFIG_FEATURE_TFTP_GET=y/' -i .config
  52. fi
  53. ./make_single_applets.sh
  54. )
  55. if test $? != 0; then
  56. echo "Failed make_single_applets.sh in $dir"
  57. exit 1 # you may comment this out...
  58. let fail++
  59. continue
  60. fi
  61. fi
  62. rm -rf -- "$dir"
  63. let cnt++
  64. done