summaryrefslogtreecommitdiff
path: root/regenerate_raw.pl
blob: 96f822b76e14776464a3a82c2a23557fd1d4d7ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl

$html = 1;

sub GenRaw {

    $ABWVL = 'abw';

    @abwVersionList = split( /\s+/, $ABWVL );

    foreach $abwVersion (@abwVersionList) {

        # remove all diff files, since they are possible outdated now
        $diffs = 'testset/' . $abwVersion . '/*.diff';
        `rm -f $diffs`;

        $regrInput = 'testset/' . $abwVersion . '/regression.in';
        $FL        = `cat $regrInput`;

        @fileList = split( /\n/, $FL );
        foreach $file (@fileList) {
            if ( $file =~ /^#/ ) {
                next;
            }
            $filePath = 'testset/' . $abwVersion . '/' . $file;
            `abw2raw $filePath >$filePath.raw 2>$filePath.raw`;
            `abw2odt --stdout $filePath > $filePath.fodt`;
            `xmllint --c14n $filePath.fodt > $filePath.fodt.tmp`;
            `xmllint --format $filePath.fodt.tmp > $filePath.fodt`;
            `rm $filePath.fodt.tmp`;
        }
    }
}

# Main function
&GenRaw;

1;