From 68578d6374236e0606b21f5168956c3a515b7b0c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 5 Jun 2009 16:10:12 +0200 Subject: selftest: Fix handling of testsuite, reintroduce progress indication. --- selftest/output/plain.pm | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'selftest/output') diff --git a/selftest/output/plain.pm b/selftest/output/plain.pm index 2427136073..bfdced2936 100644 --- a/selftest/output/plain.pm +++ b/selftest/output/plain.pm @@ -1,6 +1,6 @@ #!/usr/bin/perl # Plain text output for selftest -# Copyright (C) 2008 Jelmer Vernooij +# Copyright (C) 2008-2009 Jelmer Vernooij # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,6 +41,12 @@ sub new($$$$$$$) { bless($self, $class); } +sub testsuite_count($$) +{ + my ($self, $count) = @_; + $self->{totalsuites} = $count; +} + sub report_time($$) { my ($self, $time) = @_; @@ -101,23 +107,21 @@ sub control_msg($$) #$self->output_msg($output); } -sub end_testsuite($$$$$) +sub end_testsuite($$$$) { - my ($self, $name, $result, $unexpected, $reason) = @_; + my ($self, $name, $result, $reason) = @_; my $out = ""; + my $unexpected = 0; - if ($unexpected) { - if ($result eq "success" and not defined($reason)) { - $reason = "Expected negative exit code, got positive exit code"; - } + if ($result eq "success" or $result eq "xfail") { + $self->{suites_ok}++; + } else { $self->output_msg("ERROR: $reason\n"); push (@{$self->{suitesfailed}}, $name); - } else { - $self->{suites_ok}++; - } - - if ($unexpected and $self->{immediate} and not $self->{verbose}) { - $out .= $self->{test_output}->{$name}; + if ($self->{immediate} and not $self->{verbose}) { + $out .= $self->{test_output}->{$name}; + } + $unexpected = 1; } if (not $self->{immediate}) { -- cgit