1999-10-16 03:25:02 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# create test file to use first; since we don't know where the tree
|
|
|
|
# is, and we need full pathnames in the file, we create it on the fly.
|
|
|
|
|
2001-05-11 06:17:35 +04:00
|
|
|
case $1 in
|
|
|
|
baseline|verify)
|
|
|
|
MODE=$1
|
|
|
|
;;
|
1999-10-16 03:25:02 +04:00
|
|
|
|
2001-05-11 06:17:35 +04:00
|
|
|
clean)
|
|
|
|
rm -r -f verify baseline
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 baseline|verify|clean"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
run_tests() {
|
|
|
|
print_flags=
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case $1 in
|
|
|
|
-m) shift
|
|
|
|
mode=$1
|
|
|
|
;;
|
|
|
|
|
|
|
|
-p) print_flags="-Prt 1"
|
|
|
|
;;
|
|
|
|
|
|
|
|
-f) shift
|
|
|
|
tests_file=$1
|
|
|
|
;;
|
|
|
|
|
|
|
|
*) echo "unknown option $1 to run_tests()"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "$tests_file" ]; then
|
|
|
|
echo "no tests file specified to run_tests()"
|
|
|
|
exit 1
|
|
|
|
fi
|
2002-04-14 21:50:50 +04:00
|
|
|
w1=`uname | grep WIN`
|
2001-05-11 06:17:35 +04:00
|
|
|
if [ "$mode" = "baseline" ]; then
|
2002-04-14 21:50:50 +04:00
|
|
|
echo baseline
|
2001-05-11 06:17:35 +04:00
|
|
|
rm -r -f baseline
|
2001-05-17 05:14:29 +04:00
|
|
|
mkdir baseline
|
2001-05-11 06:17:35 +04:00
|
|
|
echo
|
2002-04-14 21:50:50 +04:00
|
|
|
if [ "$w1" = "" ]; then
|
2001-05-11 06:17:35 +04:00
|
|
|
echo $MOZ_TEST_VIEWER $print_flags -o baseline/ -f $tests_file
|
|
|
|
$MOZ_TEST_VIEWER $print_flags -o baseline/ -f $tests_file
|
2002-04-14 21:50:50 +04:00
|
|
|
else
|
|
|
|
echo $MOZ_TEST_VIEWER $print_flags -o baseline\\ -f $tests_file
|
|
|
|
$MOZ_TEST_VIEWER $print_flags -o baseline\\ -f $tests_file
|
|
|
|
fi
|
2001-05-11 06:17:35 +04:00
|
|
|
elif [ "$mode" = "verify" ]; then
|
|
|
|
rm -r -f verify
|
|
|
|
mkdir verify
|
|
|
|
echo
|
2002-04-14 21:50:50 +04:00
|
|
|
if [ "$w1" = "" ]; then
|
2003-10-15 23:08:35 +04:00
|
|
|
echo $MOZ_TEST_VIEWER $print_flags -B 1 -o verify/ -f $tests_file
|
|
|
|
$MOZ_TEST_VIEWER $print_flags -B 1 -o verify/ -rd baseline/ -f $tests_file
|
2002-04-14 21:50:50 +04:00
|
|
|
else
|
2003-10-15 23:08:35 +04:00
|
|
|
echo $MOZ_TEST_VIEWER $print_flags -B 1 -o verify\\ -rd baseline\\ -f $tests_file
|
|
|
|
$MOZ_TEST_VIEWER $print_flags -B 1 -o verify\\ -rd baseline\\ -f $tests_file
|
2002-04-14 21:50:50 +04:00
|
|
|
fi
|
2001-05-11 06:17:35 +04:00
|
|
|
else
|
|
|
|
echo "no mode specified to run_tests()"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
2003-10-15 23:08:35 +04:00
|
|
|
|
2002-04-14 21:50:50 +04:00
|
|
|
w1=`uname | grep WIN`
|
|
|
|
if [ "$w1" = "" ]; then
|
|
|
|
TESTS_FILE=/tmp/$$-tests.txt
|
|
|
|
else
|
2003-10-15 23:08:35 +04:00
|
|
|
TESTS_FILE=$TEMP/$$-tests.txt
|
2002-04-14 21:50:50 +04:00
|
|
|
TESTS_FILE=`cygpath -w $TESTS_FILE`
|
2003-10-15 23:08:35 +04:00
|
|
|
MOZ_TEST_BASE=`cygpath -m $MOZ_TEST_BASE`
|
2002-04-14 21:50:50 +04:00
|
|
|
fi
|
2003-10-15 23:08:35 +04:00
|
|
|
|
2001-05-11 06:17:35 +04:00
|
|
|
cp /dev/null $TESTS_FILE
|
2001-03-27 10:09:16 +04:00
|
|
|
|
|
|
|
for FILE in `ls file_list.txt file_list[0-9].txt 2> /dev/null`; do
|
|
|
|
egrep -v "^#" < $FILE \
|
|
|
|
| sed -e "s@file:///s\(:\||\)@file://$MOZ_TEST_BASE@" \
|
2001-05-11 06:17:35 +04:00
|
|
|
>> $TESTS_FILE
|
2001-03-27 10:09:16 +04:00
|
|
|
done
|
|
|
|
|
2001-05-11 06:17:35 +04:00
|
|
|
if [ -s $TESTS_FILE ]; then
|
|
|
|
run_tests -m $MODE -f $TESTS_FILE
|
2001-03-27 10:09:16 +04:00
|
|
|
fi
|
1999-10-16 03:25:02 +04:00
|
|
|
|
2001-05-11 06:17:35 +04:00
|
|
|
if [ -f file_list_printing.txt ]; then
|
|
|
|
egrep -v "^#" < file_list_printing.txt \
|
|
|
|
| sed -e "s@file:///s\(:\||\)@file://$MOZ_TEST_BASE@" \
|
|
|
|
> $TESTS_FILE
|
|
|
|
|
|
|
|
if [ -s $TESTS_FILE ]; then
|
|
|
|
run_tests -p -m $MODE -f $TESTS_FILE
|
|
|
|
fi
|
1999-10-16 03:25:02 +04:00
|
|
|
fi
|
2001-05-11 06:17:35 +04:00
|
|
|
|