author | Shabe Razvi <shaber@symbian.org> |
Mon, 11 Oct 2010 12:07:02 +0100 | |
changeset 1289 | 5a13d0332890 |
parent 1286 | 7ad2f93c7666 |
permissions | -rw-r--r-- |
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; |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
27 |
my $auto_tests_total = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
28 |
my $auto_tests_passed = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
29 |
my $auto_tests_failed = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
30 |
my $auto_tests_skipped = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
31 |
my $auto_tests_noresult = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
32 |
my $auto_tests_notrun = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
33 |
my $auto_tests_disabled = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
34 |
my $man_tests_total = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
35 |
my $man_tests_passed = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
36 |
my $man_tests_failed = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
37 |
my $man_tests_notrun = 0; |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
38 |
my $temp_path; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
39 |
my $detailshref; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
40 |
my $xml_report; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
41 |
my $test_case; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
42 |
my $test_brag_xml; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
my $existing_results; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
44 |
my $n; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
my $m; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
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
|
47 |
my $man_detailshref; |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
48 |
my $build_id; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
49 |
my $name; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
50 |
my $type = "smoke"; # Currently hard-coded. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
51 |
my $start_time; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
52 |
my $end_time; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
53 |
my $time_stamp; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
54 |
my ($date, $time); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
55 |
my ($day, $month, $year); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
56 |
my $cases_total; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
57 |
my $cases_passed; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
58 |
my $cases_failed; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
59 |
my $cases_not_run; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
60 |
my $cases_not_available; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
61 |
my $fail_rate; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
62 |
my $auto_pass_rate; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
63 |
my $test_brag_status; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
64 |
my $test_target = "winscw"; # Currently hard-coded. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
65 |
my $report_url; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
66 |
my $bit_file = "bitinfo_smoketest.txt"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
67 |
my $bitops_path = "\.\.\\bitops.pl"; # Location of the bitops script (to update BIT db). |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
68 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
69 |
sub usage($); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
sub help(); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
sub usage_error(); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
73 |
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
|
74 |
'ats3-report' => \$ats3_report, |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
75 |
'ats4-report' => \$ats4_report, |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
76 |
'test-report' => \$test_report, |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
77 |
'build-id' => \$build_id, |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
'help' => \$help); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
79 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
80 |
GetOptions(\%optmap, |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
81 |
'brag-file=s', |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
82 |
'ats3-report=s', |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
83 |
'ats4-report=s', |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
84 |
'test-report=s', |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
85 |
'build-id=i', |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
86 |
'help!') |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
87 |
or usage_error(); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
89 |
if ($help) { |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
90 |
help(); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
91 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
92 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
93 |
# --brag-file is mandatory. |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
94 |
usage_error(), unless (defined($brag_file)); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
95 |
|
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
96 |
# --ats3-report/ats4-report is mandatory. |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
97 |
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
|
98 |
|
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
99 |
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
|
100 |
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
|
101 |
my $read_flag = -1; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
102 |
print "Reading $ats3_report... "; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
103 |
while ($line = <FILE>) { |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
104 |
chomp $line; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
105 |
if ($read_flag >= 0) { $read_flag++ } |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
106 |
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
|
107 |
$auto_tests_total = $line; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
108 |
# Remove td tags. |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
109 |
$auto_tests_total =~ s/^.*\">//; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
110 |
$auto_tests_total =~ s/<.*//; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
111 |
} |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
112 |
if ($read_flag == 3) { # Get number of Disabled tests. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
113 |
($auto_tests_disabled) = split /\//,$line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
114 |
$auto_tests_disabled =~ s/^.*\">//; # Remove opening td tag. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
115 |
} |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
116 |
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
|
117 |
($auto_tests_passed) = split /\//,$line; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
118 |
$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
|
119 |
} |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
120 |
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
|
121 |
($auto_tests_failed) = split /\//,$line; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
122 |
$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
|
123 |
} |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
124 |
if ($read_flag == 6) { # Get number of Skipped tests. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
125 |
($auto_tests_skipped) = split /\//,$line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
126 |
$auto_tests_skipped =~ s/^.*\">//; # Remove opening td tag. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
127 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
128 |
if ($read_flag == 7) { # Get number of No result tests. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
129 |
($auto_tests_noresult) = split /\//,$line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
130 |
$auto_tests_noresult =~ s/^.*\">//; # Remove opening td tag. |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
131 |
} |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
132 |
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
|
133 |
$read_flag = 0; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
134 |
} |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
135 |
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
|
136 |
last; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
137 |
}; |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
138 |
} |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
139 |
close FILE; |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
140 |
# Set number of No run tests. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
141 |
$auto_tests_notrun = $auto_tests_skipped + $auto_tests_noresult; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
142 |
|
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
143 |
# Get additional info |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
144 |
open (FILE, "<$ats3_report") or die ("Couldn't open $ats3_report for reading: $!\n"); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
145 |
while ($line = <FILE>) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
146 |
chomp $line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
147 |
if ($line =~ "<b>Test run:") { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
148 |
$name = $line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
149 |
$name =~ s/^.*<td>//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
150 |
$name =~ s/<\/td>.*//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
151 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
152 |
if ($line =~ "<b>Start time:") { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
153 |
$start_time = $line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
154 |
$start_time =~ s/^.*<td>//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
155 |
$start_time =~ s/<\/td>.*//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
156 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
157 |
if ($line =~ "<b>End time:") { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
158 |
$end_time = $line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
159 |
$end_time =~ s/^.*<td>//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
160 |
$end_time =~ s/<\/td>.*//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
161 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
162 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
163 |
close FILE; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
164 |
|
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
165 |
} |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
166 |
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
|
167 |
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
|
168 |
my $read_flag = -1; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
169 |
print "Reading $ats4_report... "; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
170 |
while ($line = <FILE>) { |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
171 |
chomp $line; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
172 |
if ($read_flag >= 0) { $read_flag++ } |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
173 |
if ($read_flag == 3) { # Get status. |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
174 |
$auto_tests_total++; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
175 |
if ($line =~ "PASSED") { $auto_tests_passed++ } |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
176 |
if ($line =~ "FAILED") { $auto_tests_failed++ } |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
177 |
if ($line =~ "SKIPPED") { $auto_tests_skipped++ } |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
178 |
if ($line =~ "NOT_AVAILABLE") { $auto_tests_notrun++ } |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
179 |
# Re-set flag. |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
180 |
$read_flag = -1; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
181 |
} |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
182 |
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
|
183 |
$read_flag = 0; |
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
184 |
} |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
185 |
} |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
186 |
close FILE; |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
187 |
|
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
188 |
# Get additional info |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
189 |
$name = "Smoketest"; # Name not available in ATS4 testreport. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
190 |
open (FILE, "<$ats4_report") or die ("Couldn't open $ats4_report for reading: $!\n"); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
191 |
$start_time = ""; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
192 |
while ($line = <FILE>) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
193 |
chomp $line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
194 |
if ($line =~ "timeStamp=\"") { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
195 |
$time_stamp = $line; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
196 |
$time_stamp =~ s/^.*timeStamp=\"//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
197 |
$time_stamp =~ s/\..*//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
198 |
($date,$time) = split /\s/,$time_stamp; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
199 |
($day, $month, $year) = split /-/,$date; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
200 |
$time_stamp = "$year-$month-$day $time"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
201 |
if ($start_time eq "") { $start_time = $time_stamp } |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
202 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
203 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
204 |
close FILE; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
205 |
$end_time = $time_stamp; # Last entry becomes end_time. |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
206 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
207 |
print "complete\n"; |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
208 |
#print "Total number of tests: $auto_tests_total\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
209 |
#print "Passed tests: $auto_tests_passed\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
210 |
#print "Failed tests: $auto_tests_failed\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
211 |
#print "Not run tests: $auto_tests_notrun\n"; |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
212 |
|
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
213 |
# Define detailshref attribute and report_url. |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
214 |
$temp_path = $brag_file; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
215 |
$temp_path =~ s/\\/\//g; # Replace \ with / |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
216 |
$temp_path =~ s/\/summary\/.*//; |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
217 |
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
|
218 |
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
|
219 |
$detailshref =~ s/\\/\//g; # Replace \ with / |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
220 |
$report_url = lc($detailshref); |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
221 |
$detailshref =~ s/($temp_path)/../; |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
222 |
#Replace "//v800020/publish" with "http://cdn.symbian.org" in report_url |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
223 |
$report_url =~ s/^.*\/publish\//http:\/\/cdn.symbian.org\//; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
224 |
|
1118
abbcac685ab1
Modified update_brag_status to automatically add link to manual Smoketest report
Maciej Seroka <maciejs@symbian.org>
parents:
1090
diff
changeset
|
225 |
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
|
226 |
$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
|
227 |
$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
|
228 |
$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
|
229 |
} |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
230 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
231 |
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
|
232 |
print "Parsing " . $test_report . "... "; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
233 |
$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
|
234 |
print "complete \n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
235 |
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
|
236 |
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
|
237 |
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
|
238 |
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
|
239 |
$man_tests_total++; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
240 |
} |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
241 |
# print "Total number of tests: $man_tests_total\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
242 |
# print "Passed tests: $man_tests_passed\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
243 |
# print "Failed tests: $man_tests_failed\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
244 |
# print "Not run tests: $man_tests_notrun\n"; |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
245 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
246 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
247 |
# 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
|
248 |
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
|
249 |
$existing_results = 0; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
250 |
$n = 0; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
251 |
while ($line = <FILE>) |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
252 |
{ |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
253 |
chomp $line; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
254 |
if ($line =~ "<phase name=\"Test\">") { |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
255 |
$existing_results = 1; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
256 |
last; |
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 |
$n++; |
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 |
close FILE; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
261 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
262 |
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
|
263 |
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
|
264 |
$m = 0; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
265 |
do { |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
266 |
$m++; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
267 |
} while (@lines[$n+$m] !~ "<\/phase>"); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
268 |
splice @lines, $n, $m+1; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
269 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
270 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
271 |
# 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
|
272 |
$n = 0; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
273 |
foreach ( @lines ) |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
274 |
{ |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
275 |
if (lc(@lines[$n]) =~ "<\/buildstatus>") { |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
276 |
last; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
277 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
278 |
$n++; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
279 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
280 |
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
|
281 |
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
|
282 |
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
|
283 |
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
|
284 |
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
|
285 |
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
|
286 |
splice @lines, $n, 0, "<\/step>"; $n++; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
287 |
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
|
288 |
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
|
289 |
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
|
290 |
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
|
291 |
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
|
292 |
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
|
293 |
splice @lines, $n, 0, "<\/step>"; $n++; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
294 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
295 |
splice @lines, $n, 0, "<\/phase>"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
296 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
297 |
untie @lines; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
298 |
print "$brag_file updated\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
299 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
300 |
# Create Test_BRAG.xml |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
301 |
$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
|
302 |
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
|
303 |
unlink($test_brag_xml); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
304 |
print "$test_brag_xml deleted\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
305 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
306 |
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
|
307 |
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
|
308 |
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
|
309 |
print FILE "<buildStatus>\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
310 |
print FILE "<phase name=\"Test\">\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
311 |
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
|
312 |
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
|
313 |
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
|
314 |
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
|
315 |
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
|
316 |
print FILE "<\/step>\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
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
|
322 |
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
|
323 |
print FILE "<\/step>\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
324 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
325 |
print FILE "<\/phase>\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
326 |
print FILE "</buildStatus>\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
327 |
close FILE; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
328 |
print "$test_brag_xml saved\n"; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
329 |
|
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
330 |
# Calculate Test BRAG Status (based on auto + manual) |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
331 |
$cases_total = $man_tests_total + $auto_tests_total; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
332 |
$cases_passed = $man_tests_passed + $auto_tests_passed; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
333 |
$cases_failed = $man_tests_failed + $auto_tests_failed; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
334 |
$cases_not_run = $man_tests_notrun + $auto_tests_notrun; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
335 |
$cases_not_available = $auto_tests_disabled; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
336 |
if ($auto_tests_total > 0) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
337 |
$auto_pass_rate = ($auto_tests_passed / $auto_tests_total) * 100; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
338 |
} else { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
339 |
$auto_pass_rate = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
340 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
341 |
if ($cases_total > 0) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
342 |
$fail_rate = ($cases_failed / $cases_total) * 100; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
343 |
} else { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
344 |
$fail_rate = 0; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
345 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
346 |
if ($cases_total == 0) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
347 |
$test_brag_status = "n/a"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
348 |
} elsif (($fail_rate > 0) && ($fail_rate <= 50)) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
349 |
$test_brag_status = "amber"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
350 |
} elsif ($fail_rate > 50) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
351 |
$test_brag_status = "red"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
352 |
} else { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
353 |
$test_brag_status = "green"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
354 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
355 |
$auto_pass_rate = sprintf("%.1f", $auto_pass_rate); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
356 |
# Generate bit file |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
357 |
if (-e $bit_file) { # Delete the file if exists. |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
358 |
unlink($bit_file); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
359 |
print "$bit_file deleted\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
360 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
361 |
open (FILE, "> $bit_file") or die ("Couldn't open $bit_file for writing: $!\n"); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
362 |
print FILE "test $name,$type,$test_target,$start_time,$end_time,$auto_tests_total,$auto_tests_passed,$auto_tests_failed,$auto_tests_notrun,$auto_tests_disabled,$auto_pass_rate\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
363 |
if ($test_brag_status ne "n/a") { print FILE "test_brag $test_brag_status\n"; } |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
364 |
print FILE "report Smoke Test Report,$report_url,report"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
365 |
close FILE; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
366 |
print "$bit_file saved\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
367 |
|
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
368 |
if (defined($build_id)) { |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
369 |
print "Updating BIT db... "; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
370 |
my @args = ("perl", $bitops_path, "-u", $build_id, "-a", "-f", $bit_file); |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
371 |
system(@args) == 0 or die "system @args failed: $?"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
372 |
print "complete\n"; |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
373 |
} |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
374 |
|
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
375 |
exit 0; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
376 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
377 |
sub usage($) |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
378 |
{ |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
379 |
my $error = shift; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
380 |
my $fh = $error == 0 ? *STDOUT : *STDERR; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
381 |
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
|
382 |
"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
|
383 |
"synopsis:\n" . |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
384 |
" update_brag_status.pl --help\n" . |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
385 |
" update_brag_status.pl [--brag-file=XML_FILE] [--ats3-report=HTML_REPORT] [--ats4-report=SIMPLELOGGER_REPORT] [--test-report=XML_REPORT] [--build-id=ID]\n" . |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
386 |
"options:\n" . |
1090
46b3578a07ad
Modified update_brag_status to handle ATS4 reports
Maciej Seroka <maciejs@symbian.org>
parents:
1040
diff
changeset
|
387 |
" --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
|
388 |
" --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
|
389 |
" --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
|
390 |
" --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
|
391 |
" --test-report=XML_REPORT XML_REPORT is the name of the test report for manually executed tests.\n" . |
1286
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
392 |
" If not specified only automated tests results will be taken into account.\n" . |
7ad2f93c7666
Added BIT db interface for Test Results
Maciej Seroka <maciejs@symbian.org>
parents:
1118
diff
changeset
|
393 |
" --build-id=ID ID is the id of the build which will be updated with the test results.\n"; |
1040
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
394 |
exit $error; |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
395 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
396 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
397 |
sub help() |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
398 |
{ |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
399 |
usage(0); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
400 |
} |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
401 |
|
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
402 |
sub usage_error() |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
403 |
{ |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
404 |
usage(1); |
f1f85b34a96f
Added script for updating BRAG status with test results
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
405 |
} |