|
1 # Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # Script summarise and hotlink logfiles by reading |
|
15 # HTMLscanlog generated files |
|
16 # This initial version is phase 1 of 3. |
|
17 # 1. HTML scanlog input --> HTML report output |
|
18 # 2. HTML scanlog input --> XML report output + XSLT to HTML |
|
19 # 3. XML scanlog input --> XML report output + XSLT to HTML |
|
20 # |
|
21 # |
|
22 |
|
23 #!/usr/bin/perl -w |
|
24 package GenResult; |
|
25 use BragStatus; |
|
26 use GenAutoSmokeTestResult; |
|
27 use GenPostBuildResult; |
|
28 use strict; |
|
29 |
|
30 # global log file locations |
|
31 # - to be set by main() function |
|
32 # on module entry |
|
33 our $iGTLogFileLocation; |
|
34 our $iTVLogFileLocation; |
|
35 our $iTVEBSLogFileLocation; |
|
36 our $iBUILDLogFileLocation; |
|
37 our $iCBRLogFileLocation; |
|
38 our $iROMLogFileLocation; |
|
39 our $iCDBLogFileLocation; |
|
40 our $iLinkPathLocation; |
|
41 our $iLogsPublishLocation; |
|
42 our $iGTFileName; |
|
43 our $iTVFileName; |
|
44 our $iTVEBSFileName; |
|
45 our $iBUILDFileName; |
|
46 our $iCBRFileName; |
|
47 our $iROMFileName; |
|
48 our $iCDBFileName; |
|
49 our $iBraggflag = 0; |
|
50 |
|
51 our %iProducts; |
|
52 our %iTests; |
|
53 no strict qw($iGTLogFileLocation, |
|
54 $iTVLogFileLocation, |
|
55 $iTVEBSLogFileLocation; |
|
56 $iBUILDLogFileLocation, |
|
57 $iCBRLogFileLocation, |
|
58 $iROMLogFileLocation, |
|
59 $iCDBLogFileLocation, |
|
60 $iLinkPathLocation, |
|
61 $iLogsPublishLocation, |
|
62 $iGTFileName, |
|
63 $iTVFileName, |
|
64 $iTVEBSFileName; |
|
65 $iBUILDFileName, |
|
66 $iCBRFileName, |
|
67 $iROMFileName, |
|
68 $iCDBFileName); |
|
69 |
|
70 my $iGTFileFound = "1"; |
|
71 my $iTVFileFound = "1"; |
|
72 my $iTVEBSFileFound = "1"; |
|
73 my $iBUILDFileFound = "1"; |
|
74 my $iCBRFileFound = "1"; |
|
75 my $iROMFileFound = "1"; |
|
76 my $iCDBFileFound = "1"; |
|
77 |
|
78 |
|
79 |
|
80 # stores the list of stages |
|
81 my $iBuildStages = 'GT|TV|ROM|CBR|CDB|BUILD'; |
|
82 |
|
83 # outline style sheet internally |
|
84 my $gStyleSheet = " \n |
|
85 |
|
86 <style type=\"text/css\"> |
|
87 h1,h2,h3 |
|
88 { |
|
89 font-family: \"arial\", lucida calligraphy, 'sans serif'; |
|
90 } |
|
91 |
|
92 p,table,li, |
|
93 { |
|
94 font-family: \"arial\", lucida calligraphy, 'sans serif'; |
|
95 margin-left: 8pt; |
|
96 } |
|
97 |
|
98 body |
|
99 { |
|
100 background-color:#fffaf0; |
|
101 } |
|
102 |
|
103 p,li,th,td |
|
104 { |
|
105 font-size: 10pt; |
|
106 vertical-align:top; |
|
107 } |
|
108 |
|
109 h1,h2,h3,hr {color:#483d8b;} |
|
110 |
|
111 table {border-style:outset} |
|
112 li {list-style: square;} |
|
113 |
|
114 a.hoverlink:link {color: #0000ff; text-decoration: none} |
|
115 a.hoverlink:visited {color: #0000ff; text-decoration: none} |
|
116 a.hoverlink:hover {text-decoration: underline} |
|
117 </style>"; |
|
118 |
|
119 |
|
120 ########################################################################## |
|
121 # |
|
122 # Name : getGTResults() |
|
123 # Synopsis: To parse a logfile, and output results |
|
124 # into a common data format for processing |
|
125 # |
|
126 # Inputs : None |
|
127 # Outputs : Array of refs to arrays containing 5 scalars. The structure |
|
128 # is then used by the printResultRow() to display |
|
129 # |
|
130 # 1 <array 'container'> |
|
131 # | |
|
132 # 0-n <array ref> |
|
133 # | |
|
134 # -- <scalar[0]> component name |
|
135 # -- <scalar[1]> number of errors |
|
136 # -- <scalar[2]> link to errors |
|
137 # -- <scalar[3]> number of warnings |
|
138 # -- <scalar[4]> link to warnings |
|
139 # -- <scalar[5]> number of advisorynotes |
|
140 # -- <scalar[6]> link to advisorynotes |
|
141 # |
|
142 # Note: Links are currently not used, but instead constructed from the |
|
143 # component name and logfile location. Can be used in future for |
|
144 # logs located elsewhere etc. |
|
145 ########################################################################## |
|
146 sub getGTResults { |
|
147 |
|
148 |
|
149 my $iComponent; |
|
150 my $iErrors; |
|
151 my $iErrorLink; |
|
152 my $iWarnings; |
|
153 my $iWarningLink; |
|
154 my $iAdvisoryNotes; |
|
155 my $iAdvisoryNotesLink; |
|
156 my $iRemarks; |
|
157 my @components; |
|
158 |
|
159 open (GTLOGFILE, $iGTLogFileLocation) || setHandleErrors($_[0]); |
|
160 |
|
161 my @iGTLog = <GTLOGFILE>; |
|
162 |
|
163 foreach (@iGTLog) { |
|
164 |
|
165 if (m/(Component_)(.*)(\s[0-9]{0,2}:[0-9]{0,2}:[0-9]{0,2}\.?[0-9]{0,3})\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)/) { |
|
166 if (($4 != 0) || ($5 !=0) || ($6 != 0)) { |
|
167 |
|
168 $iComponent = $2; |
|
169 $iErrors = $4; |
|
170 $iWarnings = $5; |
|
171 $iAdvisoryNotes = $6; |
|
172 $iRemarks = $7; # currently we ignore remarks from components. |
|
173 |
|
174 # now extract the URL for each warning. At the moment, this is a relative link |
|
175 # MUST make it absolute, to avoid problems |
|
176 |
|
177 my @componentdetails = ($iComponent, $iErrors, $iErrorLink, $iWarnings, $iWarningLink, $iAdvisoryNotes, $iAdvisoryNotesLink); |
|
178 push @components, \@componentdetails; |
|
179 } |
|
180 |
|
181 |
|
182 } |
|
183 |
|
184 } |
|
185 # return array of refs to arrays |
|
186 return @components; |
|
187 } |
|
188 |
|
189 ########################################################################## |
|
190 # |
|
191 # Name : getTVResults() |
|
192 # Synopsis: To parse a logfile, and output results |
|
193 # into a common data format for processing |
|
194 # |
|
195 # Inputs : None |
|
196 # Outputs : Array of refs to arrays containing 5 scalars. The structure |
|
197 # is then used by the printResultRow() to display |
|
198 # |
|
199 # 1 <array 'container'> |
|
200 # | |
|
201 # 0-n <array ref> |
|
202 # | |
|
203 # -- <scalar[0]> component name |
|
204 # -- <scalar[1]> number of errors |
|
205 # -- <scalar[2]> link to errors |
|
206 # -- <scalar[3]> number of warnings |
|
207 # -- <scalar[4]> link to warnings |
|
208 # -- <scalar[5]> number of advisorynotes |
|
209 # -- <scalar[6]> link to advisorynotes |
|
210 # |
|
211 # Note: Links are currently not used, but instead constructed from the |
|
212 # component name and logfile location. Can be used in future for |
|
213 # logs located elsewhere etc. |
|
214 ########################################################################## |
|
215 sub getTVResults { |
|
216 |
|
217 my $iComponent; |
|
218 my $iErrors; |
|
219 my $iErrorLink; |
|
220 my $iWarnings; |
|
221 my $iWarningLink; |
|
222 my $iAdvisoryNotes; |
|
223 my $iAdvisoryNotesLink; |
|
224 my $iRemarks; |
|
225 |
|
226 my @components; |
|
227 open (TVLOGFILE, $iTVLogFileLocation) || setHandleErrors($_[0]); |
|
228 |
|
229 my @iTVLog = <TVLOGFILE>; |
|
230 |
|
231 foreach (@iTVLog) { |
|
232 |
|
233 if (m/(Component_)(.*)(\s[0-9]{0,2}:[0-9]{0,2}:[0-9]{0,2}\.?[0-9]{0,3})\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)/) { |
|
234 |
|
235 if (($4 != 0) || ($5 !=0) || ($6 != 0)) { |
|
236 |
|
237 $iComponent = $2; |
|
238 $iErrors = $4; |
|
239 $iWarnings = $5; |
|
240 $iAdvisoryNotes = $6; |
|
241 $iRemarks = $7; # currently we ignore remarks from components. |
|
242 |
|
243 # now extract the URL for each warning. At the moment, this is a relative link |
|
244 # MUST make it absolute, to avoid problems |
|
245 |
|
246 my @componentdetails = ($iComponent, $iErrors, $iErrorLink, $iWarnings, $iWarningLink, $iAdvisoryNotes, $iAdvisoryNotesLink); |
|
247 push @components, \@componentdetails; |
|
248 } |
|
249 } |
|
250 } |
|
251 |
|
252 open (TVEBSLOGFILE, $iTVEBSLogFileLocation) || setHandleErrors($_[0]); |
|
253 my @iTVEBSLog = <TVEBSLOGFILE>; |
|
254 foreach (@iTVEBSLog) { |
|
255 |
|
256 if (m/(Component_)(.*)(\s[0-9]{0,2}:[0-9]{0,2}:[0-9]{0,2}\.?[0-9]{0,3})\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)/) { |
|
257 |
|
258 if (($4 != 0) || ($5 !=0) || ($6 != 0)) { |
|
259 |
|
260 $iComponent = $2; |
|
261 $iErrors = $4; |
|
262 $iWarnings = $5; |
|
263 $iAdvisoryNotes = $6; |
|
264 $iRemarks = $7; # currently we ignore remarks from components. |
|
265 |
|
266 # now extract the URL for each warning. At the moment, this is a relative link |
|
267 # MUST make it absolute, to avoid problems |
|
268 |
|
269 my @componentdetails = ($iComponent, $iErrors, $iErrorLink, $iWarnings, $iWarningLink, $iAdvisoryNotes, $iAdvisoryNotesLink); |
|
270 push @components, \@componentdetails; |
|
271 } |
|
272 } |
|
273 } |
|
274 |
|
275 # return array of refs to arrays |
|
276 return @components; |
|
277 } |
|
278 |
|
279 |
|
280 ########################################################################## |
|
281 # |
|
282 # Name : getBUILDResults() |
|
283 # Synopsis: To parse a logfile, and output results |
|
284 # into a common data format for processing |
|
285 # |
|
286 # Inputs : None |
|
287 # Outputs : Array of refs to arrays containing 5 scalars. The structure |
|
288 # is then used by the printResultRow() to display |
|
289 # |
|
290 # 1 <array 'container'> |
|
291 # | |
|
292 # 0-n <array ref> |
|
293 # | |
|
294 # -- <scalar[0]> component name |
|
295 # -- <scalar[1]> number of errors |
|
296 # -- <scalar[2]> link to errors |
|
297 # -- <scalar[3]> number of warnings |
|
298 # -- <scalar[4]> link to warnings |
|
299 # -- <scalar[5]> number of advisorynotes |
|
300 # -- <scalar[6]> link to advisorynotes |
|
301 # |
|
302 # Note: Links are currently not used, but instead constructed from the |
|
303 # component name and logfile location. Can be used in future for |
|
304 # logs located elsewhere etc. |
|
305 ########################################################################## |
|
306 sub getBUILDResults { |
|
307 |
|
308 my $iComponent; |
|
309 my $iErrors; |
|
310 my $iErrorLink; |
|
311 my $iWarnings; |
|
312 my $iWarningLink; |
|
313 my $iAdvisoryNotes; |
|
314 my $iAdvisoryNotesLink; |
|
315 my $iRemarks; |
|
316 |
|
317 my @components; |
|
318 open (BUILDLOGFILE, $iBUILDLogFileLocation) ||setHandleErrors($_[0]); |
|
319 my @iBUILDLog = <BUILDLOGFILE>; |
|
320 |
|
321 foreach (@iBUILDLog) { |
|
322 |
|
323 if (m/(Component_)(.*)(\s[0-9]{0,2}:[0-9]{0,2}:[0-9]{0,2}\.?[0-9]{0,3}?)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)/) { |
|
324 |
|
325 if (($4 != 0) || ($5 !=0) || ($6 != 0)) { |
|
326 |
|
327 $iComponent = $2; |
|
328 $iErrors = $4; |
|
329 $iWarnings = $5; |
|
330 $iAdvisoryNotes = $6; |
|
331 $iRemarks = $7; # currently we ignore remarks from components. |
|
332 # now extract the URL for each warning. At the moment, this is a relative link |
|
333 # MUST make it absolute, to avoid problems |
|
334 |
|
335 my @componentdetails = ($iComponent, $iErrors, $iErrorLink, $iWarnings, $iWarningLink, $iAdvisoryNotes, $iAdvisoryNotesLink); |
|
336 push @components, \@componentdetails; |
|
337 } |
|
338 } |
|
339 } |
|
340 |
|
341 # return array of refs to arrays |
|
342 return @components; |
|
343 } |
|
344 |
|
345 ########################################################################## |
|
346 # |
|
347 # Name : getCBRResults() |
|
348 # Synopsis: To parse a logfile, and output results |
|
349 # into a common data format for processing |
|
350 # |
|
351 # Inputs : None |
|
352 # Outputs : Array of refs to arrays containing 5 scalars. The structure |
|
353 # is then used by the printResultRow() to display |
|
354 # |
|
355 # 1 <array 'container'> |
|
356 # | |
|
357 # 0-n <array ref> |
|
358 # | |
|
359 # -- <scalar[0]> component name |
|
360 # -- <scalar[1]> number of errors |
|
361 # -- <scalar[2]> link to errors |
|
362 # -- <scalar[3]> number of warnings |
|
363 # -- <scalar[4]> link to warnings |
|
364 # -- <scalar[5]> number of advisorynotes |
|
365 # -- <scalar[6]> link to advisorynotes |
|
366 # |
|
367 # Note: Links are currently not used, but instead constructed from the |
|
368 # component name and logfile location. Can be used in future for |
|
369 # logs located elsewhere etc. |
|
370 ########################################################################## |
|
371 sub getCBRResults { |
|
372 |
|
373 my $iComponent; |
|
374 my $iErrors; |
|
375 my $iErrorLink; |
|
376 my $iWarnings; |
|
377 my $iWarningLink; |
|
378 my $iAdvisoryNotes; |
|
379 my $iAdvisoryNotesLink; |
|
380 my $iRemarks; |
|
381 |
|
382 my @components; |
|
383 open (CBRLOGFILE, $iCBRLogFileLocation) || setHandleErrors($_[0]); |
|
384 |
|
385 my @iCBRLog = <CBRLOGFILE>; |
|
386 |
|
387 foreach (@iCBRLog) { |
|
388 |
|
389 if (m/(Overall_Total\s)([0-9]{0,2}:[0-9]{0,2}:[0-9]{0,2})\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)/) { |
|
390 if (($3 != 0) || ($4 !=0) || ($5 != 0)) { |
|
391 |
|
392 $iComponent = "Total"; |
|
393 $iErrors = $3; |
|
394 $iWarnings = $4; |
|
395 $iAdvisoryNotes = $5; |
|
396 $iRemarks = $6; # currently we ignore remarks from components. |
|
397 |
|
398 # now extract the URL for each warning. At the moment, this is a relative link |
|
399 # MUST make it absolute, to avoid problems |
|
400 |
|
401 my @componentdetails = ($iComponent, $iErrors, $iErrorLink, $iWarnings, $iWarningLink, $iAdvisoryNotes, $iAdvisoryNotesLink); |
|
402 push @components, \@componentdetails; |
|
403 } |
|
404 } |
|
405 } |
|
406 |
|
407 # return array of refs to arrays |
|
408 return @components; |
|
409 } |
|
410 |
|
411 ########################################################################## |
|
412 # |
|
413 # Name : getROMResults() |
|
414 # Synopsis: To parse a text logfile, and output results |
|
415 # into a common data format for processing |
|
416 # |
|
417 # Inputs : None |
|
418 # Outputs : Array of refs to arrays containing 5 scalars. The structure |
|
419 # is then used by the printResultRow() to display |
|
420 # |
|
421 # 1 <array 'container'> |
|
422 # | |
|
423 # 0-n <array ref> |
|
424 # | |
|
425 # -- <scalar[0]> component name |
|
426 # -- <scalar[1]> number of errors |
|
427 # -- <scalar[2]> link to errors |
|
428 # -- <scalar[3]> number of warnings |
|
429 # -- <scalar[4]> link to warnings |
|
430 # -- <scalar[5]> number of advisorynotes |
|
431 # -- <scalar[6]> link to advisorynotes |
|
432 # |
|
433 ########################################################################## |
|
434 sub getROMResults { |
|
435 |
|
436 my $iComponent; |
|
437 my $iErrors; |
|
438 my $iErrorLink; |
|
439 my $iWarnings; |
|
440 my $iWarningLink; |
|
441 my $iAdvisoryNotes; |
|
442 my $iAdvisoryNotesLink; |
|
443 my $iRemarks; |
|
444 my @components; |
|
445 open (ROMLOGFILE, $iROMLogFileLocation) || setHandleErrors($_[0]); |
|
446 |
|
447 my @iROMLog = <ROMLOGFILE>; |
|
448 |
|
449 # special kludge to deal with multi-line errors from ROMBUILD! |
|
450 # |
|
451 my $i = 0; |
|
452 my @iSingleLineErrors; |
|
453 |
|
454 foreach (@iROMLog) { |
|
455 ++$i; |
|
456 if ((m/ERROR: Can't build dependence graph for/) || |
|
457 (m/ERROR: Can't resolve dll ref table for/)) { |
|
458 |
|
459 # read 4 lines for the single error |
|
460 my $iErr = $_ . $iROMLog[$i].$iROMLog[$i+1].$iROMLog[$i+2].$iROMLog[$i+3]; |
|
461 $iErr =~ s/\t|\n/ /g; # replace tabs and newlines with a space |
|
462 |
|
463 # remove multi-line error, so that we dont process it twice |
|
464 $iROMLog[$i-1] = ""; |
|
465 $iROMLog[$i] = ""; |
|
466 $iROMLog[$i+1] = ""; |
|
467 $iROMLog[$i+2] = ""; |
|
468 $iROMLog[$i+3] = ""; |
|
469 |
|
470 push @iSingleLineErrors, $iErr; |
|
471 } |
|
472 } |
|
473 |
|
474 # now merge two arrays before processing |
|
475 push (@iROMLog, @iSingleLineErrors); |
|
476 |
|
477 |
|
478 # identify unique lines in log, as errors |
|
479 # are repeated for each ROM built |
|
480 my %iSeenLines = (); |
|
481 foreach my $iUniqueItem (@iROMLog) { |
|
482 $iSeenLines{$iUniqueItem}++; |
|
483 } |
|
484 my @iUniqueLogList = keys %iSeenLines; |
|
485 |
|
486 foreach (@iUniqueLogList) { |
|
487 if((m/WARNING: Sorting Rom Exception Table/) || |
|
488 (m/WARNING: DEMAND PAGING ROMS ARE A PROTOTYPE FEATURE ONLY/)) { |
|
489 my @componentdetails = ($_, "", $iErrorLink, "", $iWarningLink); |
|
490 push @components, \@componentdetails; |
|
491 } elsif ((m/Missing/) || (m/Invalid Resource name/) || (m/warning:/) || (m/WARNING:/)) { |
|
492 my @componentdetails = ($_, "", $iErrorLink, "1", $iWarningLink); |
|
493 |
|
494 push @components, \@componentdetails; |
|
495 } |
|
496 |
|
497 if ((m/ERROR: Can't build dependence graph for/) || |
|
498 (m/ERROR: Can't resolve dll ref table for/) || |
|
499 (m/cpp failed/i) || |
|
500 (m/cannot find oby file/i) || |
|
501 (m/no such file or directory/i)) { |
|
502 |
|
503 my @componentdetails = ($_, "1", $iErrorLink, "", $iWarningLink); |
|
504 push @components, \@componentdetails; |
|
505 } elsif (m/ERROR/) { |
|
506 my @componentdetails = ($_, "1", $iErrorLink, "", $iWarningLink); |
|
507 push @components, \@componentdetails; |
|
508 } |
|
509 } |
|
510 |
|
511 return @components; |
|
512 } |
|
513 |
|
514 ########################################################################## |
|
515 # |
|
516 # Name : getCDBResults() |
|
517 # Synopsis: To parse a logfile, and output results |
|
518 # into a common data format for processing |
|
519 # |
|
520 # Inputs : None |
|
521 # Outputs : Array of refs to arrays containing 5 scalars. The structure |
|
522 # is then used by the printResultRow() to display |
|
523 # |
|
524 # 1 <array 'container'> |
|
525 # | |
|
526 # 0-n <array ref> |
|
527 # | |
|
528 # -- <scalar[0]> component name |
|
529 # -- <scalar[1]> number of errors |
|
530 # -- <scalar[2]> link to errors |
|
531 # -- <scalar[3]> number of warnings |
|
532 # -- <scalar[4]> link to warnings |
|
533 # -- <scalar[5]> number of advisorynotes |
|
534 # -- <scalar[6]> link to advisorynotes |
|
535 # |
|
536 # Note: Links are currently not used, but instead constructed from the |
|
537 # component name and logfile location. Can be used in future for |
|
538 # logs located elsewhere etc. |
|
539 ########################################################################## |
|
540 sub getCDBResults { |
|
541 |
|
542 |
|
543 my $iComponent; |
|
544 my $iErrors; |
|
545 my $iErrorLink; |
|
546 my $iWarnings; |
|
547 my $iWarningLink; |
|
548 my $iAdvisoryNotes; |
|
549 my $iAdvisoryNotesLink; |
|
550 my $iRemarks; |
|
551 my @components; |
|
552 |
|
553 open (CDBLOGFILE, $iCDBLogFileLocation) || setHandleErrors($_[0]); |
|
554 |
|
555 my @iCDBLog = <CDBLOGFILE>; |
|
556 |
|
557 foreach (@iCDBLog) { |
|
558 |
|
559 if (m/(Component_)(.*)(\s[0-9]{0,2}:[0-9]{0,2}:[0-9]{0,2}\.?[0-9]{0,3})\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)\s([0-9]*)/) { |
|
560 if (($4 != 0) || ($5 !=0) || ($6 != 0)) { |
|
561 |
|
562 $iComponent = $2; |
|
563 $iErrors = $4; |
|
564 $iWarnings = $5; |
|
565 $iAdvisoryNotes = $6; |
|
566 $iRemarks = $7; # currently we ignore remarks from components. |
|
567 |
|
568 # now extract the URL for each warning. At the moment, this is a relative link |
|
569 # MUST make it absolute, to avoid problems |
|
570 my @componentdetails = ($iComponent, $iErrors, $iErrorLink, $iWarnings, $iWarningLink, $iAdvisoryNotes, $iAdvisoryNotesLink); |
|
571 push @components, \@componentdetails; |
|
572 |
|
573 } |
|
574 } |
|
575 } |
|
576 |
|
577 # return array of refs to arrays |
|
578 return @components; |
|
579 } |
|
580 |
|
581 ########################################################################## |
|
582 # |
|
583 # Name : getResults() |
|
584 # Synopsis: Factory like function to return an associated data structure |
|
585 # depending on the type requested. i.e. GT, TV etc. |
|
586 # |
|
587 # Inputs : Scalar containing the log/type required |
|
588 # Outputs : The output of getXXXResults() functions. |
|
589 # |
|
590 # 1 <array 'container'> |
|
591 # | |
|
592 # 0-n <array ref> |
|
593 # | |
|
594 # -- <scalar[0]> component name |
|
595 # -- <scalar[1]> number of errors |
|
596 # -- <scalar[2]> link to errors |
|
597 # -- <scalar[3]> number of warnings |
|
598 # -- <scalar[4]> link to warnings |
|
599 # -- <scalar[5]> number of advisorynotes |
|
600 # -- <scalar[6]> link to advisorynotes |
|
601 # |
|
602 ########################################################################## |
|
603 sub getResults { |
|
604 |
|
605 if ($_[0] eq "GT") { |
|
606 return getGTResults($_[0]); } |
|
607 |
|
608 if ($_[0] eq "TV") { |
|
609 return getTVResults($_[0]); } |
|
610 |
|
611 if ($_[0] eq "BUILD") { |
|
612 return getBUILDResults($_[0]); } |
|
613 |
|
614 if ($_[0] eq "CBR") { |
|
615 return getCBRResults($_[0]); } |
|
616 |
|
617 if ($_[0] eq "ROM") { |
|
618 return getROMResults($_[0]); } |
|
619 |
|
620 if ($_[0] eq "CDB") { |
|
621 return getCDBResults($_[0]); } |
|
622 |
|
623 } |
|
624 |
|
625 ########################################################################## |
|
626 # |
|
627 # Name : getLogFileLocation() |
|
628 # Synopsis: Accessor like function, to return the expected log file |
|
629 # location that is initialised in GenResult::main() |
|
630 # |
|
631 # Inputs : Scalar containing the log/type required |
|
632 # Outputs : Scalar containing the log location |
|
633 # |
|
634 ########################################################################## |
|
635 sub getLogFileLocation { |
|
636 |
|
637 if ($_[0] eq "GT") { |
|
638 return setBrowserFriendlyLinks($iLinkPathLocation.$iGTFileName); } |
|
639 |
|
640 if ($_[0] eq "TV") { |
|
641 if($_->[0]=~ /systemtest/i) { |
|
642 return setBrowserFriendlyLinks($iLinkPathLocation.$iTVEBSFileName);} |
|
643 else { |
|
644 return setBrowserFriendlyLinks($iLinkPathLocation.$iTVFileName); } |
|
645 } |
|
646 |
|
647 if ($_[0] eq "BUILD") { |
|
648 return setBrowserFriendlyLinks($iLinkPathLocation.$iBUILDFileName); } |
|
649 |
|
650 if ($_[0] eq "CBR") { |
|
651 return setBrowserFriendlyLinks($iLinkPathLocation.$iCBRFileName); } |
|
652 |
|
653 if ($_[0] eq "ROM") { |
|
654 return $iLinkPathLocation.$iROMFileName; } |
|
655 |
|
656 if ($_[0] eq "CDB") { |
|
657 return setBrowserFriendlyLinks($iLinkPathLocation.$iCDBFileName); } |
|
658 |
|
659 } |
|
660 |
|
661 ########################################################################## |
|
662 # |
|
663 # Name : getAnchorType() |
|
664 # Synopsis: Helper function, to return the HTML scanlog anchor for |
|
665 # a desired log type. |
|
666 # |
|
667 # Inputs : Scalar containing the log/type required |
|
668 # Outputs : Scalar containing the HTML anchor |
|
669 # |
|
670 ########################################################################## |
|
671 sub getAnchorType { |
|
672 |
|
673 if ($_[0] eq "GT") { |
|
674 return "Component"; } |
|
675 |
|
676 if ($_[0] eq "TV") { |
|
677 return "Component"; } |
|
678 |
|
679 if ($_[0] eq "BUILD") { |
|
680 return "Component"; } |
|
681 |
|
682 if ($_[0] eq "CBR") { |
|
683 return "Overall"; } |
|
684 |
|
685 if ($_[0] eq "CDB") { |
|
686 return "Overall"; } |
|
687 |
|
688 } |
|
689 |
|
690 ########################################################################## |
|
691 # |
|
692 # Name : isHTMLFile() |
|
693 # Synopsis: Identifies which log files should be processed as HTML |
|
694 # |
|
695 # Inputs : Scalar containing the log/type required |
|
696 # Outputs : "1" if the requested log is HTML |
|
697 # |
|
698 ########################################################################## |
|
699 sub isHTMLFile { |
|
700 |
|
701 if ($_[0] eq "GT" || $_[0] eq "TV" || $_[0] eq "BUILD" || $_[0] eq "CBR" || $_[0] eq "CDB") { |
|
702 return "1"; } |
|
703 } |
|
704 |
|
705 ########################################################################## |
|
706 # |
|
707 # Name : isTestBuild() |
|
708 # Synopsis: Identifies if this report is being generated for a test build |
|
709 # |
|
710 # Inputs : Global scalar for linkto location |
|
711 # Outputs : "1" if the build is being published as a testbuild. This will |
|
712 # obviously fail if testbuilds are not correctly published to |
|
713 # \\builds01\devbuilds\test_builds |
|
714 # |
|
715 ########################################################################## |
|
716 sub isTestBuild { |
|
717 |
|
718 # somehow, determine if this is a TBuild |
|
719 if (uc($iLinkPathLocation) =~ m/TEST_BUILD/) { |
|
720 return "1"; |
|
721 } |
|
722 |
|
723 return "0"; |
|
724 } |
|
725 |
|
726 |
|
727 ########################################################################## |
|
728 # |
|
729 # Name : setBrowserFriendlyLinks() |
|
730 # Synopsis: Re-formats UNC path to file, with a Opera/Fire-Fox friendly |
|
731 # version. Lotus Notes may cause problems though. |
|
732 # Inputs : UNC Path scalar |
|
733 # Outputs : Scalar |
|
734 # |
|
735 ########################################################################## |
|
736 sub setBrowserFriendlyLinks { |
|
737 my ($iOldLink) = @_; |
|
738 |
|
739 $iOldLink =~ s/\\/\//g; # swap backslashes to fwd slashes |
|
740 return "file:///".$iOldLink; |
|
741 } |
|
742 |
|
743 ########################################################################## |
|
744 # |
|
745 # Name : setBrowserFriendlyLinksForIN() |
|
746 # Purpose: Generate Links for Bangalore Site |
|
747 # Inputs : UNC Path scalar |
|
748 # Outputs : Scalar |
|
749 # |
|
750 ########################################################################## |
|
751 |
|
752 sub setBrowserFriendlyLinksForIN($ ) { |
|
753 my ($iOldLinkIN) = shift; |
|
754 |
|
755 $iOldLinkIN =~ s/\\/\//g; # swap backslashes to fwd slashes |
|
756 $iOldLinkIN = "file:///".$iOldLinkIN ; |
|
757 $iOldLinkIN =~ s/builds01/builds04/ ; # Generate Bangalore Log Location |
|
758 return $iOldLinkIN; |
|
759 } |
|
760 |
|
761 ########################################################################## |
|
762 # |
|
763 # Name : setBrowserFriendlyLinksForCN() |
|
764 # Purpose: Generate Links for Beijing Site |
|
765 # Inputs : UNC Path scalar |
|
766 # Outputs : Scalar |
|
767 # |
|
768 ########################################################################## |
|
769 |
|
770 sub setBrowserFriendlyLinksForCN($ ) { |
|
771 my ($iOldLinkCN) = shift; |
|
772 |
|
773 $iOldLinkCN =~ s/\\/\//g; # swap backslashes to fwd slashes |
|
774 $iOldLinkCN = "file:///".$iOldLinkCN ; |
|
775 $iOldLinkCN =~ s/builds01/builds05/ ; # Generate Beijing Log Location |
|
776 return $iOldLinkCN; |
|
777 } |
|
778 |
|
779 # helper function for formatting |
|
780 sub printSubmissionsLink { |
|
781 |
|
782 my ($iSnapshot) = @_; |
|
783 |
|
784 if (isTestBuild() eq "0") { |
|
785 return "[ <a class =\"hoverlink\" href = \"http://lon-engbuild08/bis-cgi/BIS_buildchanges.pl?first=$iSnapshot\"> Submissions</a> ]"; |
|
786 } |
|
787 } |
|
788 |
|
789 # helper function for formatting |
|
790 sub printDefectsColumn { |
|
791 |
|
792 if (isTestBuild() eq "0") { |
|
793 return "<th width=\"15%\"><font color=\"#ffffff\">Defects</font></th>"; |
|
794 } |
|
795 } |
|
796 |
|
797 # helper function to notify of any missing logs |
|
798 sub setHandleErrors { |
|
799 |
|
800 # set global filenotfound to "0" |
|
801 |
|
802 if ($_[0] eq "GT") { |
|
803 $iGTFileFound = "0"; } |
|
804 |
|
805 if ($_[0] eq "TV") { |
|
806 $iTVFileFound = "0"; } |
|
807 |
|
808 if ($_[0] eq "TV") { |
|
809 $iTVEBSFileFound = "0"; } |
|
810 |
|
811 if ($_[0] eq "BUILD") { |
|
812 $iBUILDFileFound = "0"; } |
|
813 |
|
814 if ($_[0] eq "CBR") { |
|
815 $iCBRFileFound = "0"; } |
|
816 |
|
817 if ($_[0] eq "ROM") { |
|
818 $iROMFileFound = "0"; } |
|
819 |
|
820 if ($_[0] eq "CDB") { |
|
821 $iCDBFileFound = "0"; } |
|
822 |
|
823 } |
|
824 |
|
825 # accessor function to return the flag for this type |
|
826 sub getHandleErrors { |
|
827 |
|
828 if ($_[0] eq "GT") { |
|
829 return $iGTFileFound; } |
|
830 |
|
831 if ($_[0] eq "TV") { |
|
832 return $iTVFileFound; } |
|
833 |
|
834 if ($_[0] eq "TV") { |
|
835 return $iTVEBSFileFound; } |
|
836 |
|
837 if ($_[0] eq "BUILD") { |
|
838 return $iBUILDFileFound; } |
|
839 |
|
840 if ($_[0] eq "CBR") { |
|
841 return $iCBRFileFound; } |
|
842 |
|
843 if ($_[0] eq "ROM") { |
|
844 return $iROMFileFound; } |
|
845 |
|
846 if ($_[0] eq "CDB") { |
|
847 return $iCDBFileFound; } |
|
848 } |
|
849 |
|
850 |
|
851 ########################################################################## |
|
852 # |
|
853 # Name : printResultRow() |
|
854 # Synopsis: Creates each HTML row for the build report. If the log file |
|
855 # being processed is HTML, then HTML links are generated also. |
|
856 # Plain text log files will just include output as specified |
|
857 # in the regexp for associated getXXXResults() functions. |
|
858 # |
|
859 # Inputs : Scalar containing the log/type required |
|
860 # Outputs : Scalar containing HTML row string to be inserted into |
|
861 # the build report |
|
862 ########################################################################## |
|
863 sub printResultRow { |
|
864 |
|
865 my ($iLogFile, $iStage, $iStagesFromFile) = @_; |
|
866 my $iResultRowHolder; |
|
867 my $iResultRow; |
|
868 |
|
869 # The hash holds values of the stages as array which are completed in the report.html file |
|
870 # so that older values in report.html file can be preserved. |
|
871 my %iStagesFromFileInHash = %{$iStagesFromFile} if defined ($iStagesFromFile); |
|
872 |
|
873 # get result |
|
874 my $iCount = "0"; |
|
875 $iResultRowHolder = |
|
876 "\n |
|
877 <tr> |
|
878 <th bgcolor=\"#006699\" width =\"5%\" align =\"left\"> <font color=\"#ffffff\">$iLogFile</font></th> |
|
879 <td width=\"15%\" align = \"left\">"; |
|
880 |
|
881 # prints the build results extracted from old report.html file. |
|
882 # Below code looks into the hash for stages whose results(Errors) are already calculated, and proceeds |
|
883 # computing results for next $iStage in xml file. |
|
884 if (defined ($iStagesFromFile) and defined ($iStagesFromFileInHash{$iLogFile})) { |
|
885 $iResultRowHolder = $iResultRowHolder . ${$iStagesFromFileInHash{$iLogFile}}[0]; |
|
886 }elsif (!getHandleErrors($iLogFile) or "$iLogFile" ne "$iStage") { |
|
887 $iResultRowHolder = $iResultRowHolder . "Stage not completed"; |
|
888 }else { |
|
889 foreach (getResults($iLogFile)) { |
|
890 undef $iResultRow; |
|
891 if ($_->[1] != "0") { |
|
892 if (isHTMLFile($iLogFile)) { |
|
893 $iResultRow = "<a class =\"hoverlink\" href =\"" . |
|
894 getLogFileLocation($iLogFile,$_->[0]) . |
|
895 "#errorsBy" . |
|
896 getAnchorType($iLogFile) . |
|
897 "_$_->[0]\">$_->[0]\ ($_->[1]\) <br></a>"; |
|
898 } |
|
899 else { |
|
900 $iResultRow = "<li>". $_->[0]; |
|
901 chomp $iResultRow; |
|
902 } |
|
903 ++$iCount; |
|
904 } |
|
905 |
|
906 $iResultRowHolder = $iResultRowHolder . $iResultRow; |
|
907 } |
|
908 # zero errors, means 'None' is displayed |
|
909 if ($iCount == "0"){ |
|
910 $iResultRowHolder = $iResultRowHolder . "None"; |
|
911 } |
|
912 } |
|
913 |
|
914 $iResultRowHolder = $iResultRowHolder . "</td>\n<td width=\"15%\" align = \"left\">"; |
|
915 |
|
916 $iCount = "0"; |
|
917 # print build results extracted from old report.html file. |
|
918 # Below code looks into the hash for stages whose results(Warnings) are already calculated, and proceeds |
|
919 # computing results for next $iStage in xml file. |
|
920 if (defined ($iStagesFromFile) and defined ($iStagesFromFileInHash{$iLogFile})) { |
|
921 $iResultRowHolder = $iResultRowHolder . ${$iStagesFromFileInHash{$iLogFile}}[1]; |
|
922 }elsif (!getHandleErrors($iLogFile) || "$iLogFile" ne "$iStage") { |
|
923 $iResultRowHolder = $iResultRowHolder . "Stage not completed"; |
|
924 }else { |
|
925 foreach (getResults($iLogFile)) { |
|
926 undef $iResultRow; |
|
927 if ($_->[3] != "0") { |
|
928 if (isHTMLFile($iLogFile)) { |
|
929 $iResultRow = "<a class =\"hoverlink\" href =\"" . |
|
930 getLogFileLocation($iLogFile) . |
|
931 "#warningsBy" . |
|
932 getAnchorType($iLogFile) . |
|
933 "_$_->[0]\">$_->[0]\ ($_->[3]\) <br></a>"; |
|
934 } |
|
935 else { |
|
936 $iResultRow = "<li>".$_->[0]; |
|
937 chomp $iResultRow; |
|
938 } |
|
939 ++$iCount; |
|
940 } |
|
941 |
|
942 |
|
943 $iResultRowHolder = $iResultRowHolder . $iResultRow; |
|
944 } |
|
945 |
|
946 # zero warnings, means 'None' is displayed |
|
947 if ($iCount == "0"){ |
|
948 $iResultRowHolder = $iResultRowHolder . "None"; |
|
949 } |
|
950 } |
|
951 |
|
952 $iResultRowHolder = $iResultRowHolder . "</td>\n<td width=\"15%\" align = \"left\">"; |
|
953 |
|
954 $iCount = "0"; |
|
955 # print build results extracted from old report.html file. |
|
956 # Below code looks into the hash for stages whose results(AdvisoryNotes) are already calculated, and proceeds |
|
957 # computing results for next $iStage in xml file. |
|
958 if (defined ($iStagesFromFile) and defined ($iStagesFromFileInHash{$iLogFile})) { |
|
959 $iResultRowHolder = $iResultRowHolder . ${$iStagesFromFileInHash{$iLogFile}}[2]; |
|
960 }elsif (!getHandleErrors($iLogFile) || "$iLogFile" ne "$iStage") { |
|
961 $iResultRowHolder = $iResultRowHolder . "Stage not completed"; |
|
962 }else { |
|
963 foreach (getResults($iLogFile)) { |
|
964 undef $iResultRow; |
|
965 if ($_->[5] != "0") { |
|
966 if (isHTMLFile($iLogFile)) { |
|
967 $iResultRow = "<a class =\"hoverlink\" href =\"" . |
|
968 getLogFileLocation($iLogFile) . |
|
969 "#AdvisoryNotesBy" . |
|
970 getAnchorType($iLogFile) . |
|
971 "_$_->[0]\">$_->[0]\ ($_->[5]\) <br></a>"; |
|
972 } |
|
973 else { |
|
974 $iResultRow = "<li>".$_->[0]; |
|
975 chomp $iResultRow; |
|
976 } |
|
977 ++$iCount; |
|
978 $iBraggflag = 1; |
|
979 } |
|
980 |
|
981 $iResultRowHolder = $iResultRowHolder . $iResultRow; |
|
982 } |
|
983 |
|
984 # zero warnings, means 'None' is displayed |
|
985 if ($iCount == "0"){ |
|
986 $iResultRowHolder = $iResultRowHolder . "None"; |
|
987 } |
|
988 } |
|
989 $iResultRowHolder = $iResultRowHolder . "</td>\n<td> </td> \n</tr>\n"; |
|
990 |
|
991 return $iResultRowHolder; |
|
992 } |
|
993 ########################################################################## |
|
994 # |
|
995 # Name : extractOldResults() |
|
996 # Synopsis: Extracts the old results of different stages which are already generated |
|
997 # Inputs : Filename of report.html along with complete path |
|
998 # Outputs : Returns a reference to hash whose keys are stages and values are values from html file. |
|
999 ########################################################################## |
|
1000 sub extractOldResults { |
|
1001 my $iFileName = shift @_; |
|
1002 my $iFlag = 0; |
|
1003 my @lines; |
|
1004 my %iStages; |
|
1005 |
|
1006 open FILE, "$iFileName" or die "Can't open $iFileName: $!\n"; |
|
1007 @lines = <FILE>; |
|
1008 close FILE; |
|
1009 |
|
1010 my $iStagesToFetch = $iBuildStages; |
|
1011 my $iCurrentStage = ''; |
|
1012 my @iStageValues = (); |
|
1013 |
|
1014 foreach (@lines ) { |
|
1015 if ($iFlag == 1 and /<\/tr>/i) { |
|
1016 my $iCurrentStageValues = "@iStageValues"; |
|
1017 $iStages{$iCurrentStage} = [@iStageValues] if ($iCurrentStageValues !~ /(Stage not completed *){2}/); |
|
1018 $iFlag = 0; |
|
1019 } |
|
1020 |
|
1021 if ($iFlag == 1) { |
|
1022 push (@iStageValues, $1) if (/left">(.+?)<\/td>/); |
|
1023 } |
|
1024 |
|
1025 if (/>($iStagesToFetch)</) { |
|
1026 @iStageValues = (); |
|
1027 $iFlag = 1; |
|
1028 $iCurrentStage = $1; |
|
1029 } |
|
1030 } |
|
1031 return \%iStages; |
|
1032 } |
|
1033 |
|
1034 ########################################################################## |
|
1035 # |
|
1036 # Name : generateHTMLSummary() |
|
1037 # Synopsis: Creates an HTML report for the specified build. |
|
1038 # Inputs : Scalar containing the build snapshot and product type |
|
1039 # Outputs : HTML report, published in current working dir |
|
1040 ########################################################################## |
|
1041 sub generateHTMLSummary { |
|
1042 |
|
1043 my ($iDir, $iSnapshot, $iProduct, $iLinkPath, $iStage, $iBrag, $imail) = @_; |
|
1044 |
|
1045 #Get Brag Status of Build and generate PostBuild results |
|
1046 my $iPostBuildResult; |
|
1047 if (defined($iBrag) and "$iBrag" eq "FINAL") { |
|
1048 $iBrag = &BragStatus::main($iDir, $iSnapshot, $iProduct, $iLinkPath); |
|
1049 $iPostBuildResult=&GenPostBuildResult::generatesPostBuildSummary($iLogsPublishLocation, $iLinkPathLocation, $iProduct, $iSnapshot, $imail); |
|
1050 } else { |
|
1051 $iBrag = "TBA"; |
|
1052 } |
|
1053 # change to roms\techview dir for roms link |
|
1054 my $iROMLocation = $iLogsPublishLocation; |
|
1055 $iROMLocation =~s/logs/roms\\techview/g; |
|
1056 |
|
1057 # check to see of the report.html already exists to extract previous results |
|
1058 my ($iStagesFromFile); |
|
1059 my $iReportFileNameWithPath = "$iSnapshot"."_"."$iProduct"."_report.html"; |
|
1060 if (-f $iReportFileNameWithPath) { |
|
1061 $iStagesFromFile = extractOldResults($iReportFileNameWithPath) ; |
|
1062 print "Updating ".$iSnapshot."_".$iProduct."_report.html\n "; |
|
1063 } else { |
|
1064 print "Creating ".$iSnapshot."_".$iProduct."_report.html\n " |
|
1065 } |
|
1066 open (SUMMARY, "+> $iSnapshot"."_"."$iProduct"."_report.html") or die "ERROR:Can't open file : $!"; |
|
1067 |
|
1068 # Build the final result string before generating report.html file. |
|
1069 # Builds ResultString based on command line input. |
|
1070 # All => Generates results for all the stages |
|
1071 |
|
1072 my $printResult = ""; |
|
1073 my $iResultString = ""; |
|
1074 foreach my $iType (split /\|/, $iBuildStages) { |
|
1075 if ("$iStage" eq "ALL"){ |
|
1076 $iResultString = printResultRow($iType, $iType, $iStagesFromFile); |
|
1077 } |
|
1078 else{ |
|
1079 $iResultString = printResultRow($iType, $iStage, $iStagesFromFile); |
|
1080 }# pass iStage here & iStagesFromFile. |
|
1081 $printResult = $printResult . $iResultString; |
|
1082 } |
|
1083 #Calculate the new external status BRAGG(Black Red Amber Green Gold) |
|
1084 my $iBragg; |
|
1085 if("$iBrag" eq "Green" && $iBraggflag eq 0) |
|
1086 { |
|
1087 $iBragg = "Gold"; |
|
1088 } else { |
|
1089 $iBragg = $iBrag; |
|
1090 } |
|
1091 my $html_start = "\n |
|
1092 <HTML> |
|
1093 <HEAD>" . |
|
1094 $gStyleSheet . |
|
1095 "<TITLE>" . "$iSnapshot "."$iProduct ". "Build Report</TITLE> |
|
1096 |
|
1097 <BODY BGCOLOR=\"FFFFFF\"> |
|
1098 </HEAD> |
|
1099 <BODY> |
|
1100 <TABLE width=\"100%\" border =\"1\" cellpadding=\"0\"> |
|
1101 <TR><TD bgcolor=\"#006699\"><font color=\"#FFFFFF\"><font size=\"5\"> |
|
1102 <B>" . "$iSnapshot "."$iProduct ". "Build Report "."</B> |
|
1103 <br><i><b><font size=\"3\">Build Status : $iBrag </font></b></i> |
|
1104 <br><i><b><font size=\"3\">BRAGG : $iBragg </font></b></i> |
|
1105 <br><i><font size=\"3\">Released By : </font></i> |
|
1106 <br><i><font size=\"3\">Reason : </font></i> |
|
1107 </TD></TR> |
|
1108 </TABLE> |
|
1109 |
|
1110 <font size=\"2\"><p> |
|
1111 [ <a class =\"hoverlink\" href = \"http://web.intra/Softeng/SwE/prodintegbuild/integration/System_Build/BuildResults.html\"> Help</a> ] |
|
1112 [ Logs <a class =\"hoverlink\" href = \"" . setBrowserFriendlyLinks($iLinkPathLocation)."\"> UK </a> <a class =\"hoverlink\" href = \"" . setBrowserFriendlyLinksForCN($iLinkPath )."\"> CN </a> <a class =\"hoverlink\" href = \"" . setBrowserFriendlyLinksForIN($iLinkPath )."\"> IN </a> ] |
|
1113 [ <a class =\"hoverlink\" href = \"http://web.intra/Softeng/SwE/prodintegbuild/integration/docs/guides/CBR_Archive_Guide.html\"> CBR Setup</a> ] |
|
1114 ". |
|
1115 |
|
1116 "</p> |
|
1117 <br> <i>Results Generated On ".localtime()."</i> |
|
1118 </font><br><br>". |
|
1119 |
|
1120 "<br><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"top\"> |
|
1121 <tr bgcolor=\"#006699\" align=\"top\"><th colspan=5><font color=\"#ffffff\">Build Results</font></th></tr> |
|
1122 <tr bgcolor=\"#006699\" align=\"top\"> |
|
1123 <th width=\"10%\"></th> |
|
1124 <th width=\"15%\"><font color=\"#ffffff\">Errors</font></th> |
|
1125 <th width=\"15%\"><font color=\"#ffffff\">Warnings</font></th> |
|
1126 <th width=\"15%\"><font color=\"#ffffff\">Advisorynotes</font></th>" . |
|
1127 printDefectsColumn() . |
|
1128 "</tr>" . |
|
1129 |
|
1130 $printResult. |
|
1131 |
|
1132 "</table><br>" |
|
1133 |
|
1134 .&GenAutoSmokeTestResult::generateSTHTMLSummary($iLogsPublishLocation."AutoSmokeTest", $iSnapshot, $iProduct, $iLinkPathLocation."AutoSmokeTest"). |
|
1135 |
|
1136 $iPostBuildResult. |
|
1137 |
|
1138 "</BODY> |
|
1139 </html> |
|
1140 "; |
|
1141 |
|
1142 |
|
1143 print SUMMARY $html_start; |
|
1144 |
|
1145 close SUMMARY; |
|
1146 } |
|
1147 |
|
1148 |
|
1149 |
|
1150 # Entry point into the GenResult module |
|
1151 sub main |
|
1152 { |
|
1153 my ($iDir, $iSnapshot, $iProduct, $iLinkPath, $iStage, $iBrag, $imail) = @_; |
|
1154 |
|
1155 # set file names, so that they can be accessed globally |
|
1156 $iGTFileName = "GT.summary.html"; |
|
1157 $iTVFileName = "TV.summary.html"; |
|
1158 $iTVEBSFileName = "TV.EBS.summary.html"; |
|
1159 $iBUILDFileName = "$iSnapshot"."_Symbian_OS_v"."$iProduct".".summary.html"; |
|
1160 $iCBRFileName = "$iSnapshot"."_Symbian_OS_v"."$iProduct"."_cbr.summary.html"; |
|
1161 $iCDBFileName = "$iSnapshot"."_Symbian_OS_v"."$iProduct"."_cdb.summary.html"; |
|
1162 $iROMFileName = "techviewroms"."$iSnapshot"."_Symbian_OS_v"."$iProduct". ".log"; |
|
1163 |
|
1164 |
|
1165 |
|
1166 $iDir =~ s/[^\\]$/$&\\/; #add trailing backslash, if missing |
|
1167 $iLogsPublishLocation = $iDir; |
|
1168 |
|
1169 |
|
1170 if (-e $iLinkPath) { |
|
1171 $iLinkPathLocation = $iLinkPath; |
|
1172 } else { |
|
1173 # if no link path is specified, then use current directory location |
|
1174 #print "WARNING:" .$iLinkPath. " does not exist, linking with relative paths\n"; |
|
1175 $iLinkPathLocation = $iLogsPublishLocation; |
|
1176 } |
|
1177 |
|
1178 if (-e $iLogsPublishLocation) { |
|
1179 |
|
1180 $iGTLogFileLocation = $iLogsPublishLocation.$iGTFileName; |
|
1181 $iTVLogFileLocation = $iLogsPublishLocation.$iTVFileName; |
|
1182 $iTVEBSLogFileLocation = $iLogsPublishLocation. $iTVEBSFileName; |
|
1183 $iBUILDLogFileLocation = $iLogsPublishLocation.$iBUILDFileName; |
|
1184 $iCBRLogFileLocation = $iLogsPublishLocation.$iCBRFileName; |
|
1185 $iROMLogFileLocation = $iLogsPublishLocation.$iROMFileName; |
|
1186 $iCDBLogFileLocation = $iLogsPublishLocation.$iCDBFileName; |
|
1187 |
|
1188 |
|
1189 |
|
1190 &generateHTMLSummary($iDir, $iSnapshot, $iProduct, $iLinkPath, $iStage, $iBrag, $imail); |
|
1191 |
|
1192 } |
|
1193 else { |
|
1194 die "ERROR: Report not created: $! \n"; |
|
1195 } |
|
1196 } |
|
1197 1; |