[Po4a-commits] po4a/testsuite check,1.4,1.5
Nicolas FRAN??OIS
po4a-devel@lists.alioth.debian.org
Sat, 02 Oct 2004 13:40:10 +0000
Update of /cvsroot/po4a/po4a/testsuite
In directory haydn:/tmp/cvs-serv28095
Modified Files:
check
Log Message:
Add a usage (when called with -h).
Use DIFF and WDIFF variables to configure how diff and wdiff have to be
called.
Index: check
===================================================================
RCS file: /cvsroot/po4a/po4a/testsuite/check,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- check 24 Sep 2004 13:42:21 -0000 1.4
+++ check 2 Oct 2004 13:40:07 -0000 1.5
@@ -1,7 +1,39 @@
#! /bin/sh
module=man
-rm -f LISTE*
+DIFF="diff -uBb"
+WDIFF="wdiff -3 -n"
+
+if [ $# = 1 ] && [ $1 = "-h" ] ; then
+ if [ "$module" = "man" ] ; then
+ echo "\
+Compare how are displayed an original man page and the po4a-normalized one.
+Usage: $0
+ Check all man pages found in /usr/share/man/man[1-8]
+ $0 <space separated list of man pages>
+ Check the specified man pages.
+$0 erases all LISTE.* files in the current directory and creates
+the following files:
+LISTE.TOTAL List of all the checked man pages
+LISTE.OK List of the man pages for which $DIFF does not see a difference.
+LISTE.OK2 $DIFF does not see a difference afetr converting hyphens
+ to minus signs, `` to \", and '' to \" (in both pages).
+LISTE.WOK1 $WDIFF doesn't see any difference after the same modifications
+LISTE.WOK2 This tries to detect changes in the hyphenation of words.
+LISTE.WOK3 This removes minus signs, and thus detects more changes in
+ hyphenation. It also mask font changes.
+LISTE.PBS po4a preferred to stop processing the man page (non
+ supported,...)
+LISTE.WDIFF These are probably bugs in po4a or in the man page
+LISTE.IGN man pages po4a refused to operate on (e.g. were generated by
+ Pod::Man)
+You may wish to use stats.sh to compare to runs of $0."
+ fi
+
+ exit 0
+fi
+
+rm -f LISTE.*
touch LISTE.{TOTAL,OK,OK2,WDIFF,PBS,IGN,WOK1,WOK2,WOK3}
if [ $# != 0 ] ; then
@@ -54,8 +86,8 @@
$cmdtotxt $tmp/po4a-normalize.output $tmp/$newfich;
$cmdtotxt $tmp/$newfich $tmp/$newfich;
echo $fich
- echo "diff -uBb $tmp/$newfich.txt $tmp/po4a-normalize.output.txt"
- if diff -uBb $tmp/$newfich.txt $tmp/po4a-normalize.output.txt ; then
+ echo "$DIFF $tmp/$newfich.txt $tmp/po4a-normalize.output.txt"
+ if $DIFF $tmp/$newfich.txt $tmp/po4a-normalize.output.txt ; then
echo ">ok"
echo $fich >> LISTE.OK
else
@@ -71,15 +103,15 @@
gsub("\xE2\x80\x99\xE2\x80\x99","\xE2\x80\x9D");
print}' $tmp/po4a-normalize.output.txt > $tmp/po4a-normalize.ignore
echo $fich
- echo "diff -uBb $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore"
- if diff -uBb $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore ; then
+ echo "$DIFF $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore"
+ if $DIFF $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore ; then
echo ">ok2"
echo $fich >> LISTE.OK2
else
echo $fich
- echo "wdiff -3 -n $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore"
- if wdiff -3 -n $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore; then
- echo ">wok"
+ echo "$WDIFF $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore"
+ if $WDIFF $tmp/"$newfich"_ignore $tmp/po4a-normalize.ignore; then
+ echo ">wok1"
echo $fich >> LISTE.WOK1
else
awk 'BEGIN{RS=";";ORS=";"}
@@ -102,12 +134,12 @@
{gsub("-\n +","-");
print}' $tmp/po4a-normalize.ignore > $tmp/po4a-normalize.ignore2b
echo $fich
- echo "wdiff -3 -n $tmp/"$newfich"_ignore2 $tmp/po4a-normalize.ignore2"
- wdiff -3 -n $tmp/"$newfich"_ignore2 $tmp/po4a-normalize.ignore2
+ echo "$WDIFF $tmp/"$newfich"_ignore2 $tmp/po4a-normalize.ignore2"
+ $WDIFF $tmp/"$newfich"_ignore2 $tmp/po4a-normalize.ignore2
ret1=$?
echo $fich
- echo "wdiff -3 -n $tmp/"$newfich"_ignore2b $tmp/po4a-normalize.ignore2b"
- wdiff -3 -n $tmp/"$newfich"_ignore2b $tmp/po4a-normalize.ignore2b
+ echo "$WDIFF $tmp/"$newfich"_ignore2b $tmp/po4a-normalize.ignore2b"
+ $WDIFF $tmp/"$newfich"_ignore2b $tmp/po4a-normalize.ignore2b
ret2=$?
if [ $ret1 = 0 ] || [ $ret2 = 0 ]; then
echo ">wok2"
@@ -128,8 +160,8 @@
print}' $tmp/po4a-normalize.ignore3_tmp > $tmp/po4a-normalize.ignore3
echo $fich
- echo "wdiff -3 -n $tmp/"$newfich"_ignore3 $tmp/po4a-normalize.ignore3"
- if wdiff -3 -n $tmp/"$newfich"_ignore3 $tmp/po4a-normalize.ignore3
+ echo "$WDIFF $tmp/"$newfich"_ignore3 $tmp/po4a-normalize.ignore3"
+ if $WDIFF $tmp/"$newfich"_ignore3 $tmp/po4a-normalize.ignore3
then
echo ">wok3"
echo $fich >> LISTE.WOK3
@@ -140,12 +172,12 @@
fi
fi
fi
- fi
+ fi
else
echo ">ign"
echo $fich >> LISTE.IGN
fi
- else
+ else
echo ">pbs"
echo $fich >> LISTE.PBS
fi