massive update of testall.sh

This commit is contained in:
Geoff R. McLane 2015-09-18 20:15:12 +02:00
parent ff101d5dee
commit 0386e0fa91

View file

@ -1,38 +1,70 @@
#! /bin/sh #! /bin/sh
# #
# testall.sh - execute all testcases for regression testing # testall.sh - execute all testcases for regression testing
# #
# (c) 1998-2003 (W3C) MIT, ERCIM, Keio University # (c) 1998-2015 (W3C) MIT, ERCIM, Keio University
# See tidy.c for the copyright notice. # See tidy.c for the copyright notice.
# #
# <URL:http://www.html-tidy.org/> # <URL:http://www.html-tidy.org/>
# #
# set -x # set -x
BN=`basename $0`
VERSION='$Id' d_now()
{
date +%Y%m%d%H%M%S
}
BUGS="426885 427633 427662 427664 427671 427672 427675 427676 427677\ # testone.sh uses tempall.txt, so
427810 427811 427813 427816 427818 427819 427820 427821 427822 427823\ TMPLOG="tempall.txt"
427825 427826 427827 427830 427833 427834 427835 427836 427837 427838 427839\ # same EXE
427840 427841 427845 427846 431716 431721 431731 431736\ TMPTIDY=../build/cmake/tidy
431739 431874 431889 431895 431898 431958 431964 432677 433012\
433021 433040 433359 433360 433656 433666 433672 433856 434047 434100\
434940 435903 435917 435919 435920 435922 435923 437468 438650\
438658 438954 438956 441508 441568 443362 443576 443678 445074 445394\
445557 449348 470663 480701 487204 487283 501669 504206 505770 511679\
533233 540571 543262 545772 553468 566542 586555 586562 588061 593705 616744\
620531 629885 634889 640473 640474 646946 647255 647900 649812 655338\
656889 658230 660397 661606 676156 676205 688746 695408 696799"
if [ -f testall.txt ]; then TMPNOW=`d_now`
rm -f testall.txt TMPINP="testcases.txt"
if [ ! -f "testone.sh" ]; then
echo "$BN: Can not locate testone.sh script!"
exit 1
fi
if [ ! -f "$TMPINP" ]; then
echo "$BN: Can not locate $TMPINP file!"
exit 1
fi fi
# for bugNo in ${BUGS}
# count the tests
TMPCNT=0
while read bugNo expected while read bugNo expected
do do
# echo Testing $bugNo | tee -a testall.log TMPCNT=`expr $TMPCNT + 1`
./testone.sh $bugNo $expected "$@" | tee -a testall.log done < $TMPINP
done < testcases.txt
# output a header
if [ -f "$TMPLOG" ]; then
rm -f $TMPLOG
fi
echo "$BN: Will process $TMPCNT tests from $TMPINP on $TMPNOW"
echo "$BN: Will process $TMPCNT tests from $TMPINP on $TMPNOW" > $TMPLOG
echo "$BN: Tidy version in use..." >> $TMPLOG
$TMPTIDY -v >> $TMPLOG
if [ ! "$?" = "0" ]; then
echo "$BN: Error $? running $TMPTIDY!"
exit 1
fi
echo "========================================" >> $TMPLOG
# do the tests
while read bugNo expected
do
# echo Testing $bugNo | tee -a $TMPLOG
./testone.sh $bugNo $expected | tee -a $TMPLOG
done < $TMPINP
echo "========================================" >> $TMPLOG
echo "$BN: Done $TMPCNT tests..." >> $TMPLOG
echo "# eof"
echo "$BN: Done $TMPCNT tests - see $TMPLOG"
# eof