common/tools/ats/update_brag_status.pl
author Dario Sestito <darios@symbian.org>
Thu, 30 Sep 2010 12:35:20 +0100
changeset 1272 c4b5a5c928c2
parent 1118 abbcac685ab1
child 1286 7ad2f93c7666
permissions -rw-r--r--
Add hudson console log to BIT reports
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
#!/usr/bin/perl
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
#
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
#	Maciej Seroka, maciejs@symbian.org
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
#
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
# Description:
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
#   This is a tool for updating BRAG status with test results.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
use strict;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
use Getopt::Long;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
use XML::Simple;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
use Tie::File;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
my $brag_file;
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    22
my $ats3_report;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    23
my $ats4_report;
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
my $test_report;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
my $help;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
my $line;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
my $auto_tests_total;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
my $auto_tests_passed;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
my $auto_tests_failed;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
my $auto_tests_notrun;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
my $man_tests_total;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
my $man_tests_passed;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
my $man_tests_failed;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
my $man_tests_notrun;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
my $temp_path;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
my $detailshref;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
my $xml_report;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
my $test_case;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
my $test_brag_xml;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
my $existing_results;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
my $n;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
my $m;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
my @lines;
1118
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
    44
my $man_detailshref;
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
sub usage($);
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
sub help();
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
sub usage_error();
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
my %optmap = (  'brag-file' => \$brag_file,
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    51
			    'ats3-report' => \$ats3_report,
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    52
				'ats4-report' => \$ats4_report,
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
			    'test-report' => \$test_report,
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
				'help' => \$help);
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
GetOptions(\%optmap,
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
          'brag-file=s',
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    58
          'ats3-report=s',
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    59
          'ats4-report=s',
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
          'test-report=s',
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
		  'help!') 
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
          or usage_error();
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
if ($help) {
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
	help();
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
# --brag-file is mandatory.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
usage_error(), unless (defined($brag_file));
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    71
# --ats3-report/ats4-report is mandatory.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    72
usage_error(), unless ((defined($ats3_report)) || (defined($ats4_report)));
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    74
if (defined($ats3_report)) { # Get ATS3 Smoketest results.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    75
	open (FILE, "<$ats3_report") or die ("Couldn't open $ats3_report for reading: $!\n");
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    76
	my $read_flag = -1;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    77
	print "Reading $ats3_report... ";
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    78
	while ($line = <FILE>) {
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    79
		chomp $line;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    80
		if ($read_flag >= 0) { $read_flag++ }
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    81
		if ($read_flag == 1) { # Get Total number of tests.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    82
			$auto_tests_total = $line;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    83
			# Remove td tags.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    84
			$auto_tests_total =~ s/^.*\">//;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    85
			$auto_tests_total =~ s/<.*//;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    86
		}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    87
		if ($read_flag == 4) { # Get number of Passed tests.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    88
			($auto_tests_passed) = split /\//,$line;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    89
			$auto_tests_passed =~ s/^.*\">//; # Remove opening td tag.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    90
		}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    91
		if ($read_flag == 5) { # Get number of Failed tests.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    92
			($auto_tests_failed) = split /\//,$line;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    93
			$auto_tests_failed =~ s/^.*\">//; # Remove opening td tag.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    94
		}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    95
		if ($read_flag == 7) { # Get number of Not run tests.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    96
			($auto_tests_notrun) = split /\//,$line;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    97
			$auto_tests_notrun =~ s/^.*\">//; # Remove opening td tag.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    98
		}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
    99
		if ($line eq "<td class=\"tableData\">Nested tests<\/td>") { # Set flag for reading results.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   100
			$read_flag = 0;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   101
		}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   102
		if (($line eq "<\/tr>") && ($read_flag >= 0)) { # Exit loop.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   103
			last;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   104
		};
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	}
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   106
	close FILE;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   107
}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   108
if (defined($ats4_report)) { # Get ATS4 Smoketest results.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   109
	$auto_tests_total = 0;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   110
	$auto_tests_passed = 0;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   111
	$auto_tests_failed = 0;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   112
	$auto_tests_notrun = 0;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   113
	open (FILE, "<$ats4_report") or die ("Couldn't open $ats4_report for reading: $!\n");
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   114
	my $read_flag = -1;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   115
	print "Reading $ats4_report... ";
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   116
	while ($line = <FILE>) {
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   117
		chomp $line;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   118
		if ($read_flag >= 0) { $read_flag++ }
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   119
		if ($read_flag == 3) { # Get status.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   120
			$auto_tests_total++;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   121
			if ($line =~ "PASSED") { $auto_tests_passed++ }
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   122
			if ($line =~ "FAILED") { $auto_tests_failed++ }
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   123
			if (($line =~ "SKIPPED") || ($line =~ "NOT_AVAILABLE")) { $auto_tests_notrun++ }
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   124
			# Re-set flag.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   125
			$read_flag = -1;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   126
		}
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   127
		if ($line eq "<result type=\"TestCaseResult\">") { # Set flag for reading results.
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   128
			$read_flag = 0;
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   129
		}
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
	}
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   131
	close FILE;
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
print "complete\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
print "Total number of tests: $auto_tests_total\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
print "Passed tests: $auto_tests_passed\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
print "Failed tests: $auto_tests_failed\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
print "Not run tests: $auto_tests_notrun\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
# Define detailshref attribute.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
$temp_path = $brag_file;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
$temp_path =~ s/\\/\//g; # Replace \ with /
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
$temp_path =~ s/\/summary\/.*//;
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   143
if (defined($ats3_report)) { $detailshref = $ats3_report };
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   144
if (defined($ats4_report)) { $detailshref = $ats4_report };
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
$detailshref =~ s/\\/\//g; # Replace \ with /
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
$detailshref =~ s/($temp_path)/../;
1118
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   147
if (defined($test_report)) {
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   148
	$man_detailshref = $test_report;
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   149
	$man_detailshref =~ s/\\/\//g; # Replace \ with /
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   150
	$man_detailshref =~ s/($temp_path)/../;
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   151
}
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
if (defined($test_report)) { # Get manual Smoketest results.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
	print "Parsing " . $test_report . "... ";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	$xml_report = XMLin("$test_report", keeproot => 1, forcearray => [ 'test-set', 'test-case' ], keyattr => [] );
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
	print "complete \n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
	$man_tests_total = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
	$man_tests_passed = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
	$man_tests_failed = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
	$man_tests_notrun = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
	foreach $test_case (@{$xml_report->{'test-report'}->{'test-set'}->[0]->{'test-case'}}) {
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
		if (lc($test_case->{'result'}) eq "passed") { $man_tests_passed++ }
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
		if (lc($test_case->{'result'}) eq "failed") { $man_tests_failed++ }
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
		if (lc($test_case->{'result'}) eq "not run") { $man_tests_notrun++ }
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
		$man_tests_total++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
	}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
	print "Total number of tests: $man_tests_total\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
	print "Passed tests: $man_tests_passed\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
	print "Failed tests: $man_tests_failed\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
	print "Not run tests: $man_tests_notrun\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
# Check for Smoketest results in BRAG file.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
open (FILE, "<$brag_file") or die ("Couldn't open $brag_file for reading: $!\n");
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
$existing_results = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
$n = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
while ($line = <FILE>)
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
{
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
	chomp $line;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
	if ($line =~ "<phase name=\"Test\">") {
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
		$existing_results = 1;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
		last;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
	}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
	$n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
close FILE;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
tie @lines, 'Tie::File', $brag_file or die ("Couldn't tie file $brag_file: $!\n");
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
if ($existing_results) { # Delete existing Test Results from BRAG file.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
	$m = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
	do {
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
		$m++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
	} while (@lines[$n+$m] !~ "<\/phase>");
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
	splice @lines, $n, $m+1;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
# Insert (New) Test Results to BRAG file.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
$n = 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
foreach ( @lines )
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
{
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
	if (lc(@lines[$n]) =~ "<\/buildstatus>") {
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
		last;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
	}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
	$n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
splice @lines, $n, 0, "<phase name=\"Test\">"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
splice @lines, $n, 0, "<step detailshref=\"$detailshref\" name=\"Smoketest - automated tests\">"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
splice @lines, $n, 0, "<nestedtests count=\"$auto_tests_total\" property=\"total\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
splice @lines, $n, 0, "<nestedtests count=\"$auto_tests_passed\" property=\"passed\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
splice @lines, $n, 0, "<nestedtests count=\"$auto_tests_failed\" property=\"failed\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
splice @lines, $n, 0, "<nestedtests count=\"$auto_tests_notrun\" property=\"not run\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
splice @lines, $n, 0, "<\/step>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
if (defined($test_report)) {
1118
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   214
	splice @lines, $n, 0, "<step detailshref=\"$man_detailshref\" name=\"Smoketest - manual tests\">"; $n++;
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
	splice @lines, $n, 0, "<nestedtests count=\"$man_tests_total\" property=\"total\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
	splice @lines, $n, 0, "<nestedtests count=\"$man_tests_passed\" property=\"passed\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
	splice @lines, $n, 0, "<nestedtests count=\"$man_tests_failed\" property=\"failed\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
	splice @lines, $n, 0, "<nestedtests count=\"$man_tests_notrun\" property=\"not run\"/>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
	splice @lines, $n, 0, "<\/step>"; $n++;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
splice @lines, $n, 0, "<\/phase>";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
untie @lines;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
print "$brag_file updated\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
# Create Test_BRAG.xml
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
$test_brag_xml = $temp_path . "\/summary\/" . "Test_BRAG.xml";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
if (-e $test_brag_xml) { # Delete the file if exists.
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
	unlink($test_brag_xml);
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
	print "$test_brag_xml deleted\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
open (FILE, "> $test_brag_xml") or die ("Couldn't open $test_brag_xml for writing: $!\n");
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
print FILE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
print FILE "<?xml-stylesheet type='text/xsl' href='brag.xsl'?>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
print FILE "<buildStatus>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
print FILE "<phase name=\"Test\">\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
print FILE "<step detailshref=\"$detailshref\" name=\"Smoketest - automated tests\">\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
print FILE "<nestedtests count=\"$auto_tests_total\" property=\"total\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
print FILE "<nestedtests count=\"$auto_tests_passed\" property=\"passed\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
print FILE "<nestedtests count=\"$auto_tests_failed\" property=\"failed\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
print FILE "<nestedtests count=\"$auto_tests_notrun\" property=\"not run\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
print FILE "<\/step>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
if (defined($test_report)) {
1118
abbcac685ab1 Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents: 1090
diff changeset
   244
	print FILE "<step detailshref=\"$man_detailshref\" name=\"Smoketest - manual tests\">\n";
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
	print FILE "<nestedtests count=\"$man_tests_total\" property=\"total\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
	print FILE "<nestedtests count=\"$man_tests_passed\" property=\"passed\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
	print FILE "<nestedtests count=\"$man_tests_failed\" property=\"failed\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
	print FILE "<nestedtests count=\"$man_tests_notrun\" property=\"not run\"/>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
	print FILE "<\/step>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
print FILE "<\/phase>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
print FILE "</buildStatus>\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
close FILE;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
print "$test_brag_xml saved\n";
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
exit 0;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
sub usage($)
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
{
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
    my $error = shift;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
    my $fh = $error == 0 ? *STDOUT : *STDERR;
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
    print $fh "update_brag_status.pl\n" .
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
            "Specify the BRAG xml file and ATS report\n" .
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
            "synopsis:\n" .
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
            "  update_brag_status.pl --help\n" .
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   266
            "  update_brag_status.pl [--brag-file=XML_FILE] [--ats3-report=HTML_REPORT] [--ats4-report=SIMPLELOGGER_REPORT] [--test-report=XML_REPORT] \n" .
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
            "options:\n" .
1090
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   268
            "  --help                            Display this help and exit.\n" .
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   269
            "  --brag-file=XML_FILE              XML_FILE is the full path to the file containing BRAG summary.\n" .
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   270
            "  --ats3-report=HTML_REPORT         HTML_REPORT is the full path to the ATS3 report.\n" .
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   271
            "  --ats4-report=SIMPLELOGGER_REPORT SIMPLELOGGER_REPORT is the full path to the ATS4 report.\n" .
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   272
            "  --test-report=XML_REPORT          XML_REPORT is the name of the test report for manually executed tests.\n" .
46b3578a07ad Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents: 1040
diff changeset
   273
			"                                    If not specified only automated tests results will be taken into account.\n";
1040
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
    exit $error;            
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
sub help()
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
{
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
    usage(0);
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
}
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
sub usage_error()
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
{
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
    usage(1);
f1f85b34a96f Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
}