common/tools/raptor/RaptorError.pm
author Simon Howkins <simonh@symbian.org>
Tue, 26 Jan 2010 12:13:01 +0000
changeset 858 f9fc2a3f8f70
parent 764 d00048f1b036
permissions -rw-r--r--
Code to automatically find a physical drive for running a build, triggered as necessary.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     6
#
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
     9
#
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    10
# Contributors:
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    11
#
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    12
# Description:
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    13
# Raptor parser module.
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
# Extract, analyzes and dumps raptor errors i.e. content of <error> tags from a raptor log file
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
package RaptorError;
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    18
use strict;
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
use RaptorCommon;
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    21
our $reset_status = {};
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    22
my $buildlog_status = {};
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    23
my $buildlog_error_status = {};
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    24
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
$reset_status->{name} = 'reset_status';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    26
$reset_status->{next_status} = {buildlog=>$buildlog_status};
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    27
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    28
$buildlog_status->{name} = 'buildlog_status';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
$buildlog_status->{next_status} = {error=>$buildlog_error_status};
324
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    30
$buildlog_status->{on_start} = 'RaptorError::on_start_buildlog';
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    31
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    32
$buildlog_error_status->{name} = 'buildlog_error_status';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    33
$buildlog_error_status->{next_status} = {};
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
$buildlog_error_status->{on_start} = 'RaptorError::on_start_buildlog_error';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    35
$buildlog_error_status->{on_end} = 'RaptorError::on_end_buildlog_error';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    36
$buildlog_error_status->{on_chars} = 'RaptorError::on_chars_buildlog_error';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    37
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    38
my $filename = '';
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    39
my $failure_item = 0;
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    40
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    41
my $characters = '';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    42
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    43
my $CATEGORY_RAPTORERROR = 'raptor_error';
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    44
my $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION = 'cannot_process_schema_version';
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    45
my $CATEGORY_RAPTORERROR_NOBLDINFFOUND = 'no_bld_inf_found';
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    46
my $CATEGORY_RAPTORERROR_CANTFINDMMPFILE = 'cant_find_mmp_file';
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    47
my $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS = 'make_exited_with_errors';
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    48
my $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION = 'tool_didnot_return_version';
714
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    49
my $CATEGORY_RAPTORERROR_UNKNOWNBUILDCONFIG = 'unknown_build_config';
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    50
my $CATEGORY_RAPTORERROR_NOBUILDCONFIGSGIVEN = 'no_build_configs_given';
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    51
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    52
sub process
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    53
{
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    54
	my ($text, $logfile, $component, $mmp, $phase, $recipe, $file, $line) = @_;
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    55
	
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    56
	my $category = $CATEGORY_RAPTORERROR;
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    57
	my $severity = '';
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    58
	my $subcategory = '';
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    59
	
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    60
	if ($text =~ m,Cannot process schema version .* of file,)
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    61
	{
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    62
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    63
		$subcategory = $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    64
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    65
	}
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    66
	elsif ($text =~ m,No bld\.inf found at,)
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    67
	{
327
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    68
		$severity = $RaptorCommon::SEVERITY_MAJOR;
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    69
		$subcategory = $CATEGORY_RAPTORERROR_NOBLDINFFOUND;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    70
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
327
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    71
	}
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    72
	elsif ($text =~ m,Can't find mmp file,)
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    73
	{
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    74
		$severity = $RaptorCommon::SEVERITY_MINOR;
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    75
		$subcategory = $CATEGORY_RAPTORERROR_CANTFINDMMPFILE;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    76
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
327
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    77
	}
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    78
	elsif ($text =~ m,The make-engine exited with errors,)
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    79
	{
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    80
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    81
		$subcategory = $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    82
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
    83
	}
339
7297abc8565b Add new raptor error category to raptor parser (tool_didnt_return_version)
Dario Sestito <darios@symbian.org>
parents: 327
diff changeset
    84
	elsif ($text =~ m,tool .* from config .* did not return version .* as required,)
7297abc8565b Add new raptor error category to raptor parser (tool_didnt_return_version)
Dario Sestito <darios@symbian.org>
parents: 327
diff changeset
    85
	{
7297abc8565b Add new raptor error category to raptor parser (tool_didnt_return_version)
Dario Sestito <darios@symbian.org>
parents: 327
diff changeset
    86
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
    87
		$subcategory = $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    88
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
339
7297abc8565b Add new raptor error category to raptor parser (tool_didnt_return_version)
Dario Sestito <darios@symbian.org>
parents: 327
diff changeset
    89
	}
714
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    90
	elsif ($text =~ m,Unknown build configuration '.*',)
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    91
	{
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    92
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    93
		$subcategory = $CATEGORY_RAPTORERROR_UNKNOWNBUILDCONFIG;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
    94
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
714
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    95
	}
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    96
	elsif ($text =~ m,No build configurations given,)
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    97
	{
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    98
		$severity = $RaptorCommon::SEVERITY_CRITICAL;
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    99
		$subcategory = $CATEGORY_RAPTORERROR_NOBUILDCONFIGSGIVEN;
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
   100
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
714
5a7140020d52 Add raptor error categories unknown_build_config and no_build_configs_given
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
   101
	}
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
   102
	else # log everything by default
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
   103
	{
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
   104
		RaptorCommon::dump_fault($category, $subcategory, $severity, $logfile, $component, $mmp, $phase, $recipe, $file, $line);
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   105
	}
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   106
}
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   107
324
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   108
sub on_start_buildlog
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   109
{
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   110
	RaptorCommon::init();
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   111
	
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
   112
	$filename = "$::raptorbitsdir/raptor_error.txt";
324
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   113
	if (!-f$filename)
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   114
	{
364
4dc3b5b1577c Enable analysis of Raptor warnings. Publish to Diamonds
Dario Sestito <darios@symbian.org>
parents: 339
diff changeset
   115
		print "Writing errors file $filename\n";
324
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   116
		open(FILE, ">$filename");
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   117
		close(FILE);
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   118
	}
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   119
}
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
   120
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   121
sub on_start_buildlog_error
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   122
{
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   123
}
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   124
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   125
sub on_chars_buildlog_error
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   126
{
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   127
	my ($ch) = @_;
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   128
	
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   129
	#print "on_chars_buildlog_error\n";
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   130
	
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   131
	$characters .= $ch->{Data};
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   132
	
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   133
	#print "characters is now -->$characters<--\n";
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   134
}
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   135
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   136
sub on_end_buildlog_error
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   137
{
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   138
	#print "on_end_buildlog_error\n";
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   139
	
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   140
	$characters =~ s,^[\r\n]*,,;
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   141
	$characters =~ s,[\r\n]*$,,;
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
   142
	
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   143
	if ($characters =~ m,[^\s^\r^\n],)
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   144
	{	
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   145
		if ($failure_item == 0 and -f "$filename")
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   146
		{
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   147
			open(FILE, "$filename");
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   148
			{
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   149
				local $/ = undef;
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   150
				my $filecontent = <FILE>;
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   151
				$failure_item = $1 if ($filecontent =~ m/.*---failure_item_(\d+)/s);
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   152
			}
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   153
			close(FILE);
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   154
		}
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   155
		
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   156
		$failure_item++;
244
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 242
diff changeset
   157
	
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   158
		open(FILE, ">>$filename");
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   159
		print FILE "---failure_item_$failure_item\---\n";
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   160
		print FILE "$characters\n\n";
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   161
		close(FILE);
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   162
		
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 714
diff changeset
   163
		process($characters, $::current_log_file, '', '', '', '', "raptor_error.txt", $failure_item);
383
52675b624b66 Add raptor build html summary computation
Dario Sestito <darios@symbian.org>
parents: 364
diff changeset
   164
	}
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   165
	
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   166
	$characters = '';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   167
}
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   168
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   169
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
   170
1;