3
0

randomtest.loop 1.9 KB

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