-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregenerate_raw.pl
executable file
·52 lines (44 loc) · 1.45 KB
/
regenerate_raw.pl
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/perl
use settings;
sub GenRaw
{
my ($versionList, $tools, $odfExt) = @_;
foreach $version ( @$versionList )
{
# remove all diff files, since they are possible outdated now
$diffs = 'testset/' . $version . '/*.diff';
`rm -f $diffs`;
$regrInput = 'testset/' . $version . '/regression.in';
$FL = `cat $regrInput`;
@fileList = split(/\n/, $FL);
foreach $file ( @fileList )
{
$filePath = 'testset/' . $version . '/' . $file;
`$tools->{'raw'} $filePath >$filePath.raw 2>$filePath.raw`;
my $err = `$tools->{'odf'} --stdout $filePath 2>&1 > $filePath.$odfExt.tmp`;
if ($err)
{
if (open(my $h, '>', "$filePath.err"))
{
print $h $err;
close $h;
}
else
{
print $err;
}
}
`xmllint --format --noblanks $filePath.$odfExt.tmp > $filePath.$odfExt`;
`rm $filePath.$odfExt.tmp`;
if ($tools->{'svg'})
{
`$tools->{'svg'} $filePath >$filePath.xhtml.tmp 2>/dev/null`;
`xmllint --format --noblanks $filePath.xhtml.tmp > $filePath.xhtml`;
`rm $filePath.xhtml.tmp`;
}
}
}
}
GenRaw(\@settings::versionList, \%settings::tools, 'fodg');
1;
# vim: set ts=4 sw=4 et: