2008-09-28 22:49:02 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
2017-07-04 01:01:16 +05:30
|
|
|
run_testsuite=false
|
2012-04-20 18:18:00 +05:30
|
|
|
run_testsuite=true
|
|
|
|
|
2017-07-04 01:01:16 +05:30
|
|
|
run_single_test=false
|
|
|
|
run_single_test=true
|
|
|
|
|
2010-05-10 07:46:43 +05:30
|
|
|
test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
|
|
|
|
test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
|
|
|
|
|
|
|
|
export LIBC="uclibc"
|
2010-11-23 04:19:10 +05:30
|
|
|
export CROSS_COMPILER_PREFIX="i686-"
|
2010-05-10 07:46:43 +05:30
|
|
|
export MAKEOPTS="-j9"
|
|
|
|
|
2008-09-28 22:49:02 +05:30
|
|
|
cnt=0
|
|
|
|
fail=0
|
|
|
|
while sleep 1; do
|
2010-05-10 07:46:43 +05:30
|
|
|
echo "Passes: $cnt Failures: $fail"
|
|
|
|
dir="test.$$"
|
|
|
|
while test -e "$dir" -o -e "failed.$dir"; do
|
|
|
|
dir="test.$$.$RANDOM"
|
|
|
|
done
|
|
|
|
echo "Running randconfig test in $dir..."
|
|
|
|
if ! "$1/scripts/randomtest" "$1" "$dir" >/dev/null; then
|
|
|
|
mv -- "$dir" "failed.$dir"
|
|
|
|
echo "Failed build in: failed.$dir"
|
|
|
|
exit 1 # you may comment this out...
|
|
|
|
let fail++
|
2012-04-20 18:18:00 +05:30
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if $run_testsuite; then
|
2010-05-10 07:46:43 +05:30
|
|
|
(
|
|
|
|
cd -- "$dir/testsuite" || exit 1
|
|
|
|
echo "Running testsuite in $dir..."
|
|
|
|
SKIP_KNOWN_BUGS=1 SKIP_INTERNET_TESTS=1 ./runtest -v >runtest.log 2>&1
|
|
|
|
)
|
|
|
|
if test $? != 0; then
|
|
|
|
echo "Failed runtest in $dir"
|
2016-12-12 15:38:51 +05:30
|
|
|
grep ^FAIL -- "$dir/testsuite/runtest.log"
|
2012-04-20 18:18:00 +05:30
|
|
|
exit 1 # you may comment this out...
|
|
|
|
let fail++
|
|
|
|
continue
|
2010-05-10 07:46:43 +05:30
|
|
|
fi
|
|
|
|
tail -n10 -- "$dir/testsuite/runtest.log"
|
|
|
|
fi
|
2017-07-04 01:01:16 +05:30
|
|
|
if $run_single_test; then
|
|
|
|
(
|
|
|
|
cd -- "$dir" || exit 1
|
|
|
|
echo "Running make_single_applets.sh in $dir..."
|
|
|
|
|
|
|
|
if grep -q '# CONFIG_FEATURE_TFTP_GET is not set' .config \
|
|
|
|
&& grep -q '# CONFIG_FEATURE_TFTP_PUT is not set' .config \
|
|
|
|
; then
|
|
|
|
# If both off, tftp[d] is ifdefed out and test fails.
|
|
|
|
# Enable one:
|
|
|
|
sed 's/# CONFIG_FEATURE_TFTP_GET is not set/CONFIG_FEATURE_TFTP_GET=y/' -i .config
|
|
|
|
fi
|
|
|
|
|
|
|
|
./make_single_applets.sh
|
|
|
|
)
|
|
|
|
if test $? != 0; then
|
|
|
|
echo "Failed make_single_applets.sh in $dir"
|
|
|
|
exit 1 # you may comment this out...
|
|
|
|
let fail++
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
fi
|
2017-12-31 22:00:02 +05:30
|
|
|
grep -i 'warning:' "$dir/make.log"
|
2012-04-20 18:18:00 +05:30
|
|
|
rm -rf -- "$dir"
|
2010-05-10 07:46:43 +05:30
|
|
|
let cnt++
|
2008-09-28 22:49:02 +05:30
|
|
|
done
|