[Libreoffice-commits] .: test/ooxml

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Thu Nov 18 05:29:28 PST 2010


 test/ooxml/.gitignore |    2 ++
 test/ooxml/run.sh     |   49 ++++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 42 insertions(+), 9 deletions(-)

New commits:
commit bf5122f61468d0a3e8dc10cc10700535bc6d0c7c
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Thu Nov 18 14:28:40 2010 +0100

    OOXML tests improvements
    
    * Silent output: everything dumped to a file
    * Validation progress indicator

diff --git a/test/ooxml/.gitignore b/test/ooxml/.gitignore
index 6bfe6b1..620eeb8 100644
--- a/test/ooxml/.gitignore
+++ b/test/ooxml/.gitignore
@@ -1 +1,3 @@
+*.log
 log
+out
diff --git a/test/ooxml/run.sh b/test/ooxml/run.sh
index a817059..35b0a9d 100755
--- a/test/ooxml/run.sh
+++ b/test/ooxml/run.sh
@@ -5,32 +5,49 @@ TOOLSDIR=$2
 
 . $TOOLSDIR/bin/setup >/dev/null 2>&1
 
+RUN_LOG=`dirname $0`/run.log
+REDIRECT=">>$RUN_LOG 2>&1"
+touch $RUN_LOG
+
 LOGS=`dirname $0`/log
 OUTDIR=`dirname $0`/out
 
+function show_progress()
+{
+    msg="$1: $2%"
+    i=0
+    backs=
+    while test $((i<${#msg})) == 1; do
+        backs=$backs
+        let i++
+    done
+    unset i
+    echo -en $msg$backs
+}
+
 function get_deps()
 {
     # The test data
     cd $CLONEDIR
     if test -d test-files ;then
         cd test-files
-        git pull -r
+        git pull -r >>$RUN_LOG 2>&1
     else
-        git clone $OOO_GIT/contrib/test-files
+        git clone $OOO_GIT/contrib/test-files >>$RUN_LOG 2>&1
     fi
 
     #OfficeOTron
     cd $CLONEDIR
     if test -d officeotron ; then
         cd officeotron
-        svn update
+        svn update >>$RUN_LOG 2>&1
     else
-        svn checkout http://officeotron.googlecode.com/svn/trunk/ officeotron
+        svn checkout http://officeotron.googlecode.com/svn/trunk/ officeotron >>$RUN_LOG 2>&1
     fi
 
     # Make / update the officeotrong jar file
     cd $CLONEDIR/officeotron
-    ant application
+    ant application >>$RUN_LOG 2>&1
 
     # Get the version
     OFFICEOTRON_VERSION=`cat build.xml | grep 'name="version"' | sed -e 's:.*name="version"\ value="\([^"]\+\)".*:\1:'`
@@ -63,29 +80,43 @@ function validate()
     return $RESULT
 }
 
+# Clean the previous results
+if test -d $OUTDIR; then
+    rm -r $OUTDIR
+fi
+if test -d $LOGS; then
+    rm -r $LOGS
+fi
+
 # Make sure we have the dependencies
 get_deps
 
 # Generate the test files
 TEST_FILES_DIR=$CLONEDIR/test-files
-cd $TEST_FILES_DIR && make
+cd $TEST_FILES_DIR && make >>$RUN_LOG 2>&1
 cd $OLDPWD
 
 # Load and save the test files
 if test -e $ooinstall/program/ooenv; then
     . $ooinstall/program/ooenv
 fi
-$ooinstall/program/soffice.bin -convert-to docx:"Office Open XML Text" -outdir $OUTDIR $TEST_FILES_DIR/ooxml-strict/tmp/*.docx
-$ooinstall/program/soffice.bin -convert-to xlsx:"Calc Office Open XML" -outdir $OUTDIR $TEST_FILES_DIR/ooxml-strict/tmp/*.xslx
-$ooinstall/program/soffice.bin -convert-to pptx:"Impress Office Open XML" -outdir $OUTDIR $TEST_FILES_DIR/ooxml-strict/tmp/*.pptx
+$ooinstall/program/soffice.bin -convert-to docx:"Office Open XML Text" -outdir $OUTDIR $TEST_FILES_DIR/ooxml-strict/tmp/*.docx >>$RUN_LOG 2>&1
+$ooinstall/program/soffice.bin -convert-to xlsx:"Calc Office Open XML" -outdir $OUTDIR $TEST_FILES_DIR/ooxml-strict/tmp/*.xslx >>$RUN_LOG 2>&1
+$ooinstall/program/soffice.bin -convert-to pptx:"Impress Office Open XML" -outdir $OUTDIR $TEST_FILES_DIR/ooxml-strict/tmp/*.pptx >>$RUN_LOG 2>&1
 
 # Validate the test files
 RESULT=0
+out_count=`ls -1 $OUTDIR | wc -l`
+validated=0
+show_progress "Validation" $validated
 for f in `ls $OUTDIR`; do
     validate $OUTDIR/$f
     if test $? != 0; then
         RESULT=1
     fi
+    let validated++
+    let rate=validated*100/out_count
+    show_progress "Validation" $rate
 done
 
 


More information about the Libreoffice-commits mailing list