common/tools/raptor/RaptorCommon.pm
author Shabe Razvi <shaber@symbian.org>
Mon, 08 Mar 2010 12:37:47 +0000
changeset 915 9bfe1b1c0a41
parent 764 d00048f1b036
permissions -rw-r--r--
Merge
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
# Common constants for the raptor parser suite
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    14
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    15
package RaptorCommon;
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    16
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    17
our $SEVERITY_CRITICAL = 'critical';
327
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    18
our $SEVERITY_MAJOR = 'major';
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 324
diff changeset
    19
our $SEVERITY_MINOR = 'minor';
242
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    20
324
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    21
sub init
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    22
{
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    23
	my $filename = "$::raptorbitsdir/summary.csv";
324
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    24
	if (!-f$filename)
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    25
	{
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    26
		print "Writing summary file $filename\n";
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    27
		open(SUMMARY, ">$filename");
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    28
		close(SUMMARY);
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    29
	}
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    30
}
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 244
diff changeset
    31
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
    32
sub dump_fault
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
    33
{
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    34
	my ($category, $subcategory, $severity, $location, $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
    35
	
764
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    36
	open(SUMMARY, ">>$::raptorbitsdir/summary.csv");
d00048f1b036 Improved Raptor parser, now "uh"
Dario Sestito <darios@symbian.org>
parents: 383
diff changeset
    37
	print SUMMARY "$category,$subcategory,$severity,$location,$component,$mmp,$phase,$recipe,$file,$line\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
    38
	close(SUMMARY);
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
    39
}
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
1;