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