#!/usr/bin/perl -w
#parse tap test output
#write summary portion to file

use strict;
use warnings;

open (IF,"</data/ipp001.0/ippTests/tap/out") or die "Cannot open out file";
open (OF, ">/data/ipp001.0/ippTests/tap/summary") or die "Cannot open summary file";

my $flag = 0;

while (<IF>) {
  print $_;
  if (/Failed Test                      Stat Wstat Total Fail  List of Failed/) {
    $flag = 1;
  }
  if ($flag == 1) {
    print OF $_;
  }
}

close (IF);
close (OF);
