[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    mass  testing of kword parsing
From:       Jos van den Oever <Jos.van.den.Oever () kogmbh ! com>
Date:       2009-09-08 12:36:26
Message-ID: 200909081436.26558.Jos.van.den.Oever () kogmbh ! com
[Download RAW message or body]

Hi all,

To quickly identify files that crash KWord, I've written a script that runs 
KWord on all .doc and .odt files in a directory.

The script and the results for a run on the KOffice source directory are 
attached. The results.txt file prints the exit status after each input file.
Please use this script to identify problematic files.

Cheers,
Jos

-- 
Jos van den Oever, software architect
+49 391 25 19 15 53
http://kogmbh.com/legal/

["massKWordTester.pl" (application/x-perl)]

#! /usr/bin/perl -w
use strict;

# This script tests kword conversion of files to pdf.
# If looks for all odt and doc files in the current directory and calls
# kword to convert them to pdf.
# The GUI is diverted to a Xephyr instance.
# The exit code of each run is output to a file 'results.txt'
# Author: Jos van den Oever

my $timeout = 3; # seconds
my $DISPLAY = ":2";
my $outputfile = "results.txt";
my $documentDirectory = ".";

# start Xephyr
my $xephyrpid;
if (!($xephyrpid = fork)) {
    exec("Xephyr", $DISPLAY);
    exit;
}
$ENV{'DISPLAY'} = $DISPLAY;
$ENV{'KDE_DEBUG'} = "0";

# list all word processor files
my @files = `find $documentDirectory -iname '*.odt' -type f`;
push @files, `find $documentDirectory -iname '*.doc' -type f`;

my %result;
foreach (@files) {
    my $file = $_;
    chomp $file;
    my $pid = fork;
    eval {
        local $SIG{ALRM} = sub { die "alarm\n" };
        alarm $timeout;

        if (!$pid) {
            exec "kword", "--export-pdf", "--export-filename", "dummy.pdf",
                $file;
            exit;
        }
        waitpid $pid, 0;
        $result{$file} = $?;
        alarm 0;
    };
    if ($@ eq "alarm\n") {
        kill 9, $pid;
        $result{$file} = "timeout";
    }
}

open FH, "> $outputfile";
foreach (keys %result) {
    print FH $_."\t".$result{$_}."\n";
}
close FH;

# close Xephyr
kill 15, $xephyrpid;
waitpid $xephyrpid, 0;

["results.txt" (text/plain)]

./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/color.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabLeaderStyle.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabStopDistance.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableShadow.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/underlineType.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/letterKerning.odt	0
                
./kword/templates/Wordprocessing/ColorfulLetter.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontSize.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/border.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableMargins.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontName.odt	0
                
./crash_KoTextLoader.cpp:369.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/lineThroughWidth.odt	0
                
./krash.odt	11
./libs/main/tests/data/DocumentStructure/predefined.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontPitch.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/writingMode.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/relativeFontSize.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/TextFormatting/boldAndItalic.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/marginLeftRight.odt	0
                
./libs/main/tests/data/DocumentStructure/multipleDocumentContents.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontCharacterSet.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/textAlign.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableTopAndBottomMargin.odt	0
                
./libs/main/tests/data/DocumentStructure/rootAttributes.odt	0
./kchart/tests/documents/all-charts.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/mayBreakBetweenRows.odt	timeout
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/borderLineWidth.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontStyle.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/textTransformations.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableBackgroundAndBackgroundImage.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabLeaderType.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/marginTopBottom.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/embeddedBulletedList.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/textOutline.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/lineThroughText.odt	0
                
./kword/templates/Wordprocessing/FaxA4.odt	11
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/underlineColor.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabPosition.odt	0
                
./libs/kotext/opendocument/tests/data/ParagraphElements/bookmark.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableLeftAndRightMargin.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/dropCapsLength.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontVariant.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabLeaderText.odt	0
                
./libs/main/tests/data/DocumentStructure/userDefined.odt	0
./crash.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/underlineMode.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/automaticTextIndent.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/textBackgroundColor.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabDelimiterChar.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/lineThroughStyle.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/continueNumbering.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/pageNumber.odt	0
                
./krash2.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableWidth.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/listHeader.odt	0
./libs/kotext/opendocument/tests/data/TextContents/Paragraph/whitespace.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/dropCapsDistance.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/breakBeforeAndBreakAfter.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/paragraphBackgroundColor.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/tableAlignment.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/multilevelList.odt	0
./COPYING.DOC	timeout
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/lineThroughMode.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/dropCapsLines.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontFamilyGeneric.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabType.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/underlineStyle.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/numberedList.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/borderModelProperty.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Paragraph/nestedSpan.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontWeight.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/bulletedList.odt	0
./libs/kotext/opendocument/tests/data/TextContents/TextFormatting/fontSize.odt	0
./kword/templates/Wordprocessing/FaxLetter.odt	11
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/textIndent.odt	0
                
./kword/templates/Wordprocessing/ColorfulA4.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabLeaderColor.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/TextFormatting/fontColors.odt	0
./kword/templates/Wordprocessing/ProfessionalA4.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/tabLeaderWidth.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/underlineWidth.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Paragraph/basicContents.odt	0
./libs/kotext/opendocument/tests/data/ParagraphElements/note.odt	0
./libs/main/tests/data/DocumentStructure/singleDocumentContents.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/margin.odt	0
                
./kword/templates/Wordprocessing/ProfessionalLetter.odt	0
./crash_KoTextLoader.cpp:313.odt	0
./libs/kotext/opendocument/tests/data/TextContents/Lists/startValue.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/language.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Paragraph/attributedText.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/lineThroughType.odt	0
                
./doc/CookBook.odt	14
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/fontFamily.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/ParagraphFormattingProperties/lineSpacing.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/lineThroughColor.odt	0
                
./libs/kotext/opendocument/tests/data/FormattingProperties/TextFormattingProperties/country.odt	0
                
./kword/templates/Wordprocessing/A4.odt	0
./libs/kotext/opendocument/tests/data/TextContents/Lists/multipleParagraphs.odt	0
./libs/kotext/opendocument/tests/data/FormattingProperties/TableFormattingProperties/display.odt	0
                
./libs/kotext/opendocument/tests/data/TextContents/Lists/numberedParagraph.odt	0



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic