update-javascriptcore-test-results 747 Bytes
Newer Older
ggaren's avatar
ggaren committed
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
#!/usr/bin/perl -w

use strict;
use FindBin;
use lib $FindBin::Bin;
use webkitdirs;

chdirWebKit();
chdir "JavaScriptCore/tests/mozilla/" or die;

open EXPECTED, "expected.html";
while (<EXPECTED>) {
    last if /failures reported\.$/;
}
my %expected;
while (<EXPECTED>) {
    chomp;
    $expected{$_} = 1;
}
close EXPECTED;

open ACTUAL, "actual.html";
my $actual;
while (<ACTUAL>) {
    $actual .= $_;
    last if /failures reported\.$/;
}
my $failed = 0;
while (<ACTUAL>) {
    $actual .= $_;
    chomp;
    if (!$expected{$_}) {
        $failed = 1;
        print "failure not expected: $_\n";
    }
}
close ACTUAL;

die "won't update, failures introduced" if $failed;

open EXPECTED, ">expected.html";
print EXPECTED $actual;
close EXPECTED;