2
# Diff two subunit streams
3
# Copyright (C) Jelmer Vernooij <jelmer@samba.org>
5
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
6
# license at the users choice. A copy of both licenses are available in the
7
# project source as Apache-2.0 and BSD. You may not use this file except in
8
# compliance with one of these two licences.
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
12
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
# license you chose for the specific language governing permissions and
14
# limitations under that license.
16
package Subunit::Diff;
20
use Subunit qw(parse_results);
23
sub report_time($$) { }
27
my ($self, $msg) = @_;
29
# No output for now, perhaps later diff this as well ?
34
my ($self, $testname) = @_;
39
my ($self, $testname, $result, $unexpected, $reason) = @_;
41
$self->{$testname} = $result;
56
TESTS_UNEXPECTED_OK => 0,
57
TESTS_EXPECTED_OK => 0,
58
TESTS_UNEXPECTED_FAIL => 0,
59
TESTS_EXPECTED_FAIL => 0,
64
my $ret = new Subunit::Diff();
65
open(IN, $path) or return;
66
parse_results($ret, $statistics, *IN);
76
foreach my $testname (keys %$old) {
77
if ($new->{$testname} ne $old->{$testname}) {
78
$ret->{$testname} = [$old->{$testname}, $new->{$testname}];