2007-05-11 12:57:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2008-06-17 07:24:29 +00:00
|
|
|
unset LANG LANGUAGE
|
|
|
|
unset LC_COLLATE
|
|
|
|
unset LC_CTYPE
|
|
|
|
unset LC_MONETARY
|
|
|
|
unset LC_MESSAGES
|
|
|
|
unset LC_NUMERIC
|
|
|
|
unset LC_TIME
|
|
|
|
unset LC_ALL
|
|
|
|
|
2008-02-10 12:10:08 +00:00
|
|
|
test -x hush || {
|
2009-06-01 20:33:05 +00:00
|
|
|
echo "No ./hush - creating a link to ../../busybox"
|
|
|
|
ln -s ../../busybox hush
|
2008-02-10 12:10:08 +00:00
|
|
|
}
|
2009-04-09 07:49:43 +00:00
|
|
|
if test -e ../../.config ; then
|
|
|
|
eval $(sed -e '/^#/d' -e '/^$/d' -e 's:^:export :' ../../.config)
|
|
|
|
fi
|
2007-05-11 12:57:35 +00:00
|
|
|
|
|
|
|
PATH="$PWD:$PATH" # for hush and recho/zecho/printenv
|
|
|
|
export PATH
|
|
|
|
|
|
|
|
THIS_SH="$PWD/hush"
|
|
|
|
export THIS_SH
|
|
|
|
|
|
|
|
do_test()
|
|
|
|
{
|
2009-06-01 20:33:05 +00:00
|
|
|
test -d "$1" || return 0
|
|
|
|
d=${d%/}
|
|
|
|
# echo Running tests in directory "$1"
|
|
|
|
(
|
|
|
|
tret=0
|
|
|
|
cd "$1" || { echo "cannot cd $1!"; exit 1; }
|
|
|
|
for x in run-*; do
|
2007-05-11 12:57:35 +00:00
|
|
|
test -f "$x" || continue
|
|
|
|
case "$x" in
|
2009-06-01 20:33:05 +00:00
|
|
|
"$0"|run-minimal|run-gprof) ;;
|
|
|
|
*.orig|*~) ;;
|
|
|
|
#*) echo $x ; sh $x ;;
|
|
|
|
*)
|
|
|
|
sh "$x" >"../$1-$x.fail" 2>&1 && \
|
|
|
|
{ echo "$1/$x: ok"; rm "../$1-$x.fail"; } || echo "$1/$x: fail";
|
|
|
|
;;
|
2007-05-11 12:57:35 +00:00
|
|
|
esac
|
2009-06-01 20:33:05 +00:00
|
|
|
done
|
|
|
|
# Many bash run-XXX scripts just do this,
|
|
|
|
# no point in duplication it all over the place
|
|
|
|
for x in *.tests; do
|
2007-05-11 12:57:35 +00:00
|
|
|
test -x "$x" || continue
|
|
|
|
name="${x%%.tests}"
|
|
|
|
test -f "$name.right" || continue
|
2009-04-06 18:08:35 +00:00
|
|
|
# echo Running test: "$x"
|
2009-04-09 07:49:43 +00:00
|
|
|
(
|
2009-06-01 20:33:05 +00:00
|
|
|
"$THIS_SH" "./$x" >"$name.xx" 2>&1
|
|
|
|
# filter C library differences
|
|
|
|
sed -i \
|
|
|
|
-e "/: invalid option /s:'::g" \
|
|
|
|
"$name.xx"
|
|
|
|
test $? -eq 77 && rm -f "../$1-$x.fail" && exit 77
|
|
|
|
diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
|
2009-04-09 07:49:43 +00:00
|
|
|
)
|
|
|
|
case $? in
|
|
|
|
0) echo "$1/$x: ok";;
|
|
|
|
77) echo "$1/$x: skip (feature disabled)";;
|
|
|
|
*) echo "$1/$x: fail"; tret=1;;
|
|
|
|
esac
|
2009-06-01 20:33:05 +00:00
|
|
|
done
|
|
|
|
exit ${tret}
|
|
|
|
)
|
2007-05-11 12:57:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Main part of this script
|
|
|
|
# Usage: run-all [directories]
|
|
|
|
|
2009-03-28 15:43:47 +00:00
|
|
|
ret=0
|
|
|
|
|
2007-05-11 12:57:35 +00:00
|
|
|
if [ $# -lt 1 ]; then
|
2009-06-01 20:33:05 +00:00
|
|
|
# All sub directories
|
|
|
|
modules=`ls -d hush-*`
|
2007-05-11 12:57:35 +00:00
|
|
|
|
2009-06-01 20:33:05 +00:00
|
|
|
for module in $modules; do
|
2009-03-28 15:43:47 +00:00
|
|
|
do_test $module || ret=1
|
2009-06-01 20:33:05 +00:00
|
|
|
done
|
2007-05-11 12:57:35 +00:00
|
|
|
else
|
2009-06-01 20:33:05 +00:00
|
|
|
while [ $# -ge 1 ]; do
|
2007-05-11 12:57:35 +00:00
|
|
|
if [ -d $1 ]; then
|
2009-06-01 20:33:05 +00:00
|
|
|
do_test $1 || ret=1
|
2007-05-11 12:57:35 +00:00
|
|
|
fi
|
|
|
|
shift
|
2009-06-01 20:33:05 +00:00
|
|
|
done
|
2007-05-11 12:57:35 +00:00
|
|
|
fi
|
2009-03-28 15:43:47 +00:00
|
|
|
|
|
|
|
exit ${ret}
|