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