common/tools/analysis/parse_yarp_files.pl
author Dario Sestito <darios@symbian.org>
Thu, 18 Jun 2009 16:04:46 +0100
changeset 174 66da43a8fbf8
parent 172 0b9c56a7a618
child 176 7912741ec3b3
permissions -rw-r--r--
Commented out print line


my @asYarpFiles = ();
open(FILE, $ARGV[0]);
while ( <FILE> )
{
	if ( m/[^,]*,([^,]*)/ )
	{
		my $sFile = $1;
		chomp $sFile;
#		print "$sFile\n";
		push(@asYarpFiles, $sFile);
	}
}
close(FILE);
my $nYarpFiles = scalar(@asYarpFiles);
#print "Found $nYarpFiles files to parse\n";

my $nTotalRecipeErrors = 0;
for my $nYarpFile (@asYarpFiles)
{
	my $nRecipeErrors = 0;
#	print "Parsing file $nYarpFile...\n";
	open(FILE, $nYarpFile);
	while ( <FILE> )
	{
		if ( m/Overall attempts:\s*(\d+),(\d+)/ )
		{
			#print "Attempt: $1 Errors: $2\n";
			$nRecipeErrors = $2;
		}
	}
	close(FILE);
#	print "Recipe errors in $nYarpFile: $nRecipeErrors\n";
	$nTotalRecipeErrors += $nRecipeErrors;
}
#print "Total recipe errors across all files: $nTotalRecipeErrors\n";

print "$nTotalRecipeErrors";