common/tools/raptor/RaptorCommon.pm
author Dario Sestito <darios@symbian.org>
Tue, 18 Aug 2009 15:32:29 +0100
changeset 364 4dc3b5b1577c
parent 281 7297abc8565b
child 374 52675b624b66
permissions -rw-r--r--
Enable analysis of Raptor warnings. Publish to Diamonds
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
227
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 $CATEGORY_GENERAL = 'general';
229
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    18
227
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    19
our $CATEGORY_RAPTORERROR = 'raptor_error';
229
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    20
our $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION = 'cannot_process_schema_version';
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    21
our $CATEGORY_RAPTORERROR_NOBLDINFFOUND = 'no_bld_inf_found';
269
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 266
diff changeset
    22
our $CATEGORY_RAPTORERROR_CANTFINDMMPFILE = 'cant_find_mmp_file';
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 266
diff changeset
    23
our $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS = 'make_exited_with_errors';
281
7297abc8565b Add new raptor error category to raptor parser (tool_didnt_return_version)
Dario Sestito <darios@symbian.org>
parents: 269
diff changeset
    24
our $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION = 'tool_didnot_return_version';
227
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    25
364
4dc3b5b1577c Enable analysis of Raptor warnings. Publish to Diamonds
Dario Sestito <darios@symbian.org>
parents: 281
diff changeset
    26
our $CATEGORY_RAPTORWARNING = 'raptor_warning';
4dc3b5b1577c Enable analysis of Raptor warnings. Publish to Diamonds
Dario Sestito <darios@symbian.org>
parents: 281
diff changeset
    27
our $CATEGORY_RAPTORWARNING_MISSINGFLAGABIV2 = 'missing_enable_abiv2_mode';
4dc3b5b1577c Enable analysis of Raptor warnings. Publish to Diamonds
Dario Sestito <darios@symbian.org>
parents: 281
diff changeset
    28
227
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    29
our $SEVERITY_UNKNOWN = 'unknown';
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    30
our $SEVERITY_CRITICAL = 'critical';
269
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 266
diff changeset
    31
our $SEVERITY_MAJOR = 'major';
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 266
diff changeset
    32
our $SEVERITY_NORMAL = 'normal';
61f2add750f0 Added 3 raptor error categories, adjusted severity of all categories
Dario Sestito <darios@symbian.org>
parents: 266
diff changeset
    33
our $SEVERITY_MINOR = 'minor';
227
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    34
266
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    35
sub init
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    36
{
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    37
	my $filename = "$::basedir/summary.csv";
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    38
	if (!-f$filename)
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    39
	{
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    40
		print "Writing summary file $filename\n";
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    41
		open(SUMMARY, ">$filename");
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    42
		close(SUMMARY);
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    43
	}
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    44
}
f1baeb3f075f Generate error and summary file even if build reports no error
Dario Sestito <darios@symbian.org>
parents: 229
diff changeset
    45
229
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    46
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: 227
diff changeset
    47
{
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    48
	my ($category, $subcategory, $severity, $component, $phase, $recipe, $file, $line) = @_;
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    49
	
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    50
	open(SUMMARY, ">>$::basedir/summary.csv");
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    51
	print SUMMARY "$category,$subcategory,$severity,$component,$phase,$recipe,$file,$line\n";
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    52
	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: 227
diff changeset
    53
}
9544c55a7fd0 Raptor parser to provide summary csv file so that faults can be readily put into db
Dario Sestito <darios@symbian.org>
parents: 227
diff changeset
    54
227
51e429810aba Modularized Raptor parser scripts
Dario Sestito <darios@symbian.org>
parents:
diff changeset
    55
1;