httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestSmoke.pm
Date Thu, 11 Apr 2002 15:02:26 GMT
stas        02/04/11 08:02:26

  Modified:    perl-framework/Apache-Test/lib/Apache TestSmoke.pm
  Log:
  - improved the generated smoke report
  
  Revision  Changes    Path
  1.10      +45 -15    httpd-test/perl-framework/Apache-Test/lib/Apache/TestSmoke.pm
  
  Index: TestSmoke.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSmoke.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestSmoke.pm	6 Jan 2002 18:20:57 -0000	1.9
  +++ TestSmoke.pm	11 Apr 2002 15:02:26 -0000	1.10
  @@ -45,10 +45,12 @@
       my $self = bless {
           seen    => {}, # seen sequences and tried them md5 hash
           results => {}, # final reduced sequences md5 hash
  -        start_with_tests => [],
  +        smoking_completed         => 0,
  +        start_with_tests          => [],
           total_iterations          => 0,
           total_reduction_attempts  => 0,
           total_reduction_successes => 0,
  +        total_tests_run           => 0,
       }, ref($class)||$class;
   
       $self->getopts(\@argv);
  @@ -123,6 +125,7 @@
       while ($iter++ < $self->{run_iter}) {
           $self->run_iter($iter);
       }
  +    $self->{smoking_completed} = 1;
       $self->report_finish();
       exit;
   }
  @@ -282,6 +285,7 @@
   
       while (my $t = <$pipe>) {
           next unless $t =~ /^(\S+?)\.+(ok|FAILED)/;
  +        $self->{total_tests_run}++;
           push(@$ra_ok, $1), next if $2 eq 'ok';
   
           # failure
  @@ -293,7 +297,6 @@
       # fail, so we don't die/report it
       close $pipe; 
       $self->kill_proc();
  -
       return $bad;
   
   }
  @@ -319,9 +322,9 @@
   EOM
   
       $SIG{INT} = sub {
  -        print $fh "!!! The testing was user aborted\n";
           $self->report_finish;
  -        exit;};
  +        exit;
  +    };
   
   }
   
  @@ -344,29 +347,56 @@
       my $start_time = $self->{start_time};
       my $end_time   = scalar localtime;
       if (my $fh = delete $self->{fh}) {
  -        unless (keys %{ $self->{results} }) {
  -            print $fh "No failures found\n";
  -        }
  +        my $failures = scalar keys %{ $self->{results} };
  +
           my $sep = "-" x 74;
  -        my $unique_seqs = scalar keys %{ $self->{results} };
  -        my $attempts = $self->{total_reduction_attempts}+0.00001; # zero div
  -        my $successes = $self->{total_reduction_successes};
  -        my $reduction_stats = sprintf "%d/%d (%d%% success)",
  -            $attempts, $successes, $successes / $attempts * 100;
           my $cfg_as_string = $self->build_config_as_string;
  +        my $unique_seqs   = scalar keys %{ $self->{results} };
  +        my $attempts      = $self->{total_reduction_attempts};
  +        my $successes     = $self->{total_reduction_successes};
  +        my $completion    = $self->{smoking_completed} 
  +            ? "Completed"
  +            : "Not Completed (aborted by user)";
  +
  +        my $status = "Unknown";
  +        if ($self->{total_iterations} > 0) {
  +            if ($failures) {
  +                $status = "*** NOT OK ***";
  +            }
  +            else {
  +                $status = "+++ OK +++";
  +            }
  +        }
   
           print $fh <<EOM;
  -$sep
  -Totals:
  +
  +================================== Summary ===============================
  +Completion              : $completion
  +Status                  : $status
  +Tests run               : $self->{total_tests_run}
   Random iterations made  : $self->{total_iterations}
  +EOM
  +
  +        if ($attempts > 0 && $failures) {
  +            my $reduction_stats = sprintf "%d/%d (%d%% success)",
  +                $attempts, $successes, $successes / $attempts * 100;
  +
  +            print $fh <<EOM;
   Unique sequences found  : $unique_seqs
   Reduction tries/success : $reduction_stats
  +EOM
  +        }
  +
  +        print $fh <<EOM;
   $sep
   --- Started at: $start_time ---
   --- Ended   at: $end_time ---
   $sep
   The smoke testing was run on the system with the following parameters:
  +
   $cfg_as_string
  +
  +-- this report was generated by $0
   EOM
           close $fh;
       }
  @@ -397,7 +427,7 @@
   
       print <<EOM;
   usage: t/SMOKE [options ...] [tests]
  -    where options include:
  +    where the options are:
   EOM
   
       for (sort keys %usage){
  
  
  

Mime
View raw message