blib/lib/Test/AutomationFramework.pm

filter: Statementstmt 14.2% 645 / 4538 Branchbran 10.8% 251 / 2312 Conditioncond 8.5% 25 / 292 MC/DCmcdc 2.4% 4 / 165 Subroutinesub 21.0% 50 / 238 Podpod 0.4% 1 / 210 totaltotal 12.5% 976 / 7755 CC 2529 SCAR 73.7
CC
2529
Cov
13%
setGlobalVars
8425.1
setGlobalVars
8425.1
reportTC
5550.0
CRAP 1593.2
↑ Summary
1 package Test::AutomationFramework;
2 2 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Date::Manip;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use File::Path;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 #use Test::More;
8 2 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use File::Copy;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use File::Find;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Regexp::Assemble;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Cwd;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use IO::Socket; # might not work in http mode
Subroutine BEGIN: called CC=1 SCAR=0.0
15 #if ($^O =~ /win32/i) { use Term::ReadKey; }
16 2 ▶use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
Subroutine BEGIN: called CC=1 SCAR=0.0
17 $| = 1;
18 require Exporter;
19 our @ISA = qw(Exporter);
20 our %EXPORT_TAGS = ( 'all' => [ qw(
21 ) ] );
22  
23 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
24 our @EXPORT = qw(
25 help
26 processTCs
27 processTC
28 processProperty
29 genDriver_taf_pl
30 genDriver_taf_cgi
31 genDriver_taf_svr
32 initTAF
33 printVersion
34 printTAFVersion
35 printOSVersion
36 fetchmail
37 installTestbed
38 deleteTestbed
39 );
40  
41  
42 our $VERSION = '0.060.04';
43  
44 ###################### TAF Global Variables ###############################
45 my %tsProperty ; my %tsPropertyRoot; my %tafProperty ; my %tafPropertyRev; my $propertyOp=''; my $regression=0; my $help=0; my $sleep4Display = 1; my $notUsegetTCName= 0; my %recordTags=();
46 my $tcIdCtr=0 ; my $tsDriver = "null" ; # cmd-line-overwrite $testDriverName (generated by -e .. index.pl or index.ps1)
47 my $pr2Screen = 1 ; my $tcIdMin= 0 ; my $reportHtmlSummaryStr = ''; # String for mouse-over display TC summary
48 my $Execution_24_7 = "n";
49 my $Execution_24_7_title= "y";
50 my $Execution_local_only= "n";
51 my $Execution_from_cgi = "n";
52 my $NofExecution = "1"; my $NofExecutionCtr=0; my $NofExecutionCtrExec=0;
53 my $ExecutionLength = "10000 hour";
54 my $ExecutionType = '>';
55 my @tcDesc; my $tsFilter=".*";
56 my $exitTAFTCId ;
57 my $tcComment1 ="Comment1";
58 my $tcComment2 ="PlaceHolderforComment2";
59 my $MaxTCExecTime = 10 ;
60 my $NofPropertyExecCtr = 0 ;
61 my $NofPropertyExec = 0 ;
62 my $tags ="_full_,_smoke_,_smoketest_,_regression_,_regressiontest_,_bat_,_32bit_,_64bit_,_list_,_load_,_erase_,_install_";
63 my $TSHookIsPerl = "n";
64 my $outputFormat = "text"; # noOutput
65 my $htmlRefreshRate = 200;
66 my $htmlRefreshRateWebUI= 200;
67 my $htmlRefreshRateLogUI= 200;
68 my $createOrAppendTS = "create"; #"append"; # create
69 my $outputPause = 0;
70 my $titleStatus = "";
71 my $perl = $^X; $perl =~ s/\\/\\\//g; # todo3 \\ linux
72 my $perl_ = $^X; $perl_=~ s/\\/\//g; # todo3 \\
73 my $listAll_var ="";
74 ###################### TAF Generated Variables ###############################
75 my $scriptName = $0; $scriptName =~ s/\\/\//g; # linux
76 my $workingDir = getcwd();
77 my $TSHookName = "index.pl";
78 my $TSHookNameParent = "indexindex.pl";
79 my $TSHookNameGenerated = "index.pl";
80 my $createTS_index = "createTS_index.pl";
81 my $createTS_indexindex = "createTS_indexindex.pl";
82  
83 ###################### TAF Default Variables ###############################
84 my $overWriteTC = "y";
85 my $interact = "n";
86  
87 my $tcPropertyPatternName = "tcRunResult";
88 my $tcPropertyPatternPattern = ".*";
89 my $tcPropertyPatternName1 = "tcRunResult";
90 my $tcPropertyPatternPattern1 = ".*";
91 my $tcPropertyPatternName2 = "tcRunResult";
92 my $tcPropertyPatternPattern2 = ".*";
93 my $tcPropertyPatternName3 = "tcRunResult";
94 my $tcPropertyPatternPattern3 = ".*";
95 my $tcPropertyName = "all";
96 my $tcPropertyPattern = Regexp::Assemble->new;
97 my $tcNamePattern = "TC*";
98 my $tcOp = 'list';
99 my $tcCtr = 0;
100 my $tcDelta = 20;
101 my $markSymbol = '|';
102 my $cgi_bin = "/"; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $cgi_bin = "/" ; }
103 my $c = "c:"; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $c= "/tmp/var/www/cgi-bin" ; }
104 my $ping = "C:/Windows/System32/ping.exe -n 1 "; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $ping = "/bin/ping -c 1 " ; }
105 my $deli = ";"; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $deli = '~' ; }
106 my $copy = "copy"; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $copy= 'copy' ; }
107 my $http_port = ":8080"; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $http_port= ":1234" ; }
108 my $_realSemi_ = ";"; if ( $^O =~ /MSWin32/ ) {; } elsif ($^O =~ /linux/i) { $_realSemi_ = '&' ; }
109 my $taf = "taf.pl";
110 my $tafCGI = "taf.cgi";
111 my $SUTSymbol = "_";
112 my $tsFilterDefault = "_";
113 my $tcFilterDefault = ".*";
114 my $_TAF = "_TAF"; # very useful variable
115 my $NofTCinTSTemplate = -1; # very useful variable
116 my $SvrDrive = $c.'/'.$_TAF; # *:will be reset later in generated variable section
117 my $SvrProjName = '_testsuite1_';
118 my $SvrProjNameSub = '';
119 my $SvrTCName = '_testcase1_';
120 my $SvrTCNamePattern = "*";
121 my $SvrPropNamePattern = '.*';
122 my $SvrPropValuePattern = ".*";
123  
124 my $SvrTCNameExecPattern = ".".$SvrTCNamePattern; # *
125 my $SvrLogDir = ''.$SvrProjName.''; # *
126 my $ps1_args = "-ps1_args___powershell_args"; # should not include -ps1_args
127 my $exitTAFGracefullyLock = $c.'/'.$_TAF.'/'."_exitTAFGracefully_.txt"; # *
128 my $exitTAFGracefullyString = 1;
129 my $performanceMode = "slow4webUI"; # fast4cmd
130 my $generateTestsuiteBAT = $c.'/'.$_TAF."/taf_generateTestsuite.bat"; # *
131 my $tsFrom ="";
132 my $tsTo ="";
133 my $resetTSFileName ="";
134 my $externalLogName ="$c/$_TAF/externalLog.txt"; # *
135 my $commandLogName ="$c/$_TAF/_cmdLogs.txt"; # *
136 my $commandLogLifeSpan = "-3 days";
137 my $queueSizeLimit = 10000;
138 ###################### TAF WebUI Default Settings ###############################
139  
140 my $webUITreeViewLevel = 20;
141 my $excelReportColumnWidth = 9;
142 my $AutomationtsName ="Automation_MVSDK";
143 my $makeMark = 'n'; my $makeMarkComment = '';
144 my $makeMarkLastDay = &getExecDay();
145 my $web_ui_title ="Test Automation Framework";
146 my $webUI_TCDescWidth = 120; # <<<<<<<<<<<<<<
147 my $scrollAmount = 0;
148 my $borderWidth = 0;
149 my $borderStyle = "SOLID";
150 my $passFailDisplayWidth = 8; # TS Variable. Should be reset for each TS execution
151 my $maxPassFailDisplayWidth = 40;
152 my $reportHtmlSummaryScale = 3600; # in seconds
153 my $reportHtmlSummaryScaleMajor = 12; # in seconds
154 my $tsProperty = 'tsProperty.txt';
155 my $tsPropertyWidth = 150; # <<<<<<<<<<<<<<<<<
156 my $testcaseNode = "testcase" ;
157 my $testType = "ts"; # ts for testsuite
158 my $reportHtml = 'index.htm';
159 my $reportHtml1 = '_tcReport_.html';
160 my $reportHtmlHistory = '_tcReportHistory_.html';
161 my $reportHtmlSummary = '_tcReportSummary_.html';
162 my $tc_pl = "tc.pl";
163  
164 my $reportHtml_http = 'index_http.htm'; # $reportHtml."_http";
165 my $reportHtml1_http = '_tcReport_.html'."_http";
166 my $reportHtmlHistory_http = '_tcReportHistory_.html'."_http";
167  
168 my $web_ui_title_tip = "Run TAF-Team Version based on IIS/httpd";
169 my $hostname = "localhost";
170 my $ip = "127.0.0.1";
171  
172 my $rst = `$ping $hostname`;
173 if ($rst =~ /Ping request could not/i) { $web_ui_title_tip = "Click to update every TAF testsuites";}
174 elsif ($rst =~ /unknown/i) { $web_ui_title_tip = "Click to update every TAF testsuites";}
175 else {
176 $hostname = `hostname`; chop $hostname;
177 $ip = inet_ntoa((gethostbyname($hostname))[4]);
178 }
179
180 my $queueFName = "taf.queue";
181  
182 my $lockFName = "$c/$_TAF/taf.lock";
183 my $url = 'file:///'.$SvrDrive; # will be updated in the sub-processTCs
184 my $urlHttp = 'http://'.$ip.$http_port; # will be updated in the sub-processTCs
185 my $indexTitleRefresh = sprintf("<a href=\"${url}/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$c;_TAF=$_TAF;generateTestsuiteAgain')\" title=\"Refresh *all* TAF Testsuites\" > </a>");
186 my $indexTitleRefreshCGI= sprintf("<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=SysDrive=${SvrDrive}_semi_generateTestsuiteAgain;tafRedirectory=${urlHttp}/$reportHtml_http\" title=\"Refresh *all* TAF Testsuites\"> </a>");
187
188 my $indexTitleRefreshRoot = sprintf("<a href=\"${url}/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$c;_TAF=$_TAF;generateRootIndex')\" title=\"Refresh Root Index\" > </a>");
189 my $indexTitleRefreshCGIRoot= sprintf("<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=SysDrive=${SvrDrive}_semi_generateRootIndex;tafRedirectory=${urlHttp}/$reportHtml_http\" title=\"Refresh Root Index\"> </a>");
190  
191 if (-e "$c/$_TAF/_tafGlobalVars.txt") { &readTAFGlobalVars(); } else { &printTAFGlobalVars();} # Global Variables
192  
193 ######### Generated Variables
194 $SvrDrive = $c.'/'.$_TAF;
195 $exitTAFGracefullyLock = $c.'/'.$_TAF.'/'."_exitTAFGracefully_.txt";
196 $SvrTCNameExecPattern = ".".$SvrTCNamePattern; # *
197 $SvrLogDir = ''.$SvrProjName.''; # *
198 $generateTestsuiteBAT = $c.'/'.$_TAF."/taf_generateTestsuite.bat"; # *
199 $externalLogName ="$c/$_TAF/externalLog.txt"; # *
200 $commandLogName ="$c/$_TAF/_cmdLogs.txt"; # *
201  
202 2 ▶sub new { my $package = shift; return bless({}, $package); }
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
203  
204 sub tcLoop { ###### Testsuite Loop #####
205 0 ▶ my $returnValue;
Subroutine tcLoop: not called CC=12 SCAR=39.5
Pod undocumented
206 0 ▶ if (-e "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt") { &readTAFTSVars();} # TS Global Variables will overwrite TAF Global Variables
Branch: 2 branches
BranchTrueFalseTotal
if (-e "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt") 0 0 0
if (-e "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt") 0 1 1
207  
208 0 ▶ while ((($Execution_24_7 eq 'y') || ($NofExecution > $NofExecutionCtr)) && ($NofPropertyExec >= $NofPropertyExecCtr )) {
Branch: 2 branches
BranchTrueFalseTotal
if ($Execution_24_7 eq "y" || $NofExecution > $NofExecutionCtr and $NofPropertyExec >= $NofPropertyExecCtr) 0 0 0
if ($Execution_24_7 eq "y" || $NofExecution > $NofExecutionCtr and $NofPropertyExec >= $NofPropertyExecCtr) 1 0 1
Condition0%0/6
$Execution_24_7 eq "y" || $NofExecution > $NofExecutionCtr and $NofPropertyExec >= $NofPropertyExecCtr
!ll&&!rl&&r
000
$Execution_24_7 eq "y" or $NofExecution > $NofExecutionCtr
l!l&&r!l&&!r
000
MC/DC0%0/3
$Execution_24_7 eq "y" || $NofExecution > $NofExecutionCtr and $NofPropertyExec >= $NofPropertyExecCtr
$Execution_24_7 eq "y" $NofExecution > $NofExecutionCtr $NofPropertyExec >= $NofPropertyExecCtr
Truth table0%0/5
A or B and C
A= $Execution_24_7 eq "y"B= $NofExecution > $NofExecutionCtrC= $NofPropertyExec >= $NofPropertyExecCtr
ABCresult
00X0
1X00
0100
1X11
0111
209 0 &markDaily();
210 0 $NofExecutionCtr++;
211 0 ▶ my $tcOp_ = $tcOp; if ($tcOp_ =~ /list/) {$tcOp_ = "list & update";}
Branch: 2 branches
BranchTrueFalseTotal
if ($tcOp_ =~ /list/) 0 0 0
if ($tcOp_ =~ /list/) 0 1 1
212 0 my $currentTime = &UnixDate( "now", "%m/%d/%Y %H:%M:%S %Z" );
213 0 ▶ if ($pr2Screen == 1) { if (($NofExecution == 1) && ($Execution_24_7 ne 'y')){ print "Processing $c/$_TAF/$SvrProjName ($tcOp_) <- Testsuite \n" if ($outputFormat =~ /text/i) ; } else {print "Processing ($NofExecutionCtrExec\/$NofExecution) ......\n" ; } } else { print "";}
Branch: 6 branches
BranchTrueFalseTotal
if ($pr2Screen == 1) { } 0 0 0
if ($NofExecution == 1 and $Execution_24_7 ne 'y') { } 0 0 0
if $outputFormat =~ /text/i 0 0 0
if ($pr2Screen == 1) { } 1 0 1
if ($NofExecution == 1 and $Execution_24_7 ne 'y') { } 0 1 1
if $outputFormat =~ /text/i 1 0 1
Condition0%0/3
$NofExecution == 1 and $Execution_24_7 ne "y"
!ll&&!rl&&r
000
MC/DC0%0/2
$NofExecution == 1 and $Execution_24_7 ne "y"
$NofExecution == 1 $Execution_24_7 ne "y"
Truth table0%0/3
A and B
A= $NofExecution == 1B= $Execution_24_7 ne "y"
ABresult
0X0
100
111
214  
215 0 ▶ if (($propertyOp =~ /^\s*$/) || ($propertyOp =~ /tcDescAuto/i)) { $NofExecutionCtrExec++;
Branch: 2 branches
BranchTrueFalseTotal
if ($propertyOp =~ /^\s*$/ or $propertyOp =~ /tcDescAuto/i) { } 0 0 0
if ($propertyOp =~ /^\s*$/ or $propertyOp =~ /tcDescAuto/i) { } 0 1 1
Condition0%0/3
$propertyOp =~ /^\s*$/ or $propertyOp =~ /tcDescAuto/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$propertyOp =~ /^\s*$/ or $propertyOp =~ /tcDescAuto/i
$propertyOp =~ /^\s*$/ $propertyOp =~ /tcDescAuto/i
Truth table0%0/3
A or B
A= $propertyOp =~ /^\s*$/B= $propertyOp =~ /tcDescAuto/i
ABresult
1X1
011
000
216 0 &tcPre(); &tcMain_(); &tcPost(); }
217 else {
218 #&xtcMain_(); if ($NofPropertyExec =~ /y/i) { $propertyExecCtrEqZero = "y"; $propertyOp = ""; } else {$NofPropertyExecCtr++;}
219 0 &tcMain_(); $NofPropertyExecCtr++;
220 } # TC Property Process
221 #### uncomment for debugging if ($pr2Screen==1) { if ($propertyOp) { print " -> $SvrDrive/$SvrProjName/_${propertyOp}.txt\n"; } print " - Completed -\n"; } else { print "";}
222 }
223 0 return $returnValue;
224 }
225 sub tcPre {
226 # if (-e $SvrDrive.'/'.$SvrProjName) {;} else { print "$SvrDrive/$SvrProjName doesn't exist.\n"; exit; } # Fix 2013/04/13
227 ##################### PrePRocessor #####################
228 0 ▶ if ($tcOp =~ /create/i) {
Subroutine tcPre: not called CC=6 SCAR=26.9
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
if ($tcOp =~ /create/i) 0 0 0
if ($tcOp =~ /create/i) 1 0 1
229 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1) {;} else { &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1,"<html><body>") };
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml1) { } 0 0 0
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml1) { } 0 1 1
230 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http) {;} else { &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http,"<html><body>--- _tcReport_.htm will be available after list/update operation ---</body></html>") };
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml1_http) { } 0 0 0
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml1_http) { } 1 0 1
231 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlSummary) {;} else { &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlSummary,"<html><body>--- summary file will be available after list/update operation ---</body></html>") };
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtmlSummary) { } 0 0 0
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtmlSummary) { } 0 1 1
232 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory) {;} else { &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"<html><body>--- history file will be available after list/update operation ---</body></html>") };
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtmlHistory) { } 0 0 0
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtmlHistory) { } 1 0 1
233 }
234 0 &readTestSuitProperty();
235 ########################################################
236 }
237  
238 0 ▶sub tcMain_ { $notUsegetTCName= 1; find( {preprocess=>sub {return sort @_;}, wanted=>\&recursiveSearchtcMain}, $SvrDrive); }
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine tcMain_: not called CC=1 SCAR=6.9
Pod undocumented
239 sub recursiveSearchtcMain() {
240 0 ▶ my $returnValue ='';
Subroutine recursiveSearchtcMain: not called CC=42 SCAR=64.0
Pod undocumented
241 0 ▶ if ($SvrTCNamePattern eq '*') { $SvrTCNamePattern = '.*';}
Branch: 2 branches
BranchTrueFalseTotal
if ($SvrTCNamePattern eq "*") 0 0 0
if ($SvrTCNamePattern eq "*") 0 1 1
242 0 ▶ if (($File::Find::name =~ /tc.pl\s*$/) && ($File::Find::name =~ /$SvrDrive\/$SvrProjName\/$testcaseNode/i) && ($File::Find::name =~ /$SvrTCNamePattern/i)) # TC Filter
Branch: 2 branches
BranchTrueFalseTotal
if ($File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i) 0 0 0
if ($File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i) 1 0 1
Condition0%0/6
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i
!ll&&!rl&&r
000
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i
!ll&&!rl&&r
000
MC/DC0%0/3
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i
$File::Find::name =~ /tc.pl\s*$/ $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i $File::Find::name =~ /$SvrTCNamePattern/i
Truth table0%0/4
A and B and C
A= $File::Find::name =~ /tc.pl\s*$/B= $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]iC= $File::Find::name =~ /$SvrTCNamePattern/i
ABCresult
0XX0
10X0
1100
1111
243 {
244 0 $tcIdCtr++;
245 0 my $eachTC = &getRoot($File::Find::name);
246 0 $SvrTCName = &getDir ($File::Find::name);
247 0 $eachTC = &getRoot($eachTC);
248 0 ▶ if (-e "$SvrTCName/_tafGlobalVars.txt") { &readTAFTCVars();} # TC Global Variables will overwrite TAF Global Variables
Branch: 2 branches
BranchTrueFalseTotal
if (-e "$SvrTCName/_tafGlobalVars.txt") 0 0 0
if (-e "$SvrTCName/_tafGlobalVars.txt") 0 1 1
249 0 ▶ &getWeb_($eachTC) =~ /scrollAmount\s*=\s*(\d+)/; $scrollAmount = $1; if ($scrollAmount) {;} else {$scrollAmount =0;}
Branch: 2 branches
BranchTrueFalseTotal
if ($scrollAmount) { } 0 0 0
if ($scrollAmount) { } 0 1 1
250 0 ▶ &getWeb_($eachTC) =~ /borderWidth\s*=\s*(\d+)/ ; $borderWidth = $1; if ($borderWidth) {;} else {$borderWidth=0;}
Branch: 2 branches
BranchTrueFalseTotal
if ($borderWidth) { } 0 0 0
if ($borderWidth) { } 0 1 1
251 0 ▶ &getWeb_($eachTC) =~ /borderStyle\s*=\s*(.+)/ ; $borderStyle = $1; if ($borderStyle) {;} else {$borderStyle=0;}
Branch: 1 branch
BranchTrueFalseTotal
if ($borderStyle) { } 0 0 0
252  
253  
254 0 ▶ if ( ($tcOp !~ /^\s*$/)&&($SvrTCName =~/$SvrTCNameExecPattern/)&&($tcIdCtr >= $tcIdMin)
Branch: 1 branch
BranchTrueFalseTotal
if (not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, 'value') =~ /$tcPropertyPatternPattern/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, 'value') =~ /$tcPropertyPatternPattern1/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName2, 'value') =~ /$tcPropertyPatternPattern2/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName3, 'value') =~ /$tcPropertyPatternPattern3/i) { } 0 0 0
Condition0%0/18
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName2, "value") =~ /$tcPropertyPatternPattern2/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName3, "value") =~ /$tcPropertyPatternPattern3/i
!ll&&!rl&&r
000
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName2, "value") =~ /$tcPropertyPatternPattern2/i
!ll&&!rl&&r
000
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/i
!ll&&!rl&&r
000
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i
!ll&&!rl&&r
000
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin
!ll&&!rl&&r
000
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/
!ll&&!rl&&r
000
MC/DC0%0/7
not $tcOp =~ /^\s*$/ and $SvrTCName =~ /$SvrTCNameExecPattern/ and $tcIdCtr >= $tcIdMin and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName2, "value") =~ /$tcPropertyPatternPattern2/i and &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName3, "value") =~ /$tcPropertyPatternPattern3/i
not $tcOp =~ /^\s*$/ $SvrTCName =~ /$SvrTCNameExecPattern/ $tcIdCtr >= $tcIdMin &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/i &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName2, "value") =~ /$tcPropertyPatternPattern2/i &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName3, "value") =~ /$tcPropertyPatternPattern3/i
Truth table0%0/8
not(A) and B and C and D and E and F and G
A= not $tcOp =~ /^\s*$/B= $SvrTCName =~ /$SvrTCNameExecPattern/C= $tcIdCtr >= $tcIdMinD= &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/iE= &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/iF= &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName2, "value") =~ /$tcPropertyPatternPattern2/iG= &getProperties(&getTCName($SvrTCName), $tcPropertyPatternName3, "value") =~ /$tcPropertyPatternPattern3/i
ABCDEFGresult
0XXXXXX0
10XXXXX0
110XXXX0
1110XXX0
11110XX0
111110X0
11111100
11111111
255 && (&getProperties(&getTCName($SvrTCName) , $tcPropertyPatternName, "value") =~ /$tcPropertyPatternPattern/i)
256 && (&getProperties(&getTCName($SvrTCName) , $tcPropertyPatternName1, "value") =~ /$tcPropertyPatternPattern1/i)
257 && (&getProperties(&getTCName($SvrTCName) , $tcPropertyPatternName2, "value") =~ /$tcPropertyPatternPattern2/i)
258 && (&getProperties(&getTCName($SvrTCName) , $tcPropertyPatternName3, "value") =~ /$tcPropertyPatternPattern3/i)
259 ) { # Property/testcaseExec Filter
260 0 ▶ if ($propertyOp) { # Property Processor
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOp) 0 0 0
261 ##################### Property OPeration Start ####################
262 0 ▶ if ($propertyOp =~ /tcDescAuto/) { # add tcDesc when generateTestsuite
Branch: 2 branches
BranchTrueFalseTotal
if ($propertyOp =~ /tcDescAuto/) { } 0 0 0
elsif ($propertyOp =~ /_doit_/i or $propertyOp =~ /^\s*_?get_/i or $propertyOp =~ /^\s*_?list_/i) { } 0 0 0
263 0 my $tcDescAuto="";
264 0 ▶ if ($#tcDesc eq 0 ) {;} else { $tcDescAuto = "add=tcDesc:".shift @tcDesc; }
Branch: 1 branch
BranchTrueFalseTotal
if ($#tcDesc eq 0) { } 0 0 0
265 0 my $tcDescAuto_ = $tcDescAuto; $tcDescAuto =~ s/_space_/ /g; $tcDescAuto =~ s/_column_/:/g; $tcDescAuto =~ s/_eq_/=/g;
266 0 printf "%-20s %s %s\n", "processProperty:", &getTCName($File::Find::name),$tcDescAuto;
267 0 &processProperty("",&getTCName($File::Find::name), $tcDescAuto_);
268 ▶ } elsif (($propertyOp =~ /_doit_/i) || ($propertyOp =~ /^\s*_?get_/i) || ($propertyOp =~ /^\s*_?list_/i)) { # property Operation (_doit_)
Condition0%0/6
$propertyOp =~ /_doit_/i or $propertyOp =~ /^\s*_?get_/i or $propertyOp =~ /^\s*_?list_/i
l!l&&r!l&&!r
000
$propertyOp =~ /_doit_/i or $propertyOp =~ /^\s*_?get_/i
l!l&&r!l&&!r
000
MC/DC0%0/3
$propertyOp =~ /_doit_/i or $propertyOp =~ /^\s*_?get_/i or $propertyOp =~ /^\s*_?list_/i
$propertyOp =~ /_doit_/i $propertyOp =~ /^\s*_?get_/i $propertyOp =~ /^\s*_?list_/i
Truth table0%0/4
A or B or C
A= $propertyOp =~ /_doit_/iB= $propertyOp =~ /^\s*_?get_/iC= $propertyOp =~ /^\s*_?list_/i
ABCresult
1XX1
01X1
0011
0000
269 0 my $propertyOp_ = $propertyOp;
270 0 $propertyOp_ =~ s/_doit_//g;
271 0 my $rst = &processProperty("",&getTCName($File::Find::name), $propertyOp_);
272 0 my $File_Find_name = $File::Find::name; $File_Find_name =~ s/\/$tc_pl//g;
273 0 ▶ if ($rst =~ /\n/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rst =~ /\n/) { } 0 0 0
274 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'."_$propertyOp_.txt","$File_Find_name\t$propertyOp_=\n$rst\n") ;
275 } else {
276 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'."_$propertyOp_.txt","$File_Find_name\t$propertyOp_=$rst\n") ;
277 }
278 } else {
279 0 print "[TS/TC=$File::Find::name] propertyOp=$propertyOp _doit_\n"; # property Operation (print it)
280 }
281 ##################### Property OPeration End ####################
282 } # else
283 0 ▶ if (($propertyOp =~ /tcDescAuto/i) || ($propertyOp =~ /^\s*$/)) { # TC Exec Processor
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOp =~ /tcDescAuto/i or $propertyOp =~ /^\s*$/) 0 0 0
Condition0%0/3
$propertyOp =~ /tcDescAuto/i or $propertyOp =~ /^\s*$/
l!l&&r!l&&!r
000
MC/DC0%0/2
$propertyOp =~ /tcDescAuto/i or $propertyOp =~ /^\s*$/
$propertyOp =~ /tcDescAuto/i $propertyOp =~ /^\s*$/
Truth table0%0/3
A or B
A= $propertyOp =~ /tcDescAuto/iB= $propertyOp =~ /^\s*$/
ABresult
1X1
011
000
284 ##################### TC Operation Start ######################
285 0 ▶ if ($scrollAmount ==0 and $borderWidth ==0) { # TC Execution
Branch: 2 branches
BranchTrueFalseTotal
if ($scrollAmount == 0 and $borderWidth == 0) { } 0 0 0
elsif ($scrollAmount != 0) { } 0 0 0
Condition0%0/3
$scrollAmount == 0 and $borderWidth == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$scrollAmount == 0 and $borderWidth == 0
$scrollAmount == 0 $borderWidth == 0
Truth table0%0/3
A and B
A= $scrollAmount == 0B= $borderWidth == 0
ABresult
0X0
100
111
286 0 ▶ my $scrollAmount_ = 1 ; if ($tcOp =~ /list/) { $scrollAmount_ = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tcOp =~ /list/) 0 0 0
287 0 ▶ if ($tcOp =~ /exec/i) { &updateWeb_(&getDir($File::Find::name),$scrollAmount_, $borderWidth, "SOLID", $ExecutionType); &generateRootIndex () ; } # update RootIndex
Branch: 1 branch
BranchTrueFalseTotal
if ($tcOp =~ /exec/i) 0 0 0
288 0 $returnValue = $returnValue. &processTC("","$tcOp=$eachTC",$pr2Screen)."\n";
289 0 &logTC($eachTC); # TC Logging -> tesesuite\testcase\_tcLog.html
290 0 ▶ if ($performanceMode =~ /slow4WebUI/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($performanceMode =~ /slow4WebUI/i) 0 0 0
291 0 &reportTCHistory($eachTC); # TC ReporHistory -> testsuite\_tcReportHistory_.html
292 0 &reportTCSummary ();
293 0 &updateTestsuitePassFail () ;
294 0 &Queue("updateQueue");
295 }
296 0 &updateWeb_(&getDir($File::Find::name),0, $borderWidth, "SOLID");
297 0 ▶ if (($tcOp !~ /list/) && ($tcOp !~ /mark/)) { sleep $sleep4Display;}
Branch: 1 branch
BranchTrueFalseTotal
unless ($tcOp =~ /list/ or $tcOp =~ /mark/) 0 0 0
Condition0%0/3
$tcOp =~ /list/ or $tcOp =~ /mark/
l!l&&r!l&&!r
000
MC/DC0%0/2
$tcOp =~ /list/ or $tcOp =~ /mark/
$tcOp =~ /list/ $tcOp =~ /mark/
Truth table0%0/3
A or B
A= $tcOp =~ /list/B= $tcOp =~ /mark/
ABresult
1X1
011
000
298 } elsif ( $scrollAmount != 0 ) { # Handle different TC exec state - handle concurrency
299 0 ▶ if (($scrollAmount != 0 and $borderWidth== 0 )) { $borderWidth = 1; $borderStyle = "DOTTED"; }
Branch: 3 branches
BranchTrueFalseTotal
if ($scrollAmount != 0 and $borderWidth == 0) { } 0 0 0
elsif ($scrollAmount != 0 and $borderStyle =~ /DOTTED/i) { } 0 0 0
elsif ($scrollAmount != 0 and $borderStyle =~ /SOLID/i) { } 0 0 0
Condition0%0/3
$scrollAmount != 0 and $borderWidth == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$scrollAmount != 0 and $borderWidth == 0
$scrollAmount != 0 $borderWidth == 0
Truth table0%0/3
A and B
A= $scrollAmount != 0B= $borderWidth == 0
ABresult
0X0
100
111
300 0 ▶ elsif (($scrollAmount != 0 and $borderStyle =~ /DOTTED/i)) {$borderWidth =1; $borderStyle = "SOLID"; }
Condition0%0/3
$scrollAmount != 0 and $borderStyle =~ /DOTTED/i
!ll&&!rl&&r
000
MC/DC0%0/2
$scrollAmount != 0 and $borderStyle =~ /DOTTED/i
$scrollAmount != 0 $borderStyle =~ /DOTTED/i
Truth table0%0/3
A and B
A= $scrollAmount != 0B= $borderStyle =~ /DOTTED/i
ABresult
0X0
100
111
301 0 ▶ elsif (($scrollAmount != 0 and $borderStyle =~ /SOLID/i)) {$scrollAmount=0; $borderWidth =0; $borderStyle = "SOLID"; }
Condition0%0/3
$scrollAmount != 0 and $borderStyle =~ /SOLID/i
!ll&&!rl&&r
000
MC/DC0%0/2
$scrollAmount != 0 and $borderStyle =~ /SOLID/i
$scrollAmount != 0 $borderStyle =~ /SOLID/i
Truth table0%0/3
A and B
A= $scrollAmount != 0B= $borderStyle =~ /SOLID/i
ABresult
0X0
100
111
302 0 &logTC($eachTC); # TC Logging -> tesesuite\testcase\_tcLog.html
303 0 ▶ if ($performanceMode =~ /slow4WebUI/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($performanceMode =~ /slow4WebUI/i) 0 0 0
304 #### &reportTCHistory($eachTC); # TC ReporHistory -> testsuite\_tcReportHistory_.html
305 0 &reportTCSummary ();
306 0 &updateWeb_(&getDir($File::Find::name),$scrollAmount, $borderWidth, $borderStyle);
307 }
308 } ##################### TC Operation End ######################
309 0 ▶ if ((&getExitTAFGracefullyLock() eq &getRoot_2($File::Find::name)) || (&getExitTAFGracefullyLock() eq "exitTAF" ) ) { print "TAF exited gracefully\n"; &tcPost(); &releaseExitTAFGracefullyLock(); exit; }
Branch: 1 branch
BranchTrueFalseTotal
if (&getExitTAFGracefullyLock() eq &getRoot_2($File::Find::name) or &getExitTAFGracefullyLock() eq "exitTAF") 0 0 0
Condition0%0/3
&getExitTAFGracefullyLock() eq &getRoot_2($File::Find::name) or &getExitTAFGracefullyLock() eq "exitTAF"
l!l&&r!l&&!r
000
MC/DC0%0/2
&getExitTAFGracefullyLock() eq &getRoot_2($File::Find::name) or &getExitTAFGracefullyLock() eq "exitTAF"
&getExitTAFGracefullyLock() eq &getRoot_2($File::Find::name) &getExitTAFGracefullyLock() eq "exitTAF"
Truth table0%0/3
A or B
A= &getExitTAFGracefullyLock() eq &getRoot_2($File::Find::name)B= &getExitTAFGracefullyLock() eq "exitTAF"
ABresult
1X1
011
000
310 # &generateRootIndex () ;
311 }
312 } else { # to handle no-run execution add to ts/tc/thProperty.txt
313 0 &dumyTC_ ();
314 }
315  
316 0 $scrollAmount = 0; $borderWidth = 0; $borderStyle = "SOLID";
317 #} # Property Filter # Passing $scrollAmount, $borderWidth, $borderStyle,
318 } # TC Filter
319 }
320 sub tcPost {
321 ##################### Post PRocessor ###################
322 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName ) { # fix 2013/04/13
Subroutine tcPost: not called CC=2 SCAR=10.5
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName) 0 0 0
323 0 &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"") ;
324 0 &reportTCHistory("null"); # TC ReporHistory -> testsuite\_tcReportHistory_.html
325 0 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"<html><body><pre>\n") ;
326 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"</pre></body></html>\n") ;
327 0 &mergeFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1) ;
328 0 &mergeFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http) ;
329 0 &prHtml1() ;
330 0 &appendtoFileFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml) ;
331 0 &appendtoFileFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http);
332 0 &prHtml2() ;
333 0 &reportTCSummary ();
334 0 &generateRootIndex () ;
335 0 &updateTestsuiteHTA () ;
336 0 &updateTestsuitePassFail() ;
337 0 $AutomationtsName = "$SvrProjName";
338 0 &generateExcelReport () ;
339 0 &sortCmdLog();
340 }
341 0 sleep $outputPause;
342 ########################################################
343 }
344  
345 0 ▶sub printVersion { printf "%s\n",$VERSION ; }
Subroutine printVersion: not called CC=1 SCAR=6.9
Pod undocumented
346 0 ▶sub printTAFVersion { printf "%s\n",$VERSION ; }
Subroutine printTAFVersion: not called CC=1 SCAR=6.9
Pod undocumented
347 0 ▶sub printOSVersion { printf "%s\n",$^O; }
Subroutine printOSVersion: not called CC=1 SCAR=6.9
Pod undocumented
348  
349 0 ▶sub heartBeat { print "This is heartBeat\n";}
Subroutine heartBeat: not called CC=1 SCAR=6.9
Pod undocumented
350 # sub heartBeat { goto &fetchmail}
351  
352 sub fetchmail { # this is window version
353 0 ▶my $WinUser = "w"; # window user name is the cygwin user name
Subroutine fetchmail: not called CC=4 SCAR=25.9
Pod undocumented
354 0 my $gmail = "wripcity\@gmail.com"; # gmail address
355 0 my $GmailPassword = "beaverton"; # gmail password
356  
357 0 ▶my $tcId = 1; $tcId = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
358 0 my $fetchMailDate ="";
359  
360 0 my $fetchMailChmodFName = "c:/cygwin/home/$WinUser/fetchmailChmod.bat" ;
361 0 my $fetchMailBATFName = "c:/cygwin/home/$WinUser/fetchmail.bat" ;
362 0 my $fetchMailRCFName = "c:/cygwin/home/$WinUser/.fetchmailrc" ;
363  
364 0 my $str="poll pop.gmail.com with proto POP3 and options no dns user '$gmail' there with password '$GmailPassword' is '$WinUser' here options ssl";
365 0 mkpath "c:/cygwin/home/$WinUser";
366 0 open Fout, ">$fetchMailRCFName"; print Fout $str; close Fout; #print " -> $fetchMailRCFName\n";
367  
368 0 $str="/usr/bin/fetchmail.exe -vk";
369 0 open Fout, ">$fetchMailBATFName"; print Fout $str; close Fout; # print " -> $fetchMailBATFName\n";
370  
371 0 $str= "chmod 0600 /home/$WinUser/.fetchmailrc";
372 0 open Fout, ">$fetchMailChmodFName"; print Fout $str; close Fout; # print " -> $fetchMailChmodFName\n";
373  
374  
375 0 my $cmd = 'c:\cygwin\bin\bash.exe -l /home/'.$WinUser.'/fetchmailChmod.bat'; my $rst = `$cmd 2>&1`;
376 0 $cmd = 'c:\cygwin\bin\bash.exe -l /home/'.$WinUser.'/fetchmail.bat'; $rst = `$cmd 2>&1`;
377 0 ▶ foreach my $each (split /\n/, $rst) { if ($each =~ /protocol POP3\) at\s*(.+): poll completed/) { $fetchMailDate = $1; } }
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /protocol POP3\) at\s*(.+): poll completed/) 0 0 0
378 0 copy ('c:/cygwin/var/spool/mail/'.$WinUser, 'c:/_TAF/_gmail_.txt');
379 0 $rst = "log is skipped\n";
380 0 return "---------- Start ".(caller(0))[3]."-----------\n$cmd\n".$rst."---------- End ". (caller(0))[3]. "-----------\n";
381 }
382
383  
384 sub getTAFArgsFromFile {
385 0 ▶ my $fname = "$c/$_TAF/_tafArgs.txt";
Subroutine getTAFArgsFromFile: not called CC=3 SCAR=24.8
Pod undocumented
386 0 my $return="";
387 0 ▶ if (-e $fname) { open Fin, $fname; while ($_ =<Fin>) { chop; $return .=";$_"; } close Fin; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname) 0 0 0
if (defined($_ = readline Fin)) 0 0 0
388 0 $return =~ s/^\s*;+//g; $return =~ s/;+/;/g;
389 0 $return =~ s/\s*//g;
390 0 unlink $fname;
391 0 return $return;
392 }
393 sub markDaily {
394 0 ▶ if ((($makeMarkLastDay < &getExecDay()) && ($makeMark =~ /n/)) or (($tcCtr)%($tcDelta)== 0)) {
Subroutine markDaily: not called CC=4 SCAR=30.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($makeMarkLastDay < &getExecDay() and $makeMark =~ /n/ or $tcCtr % $tcDelta == 0) { } 0 0 0
Condition0%0/6
$makeMarkLastDay < &getExecDay() and $makeMark =~ /n/ or $tcCtr % $tcDelta == 0
l!l&&r!l&&!r
000
$makeMarkLastDay < &getExecDay() and $makeMark =~ /n/
!ll&&!rl&&r
000
MC/DC0%0/3
$makeMarkLastDay < &getExecDay() and $makeMark =~ /n/ or $tcCtr % $tcDelta == 0
$makeMarkLastDay < &getExecDay() $makeMark =~ /n/ $tcCtr % $tcDelta == 0
Truth table0%0/5
A and B or C
A= $makeMarkLastDay < &getExecDay()B= $makeMark =~ /n/C= $tcCtr % $tcDelta == 0
ABCresult
11X1
0X11
1011
0X00
1000
395 0 $makeMarkLastDay = &getExecDay(); $makeMark = 'y';
396 } else {
397 0 $makeMark = 'n';
398 }
399 0 $tcCtr++;
400 }
401  
402 sub getExecDay {
403 1 ▶ my $initStartTime = &UnixDate( "Jan 1, 2012", "%m/%d/%Y %H:%M:%S %Z" );
Subroutine getExecDay: called CC=1 SCAR=0.0
Pod undocumented
404 1 my $endStartTime = &UnixDate( "now" , "%m/%d/%Y %H:%M:%S %Z" );
405 1 my $totalTimeSpan = &DateCalc(&ParseDate($initStartTime),&ParseDate($endStartTime)); #### => YY:MM:WK:DD:HH:MM:SS the years, months, etc. between the two
406 1 my ($Y,$M,$W,$D,$H,$MIN,$S) = split /:/, $totalTimeSpan;
407 1 my $makeMarkLastDay_Local = int ($H/24);
408 1 return $makeMarkLastDay_Local;
409 }
410  
411 0 ▶sub generateTAFVars {goto &printTAFGlobalVars}
Subroutine generateTAFVars: not called CC=1 SCAR=6.9
Pod undocumented
412 0 ▶sub generateTAFTSVars {goto &printTAFTSVars}
Subroutine generateTAFTSVars: not called CC=1 SCAR=6.9
Pod undocumented
413 0 ▶sub generateTAFTCVars {goto &printTAFTCVars}
Subroutine generateTAFTCVars: not called CC=1 SCAR=6.9
Pod undocumented
414  
415 1 ▶sub printTAFGlobalVars { if (-e "$c/$_TAF/_tafGlobalVars.txt") {;} else {mkpath "$c/$_TAF" ;} ; open Fout, ">$c/$_TAF/_tafGlobalVars.txt" ; print Fout &printGlobalVars() ; close Fout; print " -> $c/$_TAF/_tafGlobalVars.txt\n"; }
Subroutine printTAFGlobalVars: called CC=2 SCAR=7.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/_tafGlobalVars.txt") { } 0 1 1
416 0 ▶sub printTAFTSVars { if (-e "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt") {;} else {mkpath "$c/$_TAF/$SvrProjName" ;} ; open Fout, ">$c/$_TAF/$SvrProjName/_tafGlobalVars.txt" ; print Fout &printTSGlobalVars(); close Fout; print " -> $c/$_TAF/$SvrProjName/_tafGlobalVars.txt\n"; }
Subroutine printTAFTSVars: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt") { } 0 0 0
417 0 ▶sub printTAFTCVars { if (-e "$c/$_TAF/$SvrProjName/$SvrTCNamePattern/_tafGlobalVars.txt") {;} else {mkpath "$c/$_TAF/$SvrProjName/$SvrTCNamePattern" ;} ; open Fout, ">$c/$_TAF/$SvrProjName/$SvrTCNamePattern/_tafGlobalVars.txt" ; print Fout &printTCGlobalVars(); close Fout; print " -> $c/$_TAF/$SvrProjName/$SvrTCNamePattern/_tafGlobalVars.txt\n"; }
Subroutine printTAFTCVars: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/$SvrProjName/$SvrTCNamePattern/_tafGlobalVars.txt") { } 0 0 0
418  
419 0 ▶sub updateTAFGlobalVars { my $str = "testcaseNode =$testcaseNode\n"; $str = shift if @_;
Subroutine updateTAFGlobalVars: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
420  
421 0 ▶ if (-e "$c/$_TAF/_tafGlobalVars.txt") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/_tafGlobalVars.txt") { } 0 0 0
422 0 open Fout, ">>$c/$_TAF/_tafGlobalVars.txt" ; print Fout $str ; close Fout; print " ->> $c/$_TAF/_tafGlobalVars.txt\n";
423 0 } else { print "updateTAFGlobalVars: $c:/$_TAF/_tafGlobalVars.txt does *NOT* exist\n"; }
424
425 }
426  
427 0 ▶sub updateTAFTSVars { my $str="Execution_24_7_title =n\nExecution_local_only =y\n"; $str = shift if @_;
Subroutine updateTAFTSVars: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
428 0 my $SvrProjName_ = $SvrProjName; $SvrProjName_ =~ s/$c\///; $SvrProjName_ =~ s/^\///g;
429 0 ▶ if (-e "$c/$_TAF/$SvrProjName_/_tafGlobalVars.txt") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/$SvrProjName_/_tafGlobalVars.txt") { } 0 0 0
430 0 open Fout, ">>$c/$_TAF/$SvrProjName_/_tafGlobalVars.txt"; print Fout $str; close Fout; print " ->> $c/$_TAF/$SvrProjName_/_tafGlobalVars.txt\n";
431 } else {
432 0 print "updateTAFTSVars: $c/$_TAF/$SvrProjName_/_tafGlobalVars.txt does *NOT* exist. - Created\n";
433 0 mkpath("$c/$_TAF/$SvrProjName_");
434 0 open Fout, ">$c/$_TAF/$SvrProjName_/_tafGlobalVars.txt"; print Fout $str; close Fout; print " -> $c/$_TAF/$SvrProjName_/_tafGlobalVars.txt\n";
435 }
436 }
437  
438 0 ▶sub updateTAFTCVars { my $str="Execution_24_7_title =n\nExecution_local_only =y\n"; $str = shift if @_;
Subroutine updateTAFTCVars: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
439 0 my $SvrProjName_ = $SvrProjName; $SvrProjName_ =~ s/$c\///; $SvrProjName_ =~ s/^\///g;
440 0 ▶ if (-e "$c/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt") { } 0 0 0
441 0 open Fout, ">>$c/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt"; print Fout $str; close Fout; print " ->> $c/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt\n";
442 } else {
443 0 print "updateTAFTCVars: $c:/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt does *NOT* exist. - created\n";
444 0 mkpath("$c/$_TAF/$SvrProjName_");
445 0 open Fout, ">$c/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt"; print Fout $str; close Fout; print " -> $c/$_TAF/$SvrProjName_/$SvrTCNamePattern/_tafGlobalVars.txt\n";
446
447 }
448 }
449  
450  
451 0 ▶sub clearTAFGlobalVars { unlink "$c/$_TAF/_tafGlobalVars.txt" ; print " -rm-> $c/$_TAF/_tafGlobalVars.txt\n"; }
Subroutine clearTAFGlobalVars: not called CC=1 SCAR=6.9
Pod undocumented
452 0 ▶sub clearTAFTSVars { unlink "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt" ; print " -rm-> $c/$_TAF/$SvrProjName/_tafGlobalVars.txt"; }
Subroutine clearTAFTSVars: not called CC=1 SCAR=6.9
Pod undocumented
453 0 ▶sub clearTAFTCVars { unlink "$c/$_TAF/$SvrProjName/$SvrTCNamePattern/_tafGlobalVars.txt"; print " -rm-> $c/$_TAF/$SvrProjName/$SvrTCNamePattern/_tafGlobalVars.txt\n"; }
Subroutine clearTAFTCVars: not called CC=1 SCAR=6.9
Pod undocumented
454 ####################### remove duplicate records in file
455 sub removeDuplicate {
456 0 ▶ my $fname = shift;
Subroutine removeDuplicate: not called CC=6 SCAR=37.4
Pod undocumented
457 0 ▶ if ($fname ) {;} else { print "remvoeDuplicate: needs filename\n"; exit; }
Branch: 1 branch
BranchTrueFalseTotal
if ($fname) { } 0 0 0
458 0 ▶ if (-e $fname ) {;} else { print "remvoeDuplicate: $fname doesn't exist\n"; exit; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) { } 0 0 0
459 0 my $fname_tmp = $fname."_.htm";
460 0 open FILE , $fname;
461 0 open FILE_tmp , "> $fname_tmp";
462 0 my $firstOccurence = "_firstOccurence_";
463 0 ▶while ($_ = <FILE>) { if (($firstOccurence !~ /^_firstOccurence_$/) and ($_ ne $firstOccurence)) { print FILE_tmp $_; $firstOccurence = $_; } }
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline FILE)) 0 0 0
if (not $firstOccurence =~ /^_firstOccurence_$/ and $_ ne $firstOccurence) 0 0 0
Condition0%0/3
not $firstOccurence =~ /^_firstOccurence_$/ and $_ ne $firstOccurence
!ll&&!rl&&r
000
MC/DC0%0/2
not $firstOccurence =~ /^_firstOccurence_$/ and $_ ne $firstOccurence
not $firstOccurence =~ /^_firstOccurence_$/ $_ ne $firstOccurence
Truth table0%0/3
not(A) and B
A= not $firstOccurence =~ /^_firstOccurence_$/B= $_ ne $firstOccurence
ABresult
0X0
100
111
464 0 close FILE;
465 0 close FILE_tmp;
466 0 copy ($fname_tmp, $fname);
467 }
468  
469 ####################### copy Testsuite
470 0 ▶sub copyTestsuite { shift; print "$copy $tsFrom -> $tsTo\n"; rcopy ($tsFrom, $tsTo) or die $!; 1;}
Subroutine copyTestsuite: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
rcopy($tsFrom, $tsTo) or die $! 0 0 0
471 0 ▶sub copyTS { shift; print "$copy $tsFrom -> $tsTo\n";
Subroutine copyTS: not called CC=4 SCAR=30.0
Pod undocumented
472 0 ▶ if (-e $tsFrom) {;} else { print "Warning: $tsFrom doesn't exist. It is created.\n"; mkdir $tsFrom; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tsFrom) { } 0 0 0
473 0 ▶ if (-e $tsTo ) {;} else { print "Warning: $tsTo doesn't exist. It is created.\n"; mkdir $tsTo ; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tsTo) { } 0 0 0
474 0 ▶ rcopy ($tsFrom, $tsTo) or die $!; return 1;}
Branch: 1 branch
BranchTrueFalseTotal
rcopy($tsFrom, $tsTo) or die $! 0 0 0
475 ############
476  
477 0 ▶sub generatePropertyTestsuite {goto &generateTestsuiteByDesc}
Subroutine generatePropertyTestsuite: not called CC=1 SCAR=6.9
Pod undocumented
478 sub generateTestsuiteBasedOnProperty{
479 0 ▶$SvrProjName =~ s/\\/\//g;
Subroutine generateTestsuiteBasedOnProperty: not called CC=1 SCAR=6.9
Pod undocumented
480 0 &tcMain_1();
481 0 1;
482 }
483 #######################generate Property TCs from desc
484  
485 0 ▶sub generateTestsuiteByDesc { $SvrProjName =~ s/\\/\//g; &tcMain_1(); 1; }
Subroutine generateTestsuiteByDesc: not called CC=1 SCAR=6.9
Pod undocumented
486 sub tcMain_1 {
487 0 ▶ print " Scanning for testsuites at $SvrProjName ......\n";
Subroutine tcMain_1: not called CC=1 SCAR=6.9
Pod undocumented
488 0 ▶ find({preprocess=> sub {return reverse sort @_;}, wanted=> \&recursiveSearchtcMain_1}, $SvrProjName); # print " [fyi: -> $generateTestsuiteBAT]\n";
Subroutine __ANON__: not called CC=1 SCAR=6.9
489 0 1;
490 }
491 sub recursiveSearchtcMain_1() {
492 0 ▶ if (($File::Find::name =~ /\/$TSHookName\s*$/) && ($tcPropertyName !~ /_all_/i)) # bug 04/26/2013
Subroutine recursiveSearchtcMain_1: not called CC=4 SCAR=30.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ m[/$TSHookName\s*$] and not $tcPropertyName =~ /_all_/i) 0 0 0
Condition0%0/3
$File::Find::name =~ m[/$TSHookName\s*$] and not $tcPropertyName =~ /_all_/i
!ll&&!rl&&r
000
MC/DC0%0/2
$File::Find::name =~ m[/$TSHookName\s*$] and not $tcPropertyName =~ /_all_/i
$File::Find::name =~ m[/$TSHookName\s*$] not $tcPropertyName =~ /_all_/i
Truth table0%0/3
A and not(B)
A= $File::Find::name =~ m[/$TSHookName\s*$]B= not $tcPropertyName =~ /_all_/i
ABresult
0X0
100
111
493 {
494 0 &readTCDesc($File::Find::name);
495 0 $tcPropertyPattern->add($tcPropertyName );
496 0 my @property = split ("\/", $File::Find::name) ;
497 0 my $tags_ = $tags; $tags_ =~ s/,/\|/g; $tags_ = "($tags_)";
498 0 ▶ if ($property[$#property -1] =~ /$tags_/ ) {;} #### stop recursivly creating property test suite
Branch: 1 branch
BranchTrueFalseTotal
if ($property[$#property - 1] =~ /$tags_/) { } 0 0 0
499 else {
500 0 &generateTS ($File::Find::name, $tcPropertyName);
501 }
502 }
503 }
504  
505  
506 sub generateTestsuiteAgain {
507 0 ▶my $SvrProjName_ = $SvrProjName; $SvrProjName = "$c\\$_TAF"; $SvrProjName =~ s/\\/\//g; # linux todo
Subroutine generateTestsuiteAgain: not called CC=1 SCAR=6.9
Pod undocumented
508 0 &tcMain_2();
509 0 $SvrProjName=$SvrProjName_; $SvrProjName =~ s/\\/\//g; &readTAFProperty(); &generateRootIndex("exit");
510 0 1;
511 }
512  
513 sub tcMain_2 {
514 0 ▶ print " Scanning for testsuites at $SvrProjName ......\n";
Subroutine tcMain_2: not called CC=1 SCAR=6.9
Pod undocumented
515 0 ▶ find({preprocess=> sub {return reverse sort @_;}, wanted=>\&recursiveSearchtcMain_2}, $SvrProjName); print " [fyi: -> $generateTestsuiteBAT]\n";
Subroutine __ANON__: not called CC=1 SCAR=6.9
516 0 1;
517 }
518 sub recursiveSearchtcMain_2() {
519 0 ▶ if (($File::Find::name =~ /$reportHtml\s*$/))
Subroutine recursiveSearchtcMain_2: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /$reportHtml\s*$/) 0 0 0
520 {
521 0 my $cmd = $File::Find::name;
522 0 $cmd =~ s/\/?$reportHtml//;
523 0 $cmd =~ s/$c\/$_TAF//;
524 0 $cmd =~ s/^\s*\///;
525 0 ▶ if ($cmd) { $cmd = "testsuite=$cmd;performanceMode=fast;list";
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd) 0 0 0
526 0 $passFailDisplayWidth = 8; # TS Variable. Should be reset for each TS execution
527 0 &processTCs("", $cmd);
528
529 }
530 }
531 }
532  
533 sub generateTestsuiteScript {
534 0 ▶ my $testsuite; # ="c:/_CRB_/AppBuildpath/_automated_testsuites_/_testsuite_pl";
Subroutine generateTestsuiteScript: not called CC=2 SCAR=17.9
Pod undocumented
535 0 $testsuite = $SvrProjName; my $testsuiteTAF = $SvrProjName; $testsuiteTAF =~ s/c://g; # here
536 0 foreach my $each (split /,/, $tags) {
537 0 print <<EOF;
538 REM $c/$_TAF/taf.pl -processTSs create=$testsuite rem create Tag TS
539 $c/$_TAF/taf.pl tcPropertyName=$each;testsuite=$testsuite;generateTestsuiteByDesc rem create Tag TS
540 $c/$_TAF/taf.pl testsuite=$testsuite/$each;generateTestsuite rem create TAF-tag TS
541 $c/$_TAF/taf.pl testsuite=$testsuite;testcaseNode=testcase;generateTestsuite rem create TAF TS
542 $c/$_TAF/taf.pl testsuite=$testsuiteTAF;testcaseNode=testcase;list
543  
544 EOF
545 ;
546 }
547  
548 }
549 sub generateTS {
550 0 ▶ my $str;
Subroutine generateTS: not called CC=10 SCAR=47.0
Pod undocumented
551 0 ▶ my $tsHook = "index.pl" ; $tsHook = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
552 0 ▶ my $tcPropertyNameLocal = "_smoketest_" ; $tcPropertyNameLocal = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
553 0 my $tsDir = $tsHook ; $tsDir =~ s/(\/$TSHookName\s*$)//g ;
554 0 my $tsHookChild = "$tsDir/${tcPropertyName}/$TSHookNameGenerated" ; # c:\_TAF
555 0 my $tsDirChild = "$tsDir/$tcPropertyNameLocal" ; # c:\...
556  
557 0 my $otherCmd = "$copy (\"$tsDir/_tcLogAppend.txt\", \"$tsDirChild/_tcLogAppend.txt\")";
558 0 $ps1_args =~ s/\\/\//g;
559
560 0 ▶ if ($tsHook =~ /\.ps1\s*$/) { $tsHook = "powershell -executionpolicy unrestricted -file $tsHook "; } # change1 # solve the ps1->pl cerversion bug
Branch: 1 branch
BranchTrueFalseTotal
if ($tsHook =~ /\.ps1\s*$/) 0 0 0
561  
562 0 my $perlCode=<<EOF_;
563 #!$perl_
564 use File::Copy;
565 if (\$ARGV[0]) {
566 #_cmd_holder_#
567 } else {
568 print \<\<EOF;
569 #_desc_holder_#
570 EOF
571 ;
572 }
573 EOF_
574 ;
575  
576 ############ TS - > subTS maping Table _tcMap.txt
577 0 my $ctr_local=1;
578 0 ▶ for (my $i = 1; $i <= $#tcDesc; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#tcDesc) 0 0 0
579 0 ▶ if ( $tcDesc[$i] =~ /($tcPropertyPattern)/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcDesc[$i] =~ /($tcPropertyPattern)/i) 0 0 0
580 0 my $tmp = sprintf ("$tsDir\/testcase%04d => $tsDirChild/testcase%04d", $i, $ctr_local);
581 0 &appendtoFileUniqly("$tsDir/_tcMap.txt", $tmp);
582 0 $ctr_local++;
583 }
584 }
585  
586 ########## read the Mapping to %_tcMap my %_tcMap; open Fin, "$tsDir/_tcMap.txt"; while ($_=<Fin>) { $_ =~ /(.+)=>(.+)/; $_tcMap{$2}=$1; } close Fin;
587  
588 0 $ctr_local=1;
589 0 ▶ for (my $i = 1; $i <= $#tcDesc; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#tcDesc) 0 0 0
590 0 ▶ if ( $tcDesc[$i] =~ /($tcPropertyPattern)/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcDesc[$i] =~ /($tcPropertyPattern)/i) 0 0 0
591 0 $tcDesc[$i] = &removeTags($tcDesc[$i]);
592 0 my $i_tmp = $i ;
593 0 my $tmpStr = "if (\$ARGV[0] == $ctr_local) { \$rst = \`$tsHook $i_tmp -ps1_args $ps1_args\` ; $otherCmd; print \$rst; } \n"; # change 2
594 0 $perlCode =~ s/#_cmd_holder_#/$tmpStr\t#_cmd_holder_#/;
595 0 $tmpStr = "$tcDesc[$i]\n"; # remove tcDesc Serial Number
596 0 $tmpStr =~ s/\\/\//g;
597 0 $perlCode =~ s/#_desc_holder_#/$tmpStr#_desc_holder_#/; $ctr_local++;
598 }
599 }
600 0 ▶ if ($ctr_local > 1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ctr_local > 1) 0 0 0
601  
602 0 ▶ if (-e $tsDirChild) {;} else { mkpath $tsDirChild;}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tsDirChild) { } 0 0 0
603 0 $perlCode =~ s/#_cmd_holder_#//g;
604 0 $perlCode =~ s/#_desc_holder_#//g;
605 0 open Fout , ">$tsHookChild"; print Fout $perlCode; close Fout; print " -> $tsHookChild\n";
606 }
607 }
608  
609 0 ▶sub tsTags {goto &readTCDesc}
Subroutine tsTags: not called CC=1 SCAR=6.9
Pod undocumented
610 sub readTCDesc {
611 0 ▶ my $cmd = shift; my $ctr = 1; my $tags="";
Subroutine readTCDesc: not called CC=6 SCAR=37.4
Pod undocumented
612 0 ▶ if ($cmd) {;} else { $cmd= "$SvrProjName/$TSHookName"; } # improvement 05/10/2013
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd) { } 0 0 0
613 0 $#tcDesc = -1;
614 0 ▶ if ($cmd =~ /\.ps1\s*$/) { $cmd = "powershell -executionpolicy unrestricted -file $cmd -ps1_args $ps1_args"; } # change 3
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /\.ps1\s*$/) { } 0 0 0
615 0 else { $cmd = "$perl_ $cmd "; } # change 3 # linux Bug: with -ps2 args, the index.pl return nothing
616
617 0 foreach my $each (split /\n/, `$cmd`) {
618 0 ▶ if ($each =~ /^\s*$/) {; }
Branch: 2 branches
BranchTrueFalseTotal
if ($each =~ /^\s*$/) { } 0 0 0
elsif ($each =~ /^\s*_test/) { } 0 0 0
619 elsif ($each =~ /^\s*_test/) { ; }
620 else {
621 #### $tcDesc[$ctr++] = $each; original before add _full_
622 0 $tcDesc[$ctr++] = $each." _full_"; # _full_ bug fix 05/12/2013 (see 6 line below)
623 # $tcDesc[$ctr++] = $each.", full,"; # _full_ bug fix 05/12/2013
624 0 $tags = $tags.",".&getTags($each);
625 }
626 }
627 # $tags = "$tags,full";
628 0 return &uniq($tags);
629 }
630  
631 sub getTags {
632 0 ▶ my $tags=""; my $str = shift; @_ = split (/_/, $str);
Subroutine getTags: not called CC=4 SCAR=30.0
Pod undocumented
633 0 ▶ foreach my $each (@_) { if (($str =~ /_${each}_\s*/) && ($each !~ /^\s*$/)) { $tags = $tags.','.$each; } }
Branch: 1 branch
BranchTrueFalseTotal
if ($str =~ /_${each}_\s*/ and not $each =~ /^\s*$/) 0 0 0
Condition0%0/3
$str =~ /_${each}_\s*/ and not $each =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
$str =~ /_${each}_\s*/ and not $each =~ /^\s*$/
$str =~ /_${each}_\s*/ not $each =~ /^\s*$/
Truth table0%0/3
A and not(B)
A= $str =~ /_${each}_\s*/B= not $each =~ /^\s*$/
ABresult
0X0
100
111
634 0 $tags =~ s/^\s*,//g;
635 0 $tags =~ s/,\s*$//g;
636 0 return $tags;
637 }
638  
639 sub uniq {
640 0 ▶ my $str = shift; my %record;
Subroutine uniq: not called CC=3 SCAR=24.8
Pod undocumented
641 0 @_ = split (/,/,$str);
642 0 foreach my $each (@_) { $record{$each} = $each; }
643 0 $str = "";
644 0 foreach my $each (sort keys %record) { $str = $str.",".$each; }
645 0 $str =~ s/^\s*,//g; $str =~ s/,\s*$//g; $str =~ s/^\s*,//g; $str =~ s/,\s*$//g; $str =~ s/^\s*,//g; $str =~ s/,\s*$//g;
646 0 $str =~ s/^\s*,//g; $str =~ s/,\s*$//g; $str =~ s/^\s*,//g; $str =~ s/,\s*$//g; $str =~ s/^\s*,//g; $str =~ s/,\s*$//g;
647 0 return $str;
648 }
649  
650 #######################generate Property TCs from desc
651 sub scanTestsuites { ######### generate index.htm
652 0 ▶ shift; my $doit="n"; my @dir;
Subroutine scanTestsuites: not called CC=8 SCAR=41.5
Pod undocumented
653 0 ▶ if ($tsFilter =~/_doit_/i) { $doit='y'; $tsFilter =~ s/_doit_//i;}
Branch: 3 branches
BranchTrueFalseTotal
if ($tsFilter =~ /_doit_/i) { } 0 0 0
elsif ($tsFilterDefault =~ /_doit_/i) { } 0 0 0
elsif ($SvrProjName =~ /_doit_/i) { } 0 0 0
654 0 elsif ($tsFilterDefault =~/_doit_/i) { $doit='y'; $tsFilterDefault =~ s/_doit_//i;}
655 0 elsif ($SvrProjName =~ /_doit_/i) { $doit = 'y'; $SvrProjName =~ s/_doit_//i; }
656
657 0 ▶ if ($tsFilterDefault =~ /^$c/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tsFilterDefault =~ /^$c/) { } 0 0 0
658 0 ▶ @dir = glob "${tsFilterDefault}*";
Subroutine BEGIN: called CC=1 SCAR=0.2
659 } else {
660 0 @dir = glob "${c}/${tsFilterDefault}*"; # c:\_filter is added to the search pattern
661 }
662  
663 0 ▶ if ($SvrProjName !~ /_testSuit_/i) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($SvrProjName =~ /_testSuit_/i) 0 0 0
664 0 ▶ if ($SvrProjName =~ /^$c/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($SvrProjName =~ /^$c/) { } 0 0 0
665 0 @dir = glob "${SvrProjName}*";
666 } else {
667 0 @dir = glob "${c}/${SvrProjName}*";
668 }
669 }
670  
671 0 foreach my $each (@dir) {
672 0 $each =~ s/\\/\//g;
673 0 ▶find( { preprocess => sub {return reverse sort @_;}, wanted => sub { if (($File::Find::name =~ /index\.\w+$/i) && ($File::Find::name !~ /${c}\/${_TAF}/i)&&($File::Find::name !~ /${c}.${_TAF}/i)) # todo1 \\
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=6 SCAR=37.4
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /index\.\w+$/i and not $File::Find::name =~ m[$c/$_TAF]i and not $File::Find::name =~ /$c.$_TAF/i) 0 0 0
Condition0%0/6
$File::Find::name =~ /index\.\w+$/i and not $File::Find::name =~ m[$c/$_TAF]i and not $File::Find::name =~ /$c.$_TAF/i
!ll&&!rl&&r
000
$File::Find::name =~ /index\.\w+$/i and not $File::Find::name =~ m[$c/$_TAF]i
!ll&&!rl&&r
000
MC/DC0%0/3
$File::Find::name =~ /index\.\w+$/i and not $File::Find::name =~ m[$c/$_TAF]i and not $File::Find::name =~ /$c.$_TAF/i
$File::Find::name =~ /index\.\w+$/i not $File::Find::name =~ m[$c/$_TAF]i not $File::Find::name =~ /$c.$_TAF/i
Truth table0%0/4
A and not(B) and not(C)
A= $File::Find::name =~ /index\.\w+$/iB= not $File::Find::name =~ m[$c/$_TAF]iC= not $File::Find::name =~ /$c.$_TAF/i
ABCresult
0XX0
10X0
1100
1111
674 {
675 0 my $dirName = $File::Find::name; $dirName =~ s/[\\|\/]index..+$//g; $tsFilterDefault =~ s/\\/\//g;
676 0 ▶ if ($dirName =~ /$tsFilterDefault/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dirName =~ /$tsFilterDefault/i) 0 0 0
677 0 $ps1_args =~ s/ /___/g;
678 0 $notUsegetTCName = 0;
679 0 my $cmd = sprintf "$SvrDrive/$taf testsuite=$dirName;web_ui_title=$dirName;ps1_args=$ps1_args;generateTestsuite" ;
680 0 print "scanTestsuites: $cmd\n";
681 0 ▶ if ($doit =~ /\by\b/) { # $cmd =~ s/\//\\/g; # todo2 \\
Branch: 1 branch
BranchTrueFalseTotal
if ($doit =~ /\by\b/) 0 0 0
682 0 print "Running ... >>>>\n$cmd\n<<<<\n";
683 0 $workingDir = $dirName; $SvrProjName = $dirName; $web_ui_title = $dirName; $ps1_args = $ps1_args; &generateTestsuite();
684 }
685 }
686 }
687 0 }}, $each);
688 }
689 0 1;
690 }
691 sub getWeb_ {
692 0 ▶ my %tsProperty;
Subroutine getWeb_: not called CC=5 SCAR=34.0
Pod undocumented
693 0 ▶ my $tcname = 'TC_tc1' ; $tcname = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
694 0 my $scrollamount = -1 ;
695 0 my $borderwidth = -1 ;
696 0 my $borderStyle = 'SOLID' ;
697 0 $tcname = &getTCName($tcname); $tcname =~ s/\\/\//g;
698  
699 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml) 0 0 0
700 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml;
701 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
702 0 my $tcnameTmp = $tcname;
703 0 ▶ if ( $_ =~ /$tcnameTmp/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tcnameTmp/i) 0 0 0
704 0 $_ =~ /scrollamount=\s*(\d+)\s*/; $scrollamount = $1;
705 0 $_ =~ /border:RED\s+(\d+)\s*px/; $borderwidth = $1;
706 0 $_ =~ /\d+\s*px\s+(\w+)\s*"/; $borderStyle= $1;
707 }
708 }
709 0 close Fin;
710 }
711 0 return "borderWidth=$borderwidth;scrollAmount=$scrollamount;borderStyle=$borderStyle";
712 }
713  
714 sub getTSMaxScrollAmount{
715 0 ▶ my $testsuite= "$c/$_TAF/_testsuite2_"; $testsuite = shift if @_;
Subroutine getTSMaxScrollAmount: not called CC=6 SCAR=37.4
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
716 0 my $scrollAmount = -1;
717 0 ▶ if (-e "$testsuite/$reportHtml") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$testsuite/$reportHtml") 0 0 0
718 0 open Fin, "$testsuite/$reportHtml";
719 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
720 0 ▶ if ($_ =~ /scrollamount=\s*(\d+)\s*/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /scrollamount=\s*(\d+)\s*/) 0 0 0
721 0 my $scrollamount = $1;
722 0 ▶ if ($scrollamount > $scrollAmount) { $scrollAmount = $scrollamount; }
Branch: 1 branch
BranchTrueFalseTotal
if ($scrollamount > $scrollAmount) 0 0 0
723 }
724 }
725 0 close Fin;
726 }
727 0 return $scrollAmount;
728 }
729  
730  
731  
732 #######################generateRootIndex {
733 sub generateRootIndex { ######### generate index.htm
734 0 ▶ my %tafUI; my %tafUITreeView; my %tafRootProperty; my $queueSizeUI; my $queueSizeUICGI; my $exit_y_n = "NO" ;
Subroutine generateRootIndex: not called CC=23 SCAR=63.1
Pod undocumented
735 0 ▶ $exit_y_n = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
736  
737 0 my $queueSize=0; $queueSize = &Queue("", "queueSize");
738  
739 0 ▶ if ($queueSize > 0) { $queueSizeUI = " <a href=\"$url/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize > 0) 0 0 0
740 0 ▶ if ($queueSize > 0) { $queueSizeUICGI = " <a href=\"$urlHttp/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize > 0) 0 0 0
741 0 ▶ if ($queueSize == 0) { $queueSizeUI = " <a style=\"color:grey\" href=\"$url/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize == 0) 0 0 0
742 0 ▶ if ($queueSize == 0) { $queueSizeUICGI = " <a style=\"color:grey\" href=\"$urlHttp/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize == 0) 0 0 0
743  
744 0 &readTAFProperty(); # read %tafProperty;
745 0 &readTestSuitPropertyRoot();
746 0 &readWebTitle($SvrDrive);
747 #### part 1 ####
748 0 open INDEX, ">$SvrDrive/index.htm_";
749 0 open INDEX_Simple, ">$SvrDrive/index.htm_Simple";
750 0 print INDEX &prJScript2();
751  
752 0 print INDEX<<EOF;
753 <body onload=\"addEvents();\"><pre>
754 <h2><a href="$urlHttp/$reportHtml_http" title="$web_ui_title_tip over Network"> $web_ui_title </a>${indexTitleRefreshRoot}${indexTitleRefresh}${queueSizeUI}</h2><ul id="LinkedList1" class="LinkedList">
755 EOF
756  
757 0 ▶find({preprocess=> sub {return sort @_;}, wanted=>sub { if ($File::Find::name =~ /index\.htm$/i) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=10 SCAR=47.0
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /index\.htm$/i) 0 0 0
758  
759 0 my $tmp= $File::Find::name; $tmp=~ s/$SvrDrive//;
760 0 my $tmp1 = $File::Find::name; $tmp1 =~ s/\/index.htm//g; $tmp1 =~ s/\/$reportHtml//;
761 0 my $tmp2 = $File::Find::name; $tmp2 =~ s/\/index.htm//g;
762 0 my $testsuite = $tmp2; my $tsDir = $tmp2;
763 0 ▶ if ($tafProperty{$tmp2}) { $tmp2 = $tafProperty{$tmp2}; } else { $tmp2 = $tmp2; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tafProperty{$tmp2}) { } 0 0 0
764 0 ▶ if ($tafProperty{$tmp2}) { $tmp2 = sprintf("%-${tsPropertyWidth}s", $tafProperty{$tmp2}); } else { $tmp2 = sprintf("%-${tsPropertyWidth}s", $tmp2); }
Branch: 1 branch
BranchTrueFalseTotal
if ($tafProperty{$tmp2}) { } 0 0 0
765 0 my $tmp3 = $tmp2;
766 0 $tmp2 = sprintf("%-${tsPropertyWidth}s", $tmp2);
767 0 my $tmp4 = $tmp2; $tmp4 =~ s/^\s*\d+\s*//g;
768 0 ▶ if ($tafRootProperty{$tmp3}) { $tafRootProperty{$tmp3}=$tafRootProperty{$tmp3};} else {$tafRootProperty{$tmp3} = $tmp2;} ### < TreeView text
Branch: 1 branch
BranchTrueFalseTotal
if ($tafRootProperty{$tmp3}) { } 0 0 0
769 0 ▶ $tafUI{$tmp2}=" <marquee style=\"border:RED 0px SOLID\" width=48 direction=right behavior=alternate loop=10000 scrollamount=".&getTSMaxScrollAmount($testsuite).">*</marquee> <a href=\"$url".$tmp."\">$tafRootProperty{$tmp3}</a><a style=\"color:white\">$SvrDrive$tmp</a>\n" if ($tmp ne "/index.htm");
Branch: 1 branch
BranchTrueFalseTotal
if $tmp ne "/index.htm" 0 0 0
770 0 my $tmp2TreeView = &getRoot_N($tsDir, $webUITreeViewLevel) ;
771 0 ▶ if (defined $tafUITreeView{$tmp2TreeView} ) {;} else { $tafUITreeView{$tmp2TreeView} ="";}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tafUITreeView{$tmp2TreeView}) { } 0 0 0
772 0 ▶ if (defined $tafUI{$tmp2} ) {;} else { $tafUI{$tmp2} ="";}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tafUI{$tmp2}) { } 0 0 0
773 0 ▶ if (($tmp2TreeView !~ /^\s*$c\/$_TAF\s*$/) && ($tafUI{$tmp2} !~ /_noShow_/i)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $tmp2TreeView =~ m[^\s*$c/$_TAF\s*$] || $tafUI{$tmp2} =~ /_noShow_/i) 0 0 0
Condition0%0/3
$tmp2TreeView =~ m[^\s*$c/$_TAF\s*$] || $tafUI{$tmp2} =~ /_noShow_/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$tmp2TreeView =~ m[^\s*$c/$_TAF\s*$] || $tafUI{$tmp2} =~ /_noShow_/i
$tmp2TreeView =~ m[^\s*$c/$_TAF\s*$] $tafUI{$tmp2} =~ /_noShow_/i
Truth table0%0/3
A || B
A= $tmp2TreeView =~ m[^\s*$c/$_TAF\s*$]B= $tafUI{$tmp2} =~ /_noShow_/i
ABresult
1X1
011
000
774 0 $tafUITreeView{$tmp2TreeView} = $tafUITreeView{$tmp2TreeView}."<li>".$tafUI{$tmp2}."</li>" ;
775 0 $tafUITreeView{$tmp2TreeView} =~ s/\n//g; $tafUITreeView{$tmp2TreeView} =~ s/^\s*//g; # extra line webUI
776 }
777 }
778 0 }}, $SvrDrive);
779 0 ▶ foreach my $each1 (sort keys %tafUI) { print INDEX_Simple $tafUI{$each1} if (($each1 !~ /^\s*$c\/$_TAF\s*$/) && ($tafUI{$each1} !~ /_noShow_/i)); }
Branch: 1 branch
BranchTrueFalseTotal
unless $each1 =~ m[^\s*$c/$_TAF\s*$] or $tafUI{$each1} =~ /_noShow_/i 0 0 0
Condition0%0/3
$each1 =~ m[^\s*$c/$_TAF\s*$] or $tafUI{$each1} =~ /_noShow_/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$each1 =~ m[^\s*$c/$_TAF\s*$] or $tafUI{$each1} =~ /_noShow_/i
$each1 =~ m[^\s*$c/$_TAF\s*$] $tafUI{$each1} =~ /_noShow_/i
Truth table0%0/3
A or B
A= $each1 =~ m[^\s*$c/$_TAF\s*$]B= $tafUI{$each1} =~ /_noShow_/i
ABresult
1X1
011
000
780  
781 0 foreach my $each (sort { &get1stColumn($tafProperty{$a}) cmp &get1stColumn($tafProperty{$b})} keys %tafUITreeView ) {
782 # foreach my $each (sort keys %tafUITreeView ) {
783 0 @_ = split(/<li>/,$tafUITreeView{$each}); my $NofTS; $NofTS = $#_;
784 0 ▶ my $tsDesc ; if ($tsPropertyRoot{$each}) { $tsDesc = "<a title=\"$each\">$tsPropertyRoot{$each}"; } else { $tsDesc = $each;}
Branch: 1 branch
BranchTrueFalseTotal
if ($tsPropertyRoot{$each}) { } 0 0 0
785 0 ▶ if ($NofTS >2 ) { print INDEX "<li>$tsDesc<ul>$tafUITreeView{$each}"."</ul></li>" if ($each !~ /$c\/$_TAF\s*$/i); }
Branch: 2 branches
BranchTrueFalseTotal
if ($NofTS > 2) { } 0 0 0
unless $each =~ m[$c/$_TAF\s*$]i 0 0 0
786 0 ▶ else { print INDEX "$tafUITreeView{$each}" if ($each !~ /$c\/$_TAF\s*$/i); }
Branch: 1 branch
BranchTrueFalseTotal
unless $each =~ m[$c/$_TAF\s*$]i 0 0 0
787 }
788  
789 0 print INDEX <<EOF;
790 </ul>
791 </pre></body></html>
792 <style type="text/css"> a { text-decoration:none} </style>
793 EOF
794 ;
795 0 close INDEX;
796 0 close INDEX_Simple;
797 0 move ($SvrDrive.'/index.htm_', $SvrDrive.'/'."index.htm");
798 #### part 1 ####
799 #################################### Generate Root tsProperty.txt ##################################
800 0 ▶ if (-e "$SvrDrive/tsProperty.txt" ) {;} else {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$SvrDrive/tsProperty.txt") { } 0 0 0
801 0 my $ctr=1;
802 0 open FoutRootProperty, ">$SvrDrive/tsProperty.txt";
803 0 print FoutRootProperty "web_ui_title: Test Automaiton Framework : web_ui_title\n";
804 0 foreach my $each (sort keys %tafRootProperty) {
805 0 $each =~ s/\s*$//g;
806 0 ▶ printf FoutRootProperty "%-60s\|%04d %-60s\n", $each, $ctr++, $each if ($each !~ /$SvrDrive\s*$/i);
Branch: 1 branch
BranchTrueFalseTotal
unless $each =~ /$SvrDrive\s*$/i 0 0 0
807 }
808 0 close FoutRootProperty;
809 }
810 #################################### Generate Root tsProperty.txt ##################################
811 #### part 2 ####
812 0 %tafUITreeView=();
813 0 open INDEX, ">$SvrDrive/index_http.htm_"; ########## generate index_http.htm
814  
815 0 print INDEX &prJScript2();
816  
817 0 print INDEX<<EOF;
818 <body onload=\"addEvents();\"><pre> <h2><a href="$urlHttp/$reportHtml_http" title="Click to view *all* Testsuites"> $web_ui_title </a>${indexTitleRefreshCGIRoot}$indexTitleRefreshCGI (Automation host: $hostname/$ip)${queueSizeUICGI}</h2><ul id="LinkedList1" class="LinkedList">
819 EOF
820 0 ▶find({preprocess=> sub {return sort @_;}, wanted=>sub { if ($File::Find::name =~ /index_http\.htm$/i) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=9 SCAR=45.0
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /index_http\.htm$/i) 0 0 0
821 0 my $tmp = $File::Find::name; $tmp =~ s/$SvrDrive//;
822 0 my $tmp2 = $File::Find::name; $tmp2 =~ s/\/index_http.htm//g;
823 0 my $testsuite = $tmp2; my $tsDir = $tmp2;
824 0 ▶ if ($tafProperty{$tmp2} ) { $tmp2 = sprintf("%-${tsPropertyWidth}s", $tafProperty{$tmp2}); }
Branch: 1 branch
BranchTrueFalseTotal
if ($tafProperty{$tmp2}) { } 0 0 0
825 0 else { $tmp2 = sprintf("%-${tsPropertyWidth}s", $tmp2); }
826 0 my $tmp3 = $tmp2;
827 0 $tmp2 = sprintf("%-${tsPropertyWidth}s", $tmp2);
828 0 my $tmp4 = $tmp2;
829 0 $tmp4 =~ s/^\s*\d+\s*//g;
830 0 ▶ if ($tafRootProperty{$tmp3}) {;} else {$tafRootProperty{$tmp3} = $tmp4;}
Branch: 1 branch
BranchTrueFalseTotal
if ($tafRootProperty{$tmp3}) { } 0 0 0
831 0 ▶ $tafUI{$tmp2}=" <marquee style=\"border:RED 0px SOLID\" width=48 direction=right behavior=alternate loop=10000 scrollamount=".&getTSMaxScrollAmount($testsuite).">*</marquee> <a href=\"$urlHttp".$tmp."\">$tafRootProperty{$tmp3}</a><a style=\"color:white\">$SvrDrive$tmp</a>\n" if ($tmp ne "/index.htm");
Branch: 1 branch
BranchTrueFalseTotal
if $tmp ne "/index.htm" 0 0 0
832 0 my $tmp2TreeView = &getRoot_N($tsDir, $webUITreeViewLevel) ;
833 0 ▶ if (defined $tafUITreeView{$tmp2TreeView} ) {;} else { $tafUITreeView{$tmp2TreeView} ="";}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tafUITreeView{$tmp2TreeView}) { } 0 0 0
834 0 ▶ if (defined $tafUI{$tmp2} ) {;} else { $tafUI{$tmp2} ="";}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tafUI{$tmp2}) { } 0 0 0
835  
836 0 ▶ if (($tmp2 !~ /^\s*$c\/$_TAF\s*$/) && ($tafUI{$tmp2} !~ /_noShow_/i)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $tmp2 =~ m[^\s*$c/$_TAF\s*$] || $tafUI{$tmp2} =~ /_noShow_/i) 0 0 0
Condition0%0/3
$tmp2 =~ m[^\s*$c/$_TAF\s*$] || $tafUI{$tmp2} =~ /_noShow_/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$tmp2 =~ m[^\s*$c/$_TAF\s*$] || $tafUI{$tmp2} =~ /_noShow_/i
$tmp2 =~ m[^\s*$c/$_TAF\s*$] $tafUI{$tmp2} =~ /_noShow_/i
Truth table0%0/3
A || B
A= $tmp2 =~ m[^\s*$c/$_TAF\s*$]B= $tafUI{$tmp2} =~ /_noShow_/i
ABresult
1X1
011
000
837 0 $tafUITreeView{$tmp2TreeView} = $tafUITreeView{$tmp2TreeView}."<li>".$tafUI{$tmp2}."</li>";
838 0 $tafUITreeView{$tmp2TreeView} =~ s/\n//g; $tafUITreeView{$tmp2TreeView} =~ s/^\s*//g; # $tafUITreeView{$tmp2TreeView} =~ s/\s*$/\n/g;
839 }
840  
841 }
842 0 }}, $SvrDrive);
843  
844 0 foreach my $each (sort { &get1stColumn($tafProperty{$a}) cmp &get1stColumn($tafProperty{$b})} keys %tafUITreeView ) {
845 # foreach my $each ( sort keys %tafUITreeView ) {
846 0 my $NofTS; @_ = split(/<li>/,$tafUITreeView{$each}); $NofTS = $#_;
847 0 ▶ my $tsDesc ; if ($tsPropertyRoot{$each}) { $tsDesc = "<a title=\"$each\">$tsPropertyRoot{$each}"; } else { $tsDesc = $each;}
Branch: 1 branch
BranchTrueFalseTotal
if ($tsPropertyRoot{$each}) { } 0 0 0
848 0 ▶ if ($NofTS >2 ) { print INDEX "<li>$tsDesc<ul>$tafUITreeView{$each}"."</ul></li>" if ($each !~ /$c\/$_TAF\s*$/i); }
Branch: 2 branches
BranchTrueFalseTotal
if ($NofTS > 2) { } 0 0 0
unless $each =~ m[$c/$_TAF\s*$]i 0 0 0
849 0 ▶ else { print INDEX "$tafUITreeView{$each}" if ($each !~ /$c\/$_TAF\s*$/i); }
Branch: 1 branch
BranchTrueFalseTotal
unless $each =~ m[$c/$_TAF\s*$]i 0 0 0
850 }
851  
852  
853 0 print INDEX <<EOF;
854 </ul> </pre></html>
855 <style type="text/css"> a { text-decoration:none} </style>
856 EOF
857 ;
858 0 close INDEX;
859 0 move ($SvrDrive.'/index_http.htm_', $SvrDrive.'/'."index_http.htm");
860 #### part 2 ####
861 0 ▶ if ($exit_y_n =~ /exit/) { sleep $outputPause; exit; }
Branch: 1 branch
BranchTrueFalseTotal
if ($exit_y_n =~ /exit/) 0 0 0
862 0 1;
863 }
864
865 0 ▶sub get1stColumn { my $str = shift; if ($str){;} else {$str ="";} $str =~ s/^\s*//g; @_ = split (/\s+/,$str); my $return = $_[0]; if ($return) {;} else {$return = "0000"; } return $return; }
Subroutine get1stColumn: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
if ($str) { } 0 0 0
if ($return) { } 0 0 0
866  
867 ####################### read Testsuite web_ui_title
868 sub readWebTitle{
869 0 ▶ my $dir = shift; my %prop; my $webTitle = "Test Automation Framework";
Subroutine readWebTitle: not called CC=4 SCAR=30.0
Pod undocumented
870 0 ▶ if (-e "$dir/tsProperty.txt") { # todo hardcoded variable
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$dir/tsProperty.txt") 0 0 0
871 0 open Fin, "$dir/tsProperty.txt";
872 0 ▶ while ($_ =<Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
873 0 my $tmp=""; /(\s*)/; $_ =~ /^\s*(.+)\|/ ; $tmp = $1; $prop{$tmp}=$_;
874 0 ▶ if ($_ =~ /web_ui_title\s*:\s*(.+)\s*:\s*web_ui_title/) {$webTitle = $1;}
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /web_ui_title\s*:\s*(.+)\s*:\s*web_ui_title/) 0 0 0
875 0 } close Fin;
876 }
877 0 return $webTitle;
878 }
879  
880  
881 ####################### get Testsuite Total Exec Time
882 sub getTestsuiteTotalExecTime {
883 0 ▶ my $index= shift; my $index_; my $tsTotalExecTime = 0;
Subroutine getTestsuiteTotalExecTime: not called CC=6 SCAR=37.4
Pod undocumented
884 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
885 0 open FinTS, $index;
886 0 ▶ while ($_ = <FinTS>) { if ($_ =~ /^\s*<span\s+style="color:black;/i) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline FinTS)) 0 0 0
if ($_ =~ /^\s*<span\s+style="color:black;/i) 0 0 0
887 # $_ =~ /(\d+)\s*\(s\)/; $tsTotalExecTime = $tsTotalExecTime + $1;}
888 0 ▶ if ($_ =~ /(\d\d):(\d\d):(\d\d)\s*\(s\)/) { $tsTotalExecTime = $tsTotalExecTime + $1 * 3600 + $2 * 60 + $3;}
Branch: 2 branches
BranchTrueFalseTotal
if ($_ =~ /(\d\d):(\d\d):(\d\d)\s*\(s\)/) { } 0 0 0
elsif ($_ =~ /(\d+)\s*\(s\)/) { } 0 0 0
889 0 elsif ($_ =~ /(\d+)\s*\(s\)/) { $tsTotalExecTime = $tsTotalExecTime + $1;}
890 }
891 }
892 0 close FinTS;
893 }
894 0 return &timeConvert($tsTotalExecTime);
895 }
896  
897 ####################### get Testsuite Total Exec Time
898 sub timeConvert {
899 0 ▶ my $totalTime = shift;
Subroutine timeConvert: not called CC=1 SCAR=6.9
Pod undocumented
900 0 my $hr = int ($totalTime/3600);
901 0 my $min = int (($totalTime - $hr*3600) / 60);
902 0 my $sec = int (($totalTime - $hr*3600 - $min * 60));
903 0 $totalTime = sprintf "%02d:%02d:%02d",$hr,$min,$sec;
904 }
905  
906 #######################generateFailedTCHtml {
907 sub createTestsuitePassFailedHtml {
908 0 ▶ my $index= shift; my $index_;
Subroutine createTestsuitePassFailedHtml: not called CC=47 SCAR=77.2
Pod undocumented
909 ####################### failed.htm #####################
910 0 ▶ if ($index=~ /index\.htm\s*$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($index =~ /index\.htm\s*$/) { } 0 0 0
elsif ($index =~ /index_http\.htm\s*$/) { } 0 0 0
911 0 $index_ = $index;
912 0 $index_ =~ s/\.htm/_failed\.htm/;
913 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
914 0 open Fin, $index; open Fout, ">$index_";
915 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
916 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=fail/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
917 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index\.htm/index_failed\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
918 0 ▶ if (&getLatestPassFail($_) =~ /color:gray;/i) { ;
Branch: 3 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:gray;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:green;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:black;/i) { } 0 0 0
919 } elsif (&getLatestPassFail($_) =~ /color:green;/i) { ;
920 } elsif (&getLatestPassFail($_) =~ /color:black;/i) { ;
921 } else {
922 0 print Fout $_; }
923 }
924 0 close Fout; close Fin;
925 }
926  
927 } elsif ($index=~ /index_http\.htm\s*$/ ) {
928 0 $index_ = $index;
929 0 $index_ =~ s/\.htm/_failed\.htm/;
930  
931 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
932 0 open Fin, $index; open Fout, ">$index_";
933 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
934 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=fail/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
935 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index_http\.htm/index_failed_http\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
936 0 ▶ if (&getLatestPassFail($_) =~ /color:gray;/i) { ;
Branch: 3 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:gray;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:green;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:black;/i) { } 0 0 0
937 } elsif (&getLatestPassFail($_) =~ /color:green;/i) { ;
938 } elsif (&getLatestPassFail($_) =~ /color:black;/i) { ;
939 0 } else { print Fout $_; }
940 }
941 0 close Fout; close Fin;
942 }
943 }
944 ####################### failed.htm #####################
945  
946 ####################### pass.htm #####################
947 0 ▶ if ($index=~ /index\.htm\s*$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($index =~ /index\.htm\s*$/) { } 0 0 0
elsif ($index =~ /index_http\.htm\s*$/) { } 0 0 0
948 0 $index_ = $index;
949 0 $index_ =~ s/\.htm/_passed\.htm/;
950  
951 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
952 0 open Fin, $index; open Fout, ">$index_";
953 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
954 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=pass/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
955 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index\.htm/index_passed\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
956 0 ▶ if (&getLatestPassFail($_) =~ /color:gray;/i) { ;
Branch: 3 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:gray;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:black;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:red;/i) { } 0 0 0
957 } elsif (&getLatestPassFail($_) =~ /color:black;/i) { ;
958 } elsif (&getLatestPassFail($_) =~ /color:red;/i) { ;
959 } else {
960 0 print Fout $_; }
961 }
962 0 close Fout; close Fin;
963 }
964  
965 } elsif ($index=~ /index_http\.htm\s*$/ ) {
966 0 $index_ = $index;
967 0 $index_ =~ s/\.htm/_passed\.htm/;
968  
969 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
970 0 open Fin, $index; open Fout, ">$index_";
971 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
972 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=pass/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
973 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index_http\.htm/index_passed_http\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
974 0 ▶ if (&getLatestPassFail($_) =~ /color:gray;/i) { ;
Branch: 3 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:gray;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:black;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:red;/i) { } 0 0 0
975 } elsif (&getLatestPassFail($_) =~ /color:black;/i) { ;
976 } elsif (&getLatestPassFail($_) =~ /color:red;/i) { ;
977 0 } else { print Fout $_; }
978 }
979 0 close Fout; close Fin;
980 }
981 }
982 ####################### pass.htm #####################
983 ####################### other.htm #####################
984 0 ▶ if ($index=~ /index\.htm\s*$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($index =~ /index\.htm\s*$/) { } 0 0 0
elsif ($index =~ /index_http\.htm\s*$/) { } 0 0 0
985 0 $index_ = $index;
986 0 $index_ =~ s/\.htm/_others\.htm/;
987  
988 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
989 0 open Fin, $index; open Fout, ">$index_";
990 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
991 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=\\\\d+_pipe_null/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
992 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index\.htm/index_others\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
993 0 ▶ if (&getLatestPassFail($_) =~ /color:green;/i) { ;
Branch: 2 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:green;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:red;/i) { } 0 0 0
994 } elsif (&getLatestPassFail($_) =~ /color:red;/i) { ;
995 0 } else { print Fout $_; }
996 }
997 0 close Fout; close Fin;
998 }
999  
1000 } elsif ($index=~ /index_http\.htm\s*$/ ) {
1001 0 $index_ = $index;
1002 0 $index_ =~ s/\.htm/_others\.htm/;
1003  
1004 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
1005 0 open Fin, $index; open Fout, ">$index_";
1006 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1007 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=\\\\d+_pipe_null/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
1008 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index_http\.htm/index_others_http\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
1009 0 ▶ if (&getLatestPassFail($_) =~ /color:green;/i) {
Branch: 2 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:green;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:red;/i) { } 0 0 0
1010 } elsif (&getLatestPassFail($_) =~ /color:red;/i) { ;
1011 0 } else { print Fout $_; }
1012 }
1013 0 close Fout; close Fin;
1014 }
1015 }
1016 ####################### other.htm #####################
1017 }
1018  
1019 #######################generateFailedTCHtml
1020  
1021 #######################generate_tagsHtml
1022 sub generateTagHtml {
1023 0 ▶ my $index= shift; my $index_;
Subroutine generateTagHtml: not called CC=12 SCAR=50.5
Pod undocumented
1024 0 my $tagName = "_smoke_";
1025 0 ▶ if ($index=~ /index\.htm\s*$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($index =~ /index\.htm\s*$/) { } 0 0 0
elsif ($index =~ /index_http\.htm\s*$/) { } 0 0 0
1026 0 $index_ = $index;
1027 0 $index_ =~ s/\.htm/_$tagName\.htm/;
1028  
1029 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
1030 0 open Fin, $index; open Fout, ">$index_";
1031 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1032 0 ▶ if ($_ =~ /tcPropertyPatternPattern/) { $_ =~ s/tcPropertyPatternPattern=\.\*/tcPropertyPatternPattern=\\\\d+_pipe_null/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcPropertyPatternPattern/) 0 0 0
1033 0 ▶ if ($_ =~ /RunFile/) { $_ =~ s/index\.htm/index_${tagName}\.htm/g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /RunFile/) 0 0 0
1034 0 ▶ if (&processProperties("","dir", $tagName) =~ /color:green;/i) { print Fout $_; } # here to start
Branch: 1 branch
BranchTrueFalseTotal
if (&processProperties("", "dir", $tagName) =~ /color:green;/i) 0 0 0
1035 }
1036 0 close Fout; close Fin;
1037 }
1038  
1039 } elsif ($index=~ /index_http\.htm\s*$/ ) {
1040 0 $index_ = $index;
1041 0 $index_ =~ s/\.htm/_others\.htm/;
1042  
1043 0 ▶ if (-e $index) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $index) 0 0 0
1044 0 open Fin, $index; open Fout, ">$index_";
1045 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1046 0 ▶ if (&getLatestPassFail($_) =~ /color:green;/i) {
Branch: 2 branches
BranchTrueFalseTotal
if (&getLatestPassFail($_) =~ /color:green;/i) { } 0 0 0
elsif (&getLatestPassFail($_) =~ /color:red;/i) { } 0 0 0
1047 } elsif (&getLatestPassFail($_) =~ /color:red;/i) { ;
1048 0 } else { print Fout $_; }
1049 }
1050 0 close Fout; close Fin;
1051 }
1052 }
1053 }
1054 #######################generate_tagsHtml
1055  
1056 sub getLatestPassFail {
1057 0 ▶ $_ = shift; my $color; my @symbol = $_ =~ />.<\/a><a\s+style=/g; my @color = $_ =~ /<a style=\"color:\w+\"/g;
Subroutine getLatestPassFail: not called CC=4 SCAR=30.0
Pod undocumented
1058 0 ▶for (my $i = 0; $i < $#symbol; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $#symbol) 0 0 0
1059 0 $symbol[$i] =~ />(.)</; $symbol[$i] = $1;
1060 0 ▶ if ($symbol[$i] =~ /^\s*$/) {;} # dumy
Branch: 2 branches
BranchTrueFalseTotal
if ($symbol[$i] =~ /^\s*$/) { } 0 0 0
elsif ($symbol[$i] =~ /\|/) { } 0 0 0
1061 elsif ($symbol[$i] =~ /\|/) {;} # mark
1062 0 else { $color[$i] =~ /\"(color:\w+)\"/; return "$1;"; }
1063 }
1064 0 return "";
1065 }
1066 sub getLatestPassFail_old {
1067 0 ▶ $_ = shift; my $color;
Subroutine getLatestPassFail_old: not called CC=4 SCAR=30.0
Pod undocumented
1068 0 ▶ if ($_ =~ /^\s*<span\s+style="color:black;">/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^\s*<span\s+style="color:black;">/) 0 0 0
1069 0 ▶ if ($_ =~ /^\s*<span\s+style="color:black;">\s*<a\s+style="color:\s*(\w+)"/) {$color = $1;} else {$color = "black";}
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^\s*<span\s+style="color:black;">\s*<a\s+style="color:\s*(\w+)"/) { } 0 0 0
1070 }
1071 0 ▶ if ($color) { return "color:$color;";} else {return "_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($color) { } 0 0 0
1072 }
1073  
1074  
1075 sub updateWeb {
1076 0 ▶ my %tsProperty;
Subroutine updateWeb: not called CC=6 SCAR=37.4
Pod undocumented
1077 0 ▶ my $tcname = 'TC_tc1'; $tcname = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
1078 0 ▶ my $scrollamount = 0 ; $scrollamount = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
1079 0 $tcname = &getTCName($tcname); $tcname =~ s/\\/\//g ;
1080  
1081 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml) 0 0 0
1082 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml ;
1083 0 open Fout, ">".$SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_" ;
1084 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1085 0 my $tcnameTmp = $tcname;
1086 0 ▶ if ( $_ =~ /$tcnameTmp/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tcnameTmp/i) 0 0 0
1087 0 $_ =~ /scrollamount=\s*(\d+)\s*/;
1088 0 $_ =~ s/scrollamount=\s*$1\s*/scrollamount=$scrollamount/;
1089 }
1090 0 print Fout $_;
1091 }
1092 0 close Fout;
1093 0 close Fin;
1094  
1095 0 move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml);
1096 }
1097 0 return "tcCtr_Dynamics=$scrollamount";
1098 }
1099  
1100 ################################################################################
1101 #
1102 ################################################################################
1103 sub hungryMatch { # hungryMatch("startStr_returnStr_endStr","startStr","endStr")
1104 0 ▶ my $str = shift; my $startStr = shift; my $endStr = shift;
Subroutine hungryMatch: not called CC=4 SCAR=30.0
Pod undocumented
1105  
1106 0 ▶ if (index($str, $startStr) < 0) { return "";}
Branch: 1 branch
BranchTrueFalseTotal
if (index($str, $startStr) == -1) 0 0 0
1107 0 ▶ if (index($str, $endStr ) < 0) { return "";}
Branch: 1 branch
BranchTrueFalseTotal
if (index($str, $endStr) == -1) 0 0 0
1108 0 my $offset = index($str,$startStr) + length $startStr;
1109 0 my $len = index($str,$endStr) - $offset;
1110 0 ▶ if ($len < 0) { $len = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($len < 0) 0 0 0
1111 0 return substr ($str, $offset, $len);
1112 }
1113 10 ▶sub match1stRegexp { my $str = shift; my $pattern = shift; @_ = split (/$pattern/, $str); return $_[0]; }
Subroutine match1stRegexp: called CC=1 SCAR=0.0
Pod undocumented
1114 10 ▶sub matchRestRegexp { my $str = shift; my $pattern = shift; @_ = split (/$pattern/, $str); $str =~ s/^\s*$_[0]//; $str =~ s/^\s*$pattern//; return $str;}
Subroutine matchRestRegexp: called CC=1 SCAR=0.0
Pod undocumented
1115 0 ▶sub removeTags { my $str = shift; @_ = ($str=~ /\b_\S+_\b/ig); foreach my $each (@_) {
Subroutine removeTags: not called CC=3 SCAR=24.8
Pod undocumented
1116 0 ▶ if ($each !~ /\//) { $str =~ s/\b$each\b//g ;
Branch: 1 branch
BranchTrueFalseTotal
unless ($each =~ m[/]) 0 0 0
1117 }
1118
1119 }
1120
1121 0 return $str; }
1122 sub updateTestsuiteHTA {
1123 0 ▶ open Fin, $SvrDrive."/index.htm" || die "Can't open index.htm";
Subroutine updateTestsuiteHTA: not called CC=4 SCAR=30.0
Pod undocumented
Condition0%0/2
$SvrDrive . '/index.htm' || die(q[Can't open index.htm])
l!l
00
MC/DC0%0/1
$SvrDrive . '/index.htm' || die(q[Can't open index.htm])
$SvrDrive . '/index.htm'
Truth table0%0/2
A
A= $SvrDrive . '/index.htm'
Aresult
11
00
1124 0 ▶ while ($_ = <Fin>) { chop; if ( &hungryMatch($_,"\/\/\/","index.htm") ) { my $ts= &hungryMatch($_,"\/\/\/","index.htm") ; &createTestsuiteHTA ($ts); } }
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if (&hungryMatch($_, "///", "index.htm")) 0 0 0
1125 0 close Fin;
1126 }
1127  
1128 sub tsPostProcessPlugin {
1129 0 ▶ open Fin, $SvrDrive."/index.htm" || die "Can't open index.htm";
Subroutine tsPostProcessPlugin: not called CC=4 SCAR=30.0
Pod undocumented
Condition0%0/2
$SvrDrive . '/index.htm' || die(q[Can't open index.htm])
l!l
00
MC/DC0%0/1
$SvrDrive . '/index.htm' || die(q[Can't open index.htm])
$SvrDrive . '/index.htm'
Truth table0%0/2
A
A= $SvrDrive . '/index.htm'
Aresult
11
00
1130 0 ▶ while ($_ = <Fin>) { chop; if ( &hungryMatch($_,"/\/\/\/","index.htm")) { my $ts= &hungryMatch($_,"\/\/\/","index.htm"); print "postProcessPlugin: $ts\n";} }
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if (&hungryMatch($_, "////", "index.htm")) 0 0 0
1131 0 close Fin;
1132 }
1133 sub updateTestsuitePassFail {
1134 #if (-e $SvrDrive."/index.htm" ) {
1135 #open FinIndex, $SvrDrive."/index.htm" || die "Can't open index.htm";
1136 0 ▶ if (-e $SvrDrive."/index.htm_Simple" ) {
Subroutine updateTestsuitePassFail: not called CC=5 SCAR=34.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/index.htm_Simple') 0 0 0
1137 0 ▶ open FinIndex, $SvrDrive."/index.htm_Simple" || die "Can't open index.htm";
Condition0%0/2
$SvrDrive . '/index.htm_Simple' || die(q[Can't open index.htm])
l!l
00
MC/DC0%0/1
$SvrDrive . '/index.htm_Simple' || die(q[Can't open index.htm])
$SvrDrive . '/index.htm_Simple'
Truth table0%0/2
A
A= $SvrDrive . '/index.htm_Simple'
Aresult
11
00
1138 0 ▶ while ($_ = <FinIndex>) { chop;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline FinIndex)) 0 0 0
1139 0 ▶ if ( &hungryMatch($_, "\/\/\/","index.htm" )) {
Branch: 1 branch
BranchTrueFalseTotal
if (&hungryMatch($_, "///", "index.htm")) 0 0 0
1140 0 my $ts = &hungryMatch($_,"\/\/\/","index.htm")."index.htm" ; &createTestsuitePassFailedHtml ($ts);
1141 0 my $ts_http = $ts; $ts_http =~ s/index\.htm/index_http\.htm/; &createTestsuitePassFailedHtml ($ts_http);
1142 }
1143 }
1144 0 close FinIndex;
1145 }
1146 }
1147  
1148 sub createTestsuiteHTA {
1149 0 ▶ my $tsDir = shift; @_ = split /\//, $tsDir; my $testsuite = $_[$#_];
Subroutine createTestsuiteHTA: not called CC=1 SCAR=6.9
Pod undocumented
1150 0 &createFile_( $tsDir.'ts.hta',
1151 "
1152 <html>
1153 <head>
1154 <script language=\"JavaScript\">
1155 function RunFileHTTP(testsuite, testcase) {
1156 // alert(\"testsuite is \" + testsuite + \" testcase is \" + testcase );
1157 WshShell = new ActiveXObject(\"WScript.Shell\");
1158 cmd= '$c\\\\windows\\\\system32\\\\schtasks.exe /delete /tn TAF_'+ testsuite + ' /f';
1159 sleep (1000);
1160 //alert (cmd);
1161 WshShell.Run(cmd, 1, false);
1162 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /create /TR \"$c\\\\$_TAF\\\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec\" /TN TAF_'+testsuite+' /sc monthly /mo 1 /F';
1163 sleep (1000);
1164 //alert (cmd);
1165 WshShell.Run(cmd, 1, false);
1166 cmd= '$c\\\\windows\\\\system32\\\\schtasks.exe /run /tn TAF_'+testsuite;
1167 sleep (1000);
1168 //alert (cmd);
1169 WshShell.Run(cmd, 1, false);
1170 }
1171  
1172 function sleep(milliseconds) {
1173 var start = new Date().getTime();
1174 for (var i = 0; i < 1e7; i++) {
1175 if ((new Date().getTime() - start) > milliseconds){
1176 break;
1177 }
1178 }
1179 }
1180  
1181 </script>
1182  
1183 </head>
1184 <body onLoad =\"RunFileHTTP(\'$testsuite\', \'.*\')\">Run $testsuite\/ts.hta</button> <p>
1185 </body>
1186 </html>
1187  
1188 ")
1189 ;
1190  
1191 }
1192  
1193 ################################################################################
1194 #
1195 ################################################################################
1196 sub initTAF {
1197 0 ▶ foreach my $each (split /\n/, `schtasks /query`) {
Subroutine initTAF: not called CC=3 SCAR=24.8
Pod undocumented
1198 0 ▶ if ($each =~ /TAF_/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /TAF_/i) 0 0 0
1199 0 $each =~ /^\s*(.+)\s+(\d+\/\d+\/\d+)\s+/;
1200 0 my $processName = $1; my $cmd = "schtasks /delete /tn $processName /f"; `$cmd`;
1201 }
1202 }
1203 }
1204  
1205 ################################################################################
1206 #
1207 ################################################################################
1208  
1209 sub readTestSuitProperty {
1210 0 ▶ if ( -e $SvrDrive.'/'.$SvrProjName.'/'."tsProperty.txt") {
Subroutine readTestSuitProperty: not called CC=5 SCAR=34.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . "tsProperty.txt") 0 0 0
1211 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'."tsProperty.txt";
1212 0 ▶ while ($_ = <Fin>) { chop;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1213 0 ▶ if ($_ =~ /web_ui_title\s*:\s*(.+)\s*:\s*web_ui_title/) { $web_ui_title = $1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /web_ui_title\s*:\s*(.+)\s*:\s*web_ui_title/) 0 0 0
1214 # else { $web_ui_title = "Test Automation Framework"; }
1215 0 my $tcname, my $tcdesc;
1216 0 ($tcname, $tcdesc) = split /[\|]/, $_;
1217 0 ▶ if ($tcdesc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcdesc) 0 0 0
1218 #### Remove xml tags from the tcDesc for property display
1219 0 $tcdesc =~ s/<.*>//g;
1220 0 $tcname =~ s/^\s*//; $tcname =~ s/\s*$//; # $tcdesc =~ s/^\s*//;
1221 0 $tsProperty{$tcname}= $tcdesc;
1222 }
1223 }
1224 0 close Fin;
1225 }
1226 }
1227  
1228 sub readTestSuitPropertyRoot {
1229 0 ▶ if ( -e $SvrDrive.'/'."tsProperty.txt") {
Subroutine readTestSuitPropertyRoot: not called CC=5 SCAR=34.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . "tsProperty.txt") 0 0 0
1230 0 open Fin, $SvrDrive.'/'."tsProperty.txt";
1231 0 ▶ while ($_ = <Fin>) { chop;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1232 0 ▶ if ($_ =~ /web_ui_title\s*:\s*(.+)\s*:\s*web_ui_title/) { $web_ui_title = $1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /web_ui_title\s*:\s*(.+)\s*:\s*web_ui_title/) 0 0 0
1233 0 my $tcname, my $tcdesc;
1234 0 ($tcname, $tcdesc) = split /[\|]/, $_;
1235 0 ▶ if ($tcdesc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcdesc) 0 0 0
1236 #### Remove xml tags from the tcDesc for property display
1237 0 $tcdesc =~ s/<.*>//g;
1238 0 $tcname =~ s/^\s*//; $tcname =~ s/\s*$//; # $tcdesc =~ s/^\s*//;
1239 0 $tsPropertyRoot{$tcname}= $tcdesc;
1240 }
1241 }
1242 0 close Fin;
1243 }
1244 }
1245 ################################################################################
1246 #
1247 ################################################################################
1248  
1249 sub readTAFProperty {
1250 0 ▶ if ( -e $SvrDrive.'/'.$tsProperty) {
Subroutine readTAFProperty: not called CC=5 SCAR=34.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $tsProperty) 0 0 0
1251 0 open Fin, $SvrDrive.'/'.$tsProperty;
1252 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1253 0 chop;
1254 0 ▶ if ($_ =~ /web_ui_title\s*:(.+):\s*web_ui_title/) { $web_ui_title = $1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /web_ui_title\s*:(.+):\s*web_ui_title/) 0 0 0
1255 0 my $tcname, my $tcdesc;
1256 0 ($tcname, $tcdesc) = split /[\|]/, $_;
1257 0 ▶ if ($tcdesc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcdesc) 0 0 0
1258 0 $tcname =~ s/^\s*//; $tcname =~ s/\s*$//; # $tcdesc =~ s/^\s*//;
1259 0 $tafProperty{$tcname}= $tcdesc;
1260 0 $tafPropertyRev{$tcdesc} = $tcname;
1261 }
1262 }
1263 0 close Fin;
1264 }
1265 }
1266  
1267 ################################################################################
1268 #
1269 ################################################################################
1270 sub getTSNameFromTSDesc {
1271 0 ▶ &readTAFProperty();
Subroutine getTSNameFromTSDesc: not called CC=4 SCAR=30.0
Pod undocumented
1272 0 ▶ my $tcDesc = "018"; $tcDesc = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
1273 0 foreach my $each (keys %tafPropertyRev) {
1274 0 ▶ if ($each =~ /$tcDesc/i) { my $tmp = $tafPropertyRev{$each}; $tmp =~ s/$c\/$_TAF\///; return $tmp; }
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /$tcDesc/i) 0 0 0
1275 }
1276 }
1277 ################################################################################
1278 #
1279 ################################################################################
1280 sub runFromGmailService {
1281 0 ▶while (1==1) {
Subroutine runFromGmailService: not called CC=1 SCAR=6.9
Pod undocumented
1282 0 `$c/$_TAF/$taf runFromGmail`;
1283 0 sleep 10;
1284 }
1285 }
1286  
1287 sub runFromGmail {
1288 0 ▶ my %record; my $value; my $key; my %record_file ;
Subroutine runFromGmail: not called CC=9 SCAR=45.0
Pod undocumented
1289 0 my $fetchmailFName = "/var/spool/mail/qa_user" ;
1290 0 my $fetchmailFNameLocal = "/usr/local/iiiiiiii/bin/qa_user" ;
1291 0 ▶ if (-e $fetchmailFNameLocal) { open Fin1, $fetchmailFNameLocal; while ($_= <Fin1>) { $_ = /_date_(.+)_subject_(.+)/; $record_file{$1}=$2;} close Fin2; } # read local history file
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fetchmailFNameLocal) 0 0 0
if (defined($_ = readline Fin1)) 0 0 0
1292 0 ▶ if (-e $fetchmailFName ) { open Fin , $fetchmailFName ; while ($_= <Fin> ) { if (/^\s*Date:/) { chop; $key=$_; } elsif (/^\s*Subject: /) { chop; $value = $_; $record{$key}= $value;} } close Fin; }
Branch: 4 branches
BranchTrueFalseTotal
if (-e $fetchmailFName) { } 0 0 0
if (defined($_ = readline Fin)) 0 0 0
if (/^\s*Date:/) { } 0 0 0
elsif (/^\s*Subject: /) { } 0 0 0
1293 0 else { print " $fetchmailFName doesn't exit\n"; exit;}
1294 0 ▶ foreach my $each (sort keys %record) { if ($record_file{$each}) { print "$each already exist\n"; } else {
Branch: 1 branch
BranchTrueFalseTotal
if ($record_file{$each}) { } 0 0 0
1295 0 &runIndex($record{$each}); open Fout , ">>$fetchmailFNameLocal" ; print Fout "_date_${each}_subject_$record{$each}\n"; close Fout; } }
1296 }
1297  
1298 0 ▶sub runIndex {
Subroutine runIndex: not called CC=1 SCAR=0.0
Pod undocumented
1299 # todo
1300 }
1301 sub runFromGmail_old_win32 {
1302 0 ▶my $cmd='c:\cygwin\bin\bash.exe -l /home/yongyan.wang/fetchmail.bat'; my $rst = `$cmd`;
Subroutine runFromGmail_old_win32: not called CC=5 SCAR=34.0
Pod undocumented
1303 # my $gmailFName = 'c:/cygwin/var/spool/mail/w'; my $testsuite="";
1304 0 my $gmailFName = 'c:/cygwin/var/spool/mail/yongyan.wang'; my $testsuite="";
1305  
1306 0 ▶if ( -e $gmailFName) { open Fin, $gmailFName; while ($_ = <Fin>) { if ($_ =~ /^\s*subject:\s+Run\s*(.+)\s*$/i) { $testsuite=$1; } } close Fin; }
Branch: 3 branches
BranchTrueFalseTotal
if (-e $gmailFName) 0 0 0
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ /^\s*subject:\s+Run\s*(.+)\s*$/i) 0 0 0
1307  
1308 0 ▶if ($testsuite =~ /^\s*\d+/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($testsuite =~ /^\s*\d+/) { } 0 0 0
1309 0 my $cmd = "c:/strawberry/perl/bin/perl.exe $c/$_TAF/$taf testsuite=".&getTSNameFromTSDesc($testsuite).";exec";
1310 0 my $rst = `$cmd`;
1311 0 print ">>$cmd\n$rst\n";
1312 0 } else { print "\nPlease input the testsuite *Number* (not $testsuite)\n"; }
1313  
1314 0 unlink $gmailFName;
1315 }
1316  
1317  
1318  
1319  
1320 ################################################################################
1321 # Subroutine Name : logTC
1322 # Function: create TC _tcLog.html for each TC
1323 # Input Parameters: Test Case name
1324 # Output/Returns : c:\inetpub\wwwroot\*.html
1325 ################################################################################
1326 sub logTC { # Update TC Log on webUI (TH:WebUI)
1327 0 ▶ my $currentTime = &UnixDate( "now", "%m/%d/%Y %H:%M:%S %Z" );
Subroutine logTC: not called CC=17 SCAR=57.2
Pod undocumented
1328 0 my $tcname = shift; $tcname = &getTCName ($tcname);
1329 0 ▶ if (&getTCLogFname($tcname) =~ /_tcLog\.txt\s*$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if (&getTCLogFname($tcname) =~ /_tcLog\.txt\s*$/) { } 0 0 0
elsif (&getTCLogFname($tcname) =~ /_tcLogAppend\.txt\s*$/ or &getTCLogFname_($tcname) =~ /_tcLogAppend_\.txt\s*$/ or &getTCLogFname__($tcname) =~ /_tcLogAppend__\.txt\s*$/) { } 0 0 0
1330 0 my $webLogText = &readFile("$tcname/_tcLog.html");
1331 0 $webLogText =~ s/<html>\s*<body>\s*<pre>\s*//;
1332 0 $webLogText =~ s/<\/pre>\s*<\/body>\s*<\/html>\s*//;
1333 0 $webLogText =~ s/\n/_nl_/g;
1334 0 $webLogText =~ s/\s*_nl_\s*/\n/g;
1335 0 my $fileText = &readFile(&getTCLogFname($tcname));
1336 0 my $fileText_= &readFile(&getTCLogFname_($tcname)); # for _tcLogAppendix_.txt (pyAnvil logs)
1337 0 my $fileText__= &readFile(&getTCLogFname__($tcname)); # for _tcLogAppendix_.txt (pyAnvil logs)
1338 0 ▶ if (-e $tcname) {;} else {mkpath $tcname;}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcname) { } 0 0 0
1339 0 ▶ open Fout, "> $tcname/_tcLog.html" || die "Warning: $tcname/_tcLog.html doesn't exist\n";
Condition0%0/2
"> $tcname/_tcLog.html" || die("Warning: $tcname/_tcLog.html doesn't exist\n")
l!l
00
MC/DC0%0/1
"> $tcname/_tcLog.html" || die("Warning: $tcname/_tcLog.html doesn't exist\n")
"> $tcname/_tcLog.html"
Truth table0%0/2
A
A= "> $tcname/_tcLog.html"
Aresult
11
00
1340 0 print Fout &prJScript();
1341 0 print Fout "==================== Update on $currentTime Start ===================== $tcname\n";
1342 0 ▶ print Fout $fileText__ if ($fileText__);
Branch: 1 branch
BranchTrueFalseTotal
if $fileText__ 0 0 0
1343 0 ▶ print Fout $fileText_ if ($fileText_);
Branch: 1 branch
BranchTrueFalseTotal
if $fileText_ 0 0 0
1344 0 print Fout $fileText;
1345 0 print Fout "\n==================== Update on $currentTime End ===================== $tcname\n\n";
1346 0 print Fout "</pre></body></html>\n";
1347 0 print Fout "<style type=\"text/css\"> a { text-decoration:none} </style>\n";
1348 0 close Fout;
1349 ▶ } elsif ((&getTCLogFname ($tcname) =~ /_tcLogAppend\.txt\s*$/) || (&getTCLogFname_ ($tcname) =~ /_tcLogAppend_\.txt\s*$/) ||(&getTCLogFname__ ($tcname) =~ /_tcLogAppend__\.txt\s*$/) ){
Condition0%0/6
&getTCLogFname($tcname) =~ /_tcLogAppend\.txt\s*$/ or &getTCLogFname_($tcname) =~ /_tcLogAppend_\.txt\s*$/ or &getTCLogFname__($tcname) =~ /_tcLogAppend__\.txt\s*$/
l!l&&r!l&&!r
000
&getTCLogFname($tcname) =~ /_tcLogAppend\.txt\s*$/ or &getTCLogFname_($tcname) =~ /_tcLogAppend_\.txt\s*$/
l!l&&r!l&&!r
000
MC/DC0%0/3
&getTCLogFname($tcname) =~ /_tcLogAppend\.txt\s*$/ or &getTCLogFname_($tcname) =~ /_tcLogAppend_\.txt\s*$/ or &getTCLogFname__($tcname) =~ /_tcLogAppend__\.txt\s*$/
&getTCLogFname($tcname) =~ /_tcLogAppend\.txt\s*$/ &getTCLogFname_($tcname) =~ /_tcLogAppend_\.txt\s*$/ &getTCLogFname__($tcname) =~ /_tcLogAppend__\.txt\s*$/
Truth table0%0/4
A or B or C
A= &getTCLogFname($tcname) =~ /_tcLogAppend\.txt\s*$/B= &getTCLogFname_($tcname) =~ /_tcLogAppend_\.txt\s*$/C= &getTCLogFname__($tcname) =~ /_tcLogAppend__\.txt\s*$/
ABCresult
1XX1
01X1
0011
0000
1350 0 my $webLogText = &readFile("$tcname/_tcLog.html");
1351 0 $webLogText =~ s/<html>\s*<body>\s*<pre>\s*//;
1352 0 $webLogText =~ s/<\/pre>\s*<\/body>\s*<\/html>\s*//;
1353 0 $webLogText =~ s/\n/_nl_/g;
1354 0 $webLogText =~ s/\s*_nl_\s*/\n/g;
1355 0 $webLogText =~ s/^\s*//g;
1356  
1357 0 my $fileText = &readFile(&getTCLogFname($tcname));
1358 0 my $fileText_ = &readFile(&getTCLogFname_($tcname)); # for _tcLogAppendix_.txt (pyAnvil logs)
1359 0 my $fileText__= &readFile(&getTCLogFname__($tcname)); # for _tcLogAppendix_.txt (pyAnvil logs)
1360
1361 ######## add html tags to $fileText_ #######
1362 0 ▶ if ($fileText_) {$fileText_ = &addURLs($fileText_); }
Branch: 1 branch
BranchTrueFalseTotal
if ($fileText_) 0 0 0
1363 0 ▶ if ($fileText ) {$fileText = &addURLs($fileText ); }
Branch: 1 branch
BranchTrueFalseTotal
if ($fileText) 0 0 0
1364 ######## add html tags to $fileText_ #######
1365  
1366 0 ▶ if (-e $tcname) {;} else {mkpath $tcname;}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcname) { } 0 0 0
1367 0 ▶ open Fout, "> $tcname/_tcLog.html" || die "Warning: $tcname/_tcLog.html doesn't exist\n";
Condition0%0/2
"> $tcname/_tcLog.html" || die("Warning: $tcname/_tcLog.html doesn't exist\n")
l!l
00
MC/DC0%0/1
"> $tcname/_tcLog.html" || die("Warning: $tcname/_tcLog.html doesn't exist\n")
"> $tcname/_tcLog.html"
Truth table0%0/2
A
A= "> $tcname/_tcLog.html"
Aresult
11
00
1368 0 print Fout &prJScript();
1369 0 print Fout "==================== Update on $currentTime Start ===================== $tcname\n";
1370 0 ▶ print Fout $fileText__ if ($fileText__);
Branch: 1 branch
BranchTrueFalseTotal
if $fileText__ 0 0 0
1371 0 ▶ print Fout $fileText_ if ($fileText_);
Branch: 1 branch
BranchTrueFalseTotal
if $fileText_ 0 0 0
1372 0 print Fout $fileText;
1373 0 print Fout "\n==================== Update on $currentTime End ===================== $tcname\n\n";
1374 0 print Fout $webLogText;
1375 0 print Fout "</pre></body></html>\n";
1376 0 print Fout "<style type=\"text/css\"> a { text-decoration:none} </style>\n";
1377 0 close Fout;
1378 } else {
1379 0 ▶ if (-e "$tcname/_tcLog.html") {;} else {mkpath $tcname;
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcname/_tcLog.html") { } 0 0 0
1380 0 ▶ open Fout, "> $tcname/_tcLog.html" || die "Warning: $tcname/_tcLog.html doesn't exist\n";
Condition0%0/2
"> $tcname/_tcLog.html" || die("Warning: $tcname/_tcLog.html doesn't exist\n")
l!l
00
MC/DC0%0/1
"> $tcname/_tcLog.html" || die("Warning: $tcname/_tcLog.html doesn't exist\n")
"> $tcname/_tcLog.html"
Truth table0%0/2
A
A= "> $tcname/_tcLog.html"
Aresult
11
00
1381 0 print Fout &prJScript();
1382 0 my $dirRoot = &getRoot($tcname);
1383 0 my $tcPropertyPatternPattern_ = ".*"; ####################### Reset the tcPropertyPatternPattern for index.htm
1384 0 my $runTCOnce = "<a href=\"${url}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseExec=$dirRoot;ExecutionType=runTC;exec')\" title=\"**JScript**: Generate Logs e.g. $tcname/_tcLogAppend.txt \">St</a>";
1385
1386  
1387 0 my $runTCOnceHttp = "<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseExec=$dirRoot;ExecutionType=runTC;exec_realSemi_tafRedirectory=${urlHttp}/$SvrProjName/$reportHtml_http\" title=\"**Http**: Generate Logs e.g. $tcname/_tcLogAppend.txt\">Art</a>";
1388 0 $runTCOnceHttp =~ s/;/_semi_/g; $runTCOnceHttp=~ s/_realSemi_/$_realSemi_/g;
1389 # $runTCOnceHttp =~ s/;/_semi_/g; $runTCOnceHttp=~ s/_realSemi_/;/g; linux porting
1390  
1391 0 print Fout "==================== Update on $currentTime ${runTCOnce}$runTCOnceHttp ===================== $tcname\n";
1392 0 print Fout "$tcname has no log\n";
1393 0 print Fout "==================== Update on $currentTime End ===================== $tcname\n\n";
1394 0 print Fout "\n\n<font color=\"white\">-------------------------AutomationFramework generated tcDriver -----------------------\n $tcname/tc.pl:\n". &readFile ("$tcname/$tc_pl") ;
1395 0 print Fout "-------------------------AutomationFramework generated tcDriver ------------------------<font>";
1396 0 print Fout "</pre></body></html>\n";
1397 0 print Fout "<style type=\"text/css\"> a { text-decoration:none} </style>\n";
1398 0 close Fout;
1399 }
1400  
1401 }
1402 0 rmtree &getTCLogFname ($tcname) ;
1403 0 rmtree &getTCLogFname_ ($tcname) ;
1404 0 rmtree &getTCLogFname__ ($tcname) ;
1405 0 return " tcLog[Append].[txt|html] are refreshed";
1406 }
1407  
1408  
1409 sub addURLs {
1410 0 ▶ my $return="";
Subroutine addURLs: not called CC=14 SCAR=53.5
Pod undocumented
1411 0 foreach my $each (split "\n", shift ) {
1412 0 $_ = $each;
1413 #### The followings are for Powershell only
1414 #s/_/_underscore_/g; s/\s/_ws_/g; s/\./_dot_/g; s/\\/_backslash_/g; s/\//_slash_/g; s/:/_col_/g; s/-/_dash_/g; s/\(/_leftPara/g; s/\)/_rightPara/g; s/</_lessThan/g; s/>/_greaterThan/g;s/=/_equal/g;
1415 #s/"/_doubleQuote/g; s/'/_singleQuote/g; s/\$/_dollar_/g; s/\%/_percentage_/g; s/\@/_at_/g; s/;/_semiColumn_/g;
1416 #s/\W//g;
1417 #s/\_ws_/ /g; s/_dot_/\./g; s/_backslash_/\\/g; s/_slash_/\//g; s/_col_/:/g; s/_dash_/-/g; s/_underscore_/_/g; s/_leftPara/\(/g; s/_rightPara/\)/g; s/_lessThan/</g; s/_greaterThan/>/g;s/_equal/=/g;
1418 #s/_doubleQuote/"/g; s/_singleQuote/'/g; s/_dollar_/\$/g; s/_percentage_/\%/g; s/_at_/\@/g; s/_semiColumn_/;/g;
1419  
1420 0 my $c_ = $c; my $_TAF_ = $_TAF; my $SvrProjName_ = $SvrProjName;
1421 0 ▶ if ($SvrProjName_ =~ s/^$c_// ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($SvrProjName_ =~ s/^$c_//) { } 0 0 0
1422 ;
1423 } else {
1424 ;
1425 # print "\nInfo: $SvrProjName_ might have problem with the build-in file link (*.txt) \n($SvrProjName_ !~ $c_)\n\n" if ($^O =~ /linux/); #### debug info:
1426 }
1427  
1428  
1429 # if (($_ !~ /href=\"/) && ($_ =~ /(.+)?($c\S+)\s?(.+)?/i) &&($_ !~ /_url_line_/i)) { # convert c:\abc.txt or c:/efg.txt <a href file= abc.txt </a>
1430 0 ▶ if (($_ !~ /href=\"/) && ($_ =~ /(.+)?($c\S+)\s?(.+)?/i) &&($_ !~ /_url_line_/i) && ($_ !~ /_cmd_line_/i) && ($_ !~ /\-runAsCmd/i)) { # convert c:\abc.txt or c:/efg.txt <a href file= abc.txt </a>
Branch: 1 branch
BranchTrueFalseTotal
if (not $_ =~ /href=\"/ and $_ =~ /(.+)?($c\S+)\s?(.+)?/i and not $_ =~ /_url_line_/i and not $_ =~ /_cmd_line_/i and not $_ =~ /\-runAsCmd/i) { } 0 0 0
Condition0%0/12
not $_ =~ /href=\"/ and $_ =~ /(.+)?($c\S+)\s?(.+)?/i and not $_ =~ /_url_line_/i and not $_ =~ /_cmd_line_/i and not $_ =~ /\-runAsCmd/i
!ll&&!rl&&r
000
not $_ =~ /href=\"/ and $_ =~ /(.+)?($c\S+)\s?(.+)?/i and not $_ =~ /_url_line_/i and not $_ =~ /_cmd_line_/i
!ll&&!rl&&r
000
not $_ =~ /href=\"/ and $_ =~ /(.+)?($c\S+)\s?(.+)?/i and not $_ =~ /_url_line_/i
!ll&&!rl&&r
000
not $_ =~ /href=\"/ and $_ =~ /(.+)?($c\S+)\s?(.+)?/i
!ll&&!rl&&r
000
MC/DC0%0/5
not $_ =~ /href=\"/ and $_ =~ /(.+)?($c\S+)\s?(.+)?/i and not $_ =~ /_url_line_/i and not $_ =~ /_cmd_line_/i and not $_ =~ /\-runAsCmd/i
not $_ =~ /href=\"/ $_ =~ /(.+)?($c\S+)\s?(.+)?/i not $_ =~ /_url_line_/i not $_ =~ /_cmd_line_/i not $_ =~ /\-runAsCmd/i
Truth table0%0/6
not(A) and B and not(C) and not(D) and not(E)
A= not $_ =~ /href=\"/B= $_ =~ /(.+)?($c\S+)\s?(.+)?/iC= not $_ =~ /_url_line_/iD= not $_ =~ /_cmd_line_/iE= not $_ =~ /\-runAsCmd/i
ABCDEresult
0XXXX0
10XXX0
110XX0
1110X0
111100
111111
1431 0 $_ =~ s/</__lt__/g; $_ =~ s/>/__gt__/g;
1432 0 $_ =~ /(.+)?($c\S+)\s?(.+)?/i;
1433 0 ▶ my $match1 = $1; my $logNameInLog = $2; my $match3=""; if ($3) {$match3 = $3."\n";;}
Branch: 1 branch
BranchTrueFalseTotal
if ($3) 0 0 0
1434 #if ($logNameInLog =~ /\.txt\s*$/) {
1435 0 ▶ if (($logNameInLog =~ /\.txt\s*$/) || ($logNameInLog =~ /\.htm\s*$/)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($logNameInLog =~ /\.txt\s*$/ or $logNameInLog =~ /\.htm\s*$/) { } 0 0 0
Condition0%0/3
$logNameInLog =~ /\.txt\s*$/ or $logNameInLog =~ /\.htm\s*$/
l!l&&r!l&&!r
000
MC/DC0%0/2
$logNameInLog =~ /\.txt\s*$/ or $logNameInLog =~ /\.htm\s*$/
$logNameInLog =~ /\.txt\s*$/ $logNameInLog =~ /\.htm\s*$/
Truth table0%0/3
A or B
A= $logNameInLog =~ /\.txt\s*$/B= $logNameInLog =~ /\.htm\s*$/
ABresult
1X1
011
000
1436 0 $logNameInLog =~ s/\\/\//g;
1437 0 my $currentTime = &UnixDate( "now", "%m-%d-%Y-%H_%M_%S" );
1438 0 my $fileFrom = $logNameInLog ;
1439 0 my $fileToFile = &getTCName()."/".&getRoot_4($logNameInLog); $fileToFile =~ s/\.txt\s*$/_$currentTime\.txt/;
1440 0 my $fileToHttp = &getTCName()."/".&getRoot_4($logNameInLog); $fileToHttp =~ s/\.txt\s*$/_$currentTime\.txt/;
1441 0 $_ =~ s/__lt__/&lt;/g; $_ =~ s/__gt__/&gt;/g;
1442 0 ▶ if ( -e $fileFrom ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fileFrom) { } 0 0 0
1443 0 ▶ if ( -e &getDir($fileToFile)){ ; } else {mkpath &getDir($fileToFile); }
Branch: 1 branch
BranchTrueFalseTotal
if (-e &getDir($fileToFile)) { } 0 0 0
1444 # copy ($fileFrom, $fileToFile);
1445 0 &addHtml ($fileFrom, $fileToFile);
1446 0 $fileToHttp =~ s/$c\/$_TAF/${ip}${http_port}/;
1447 0 $return = $return.$match1."<a href=\"http://$fileToHttp\" >(http:$fileFrom)</a> $match3";
1448 #### tech reserver $return = $return.$match1."<a href=\"file:////$fileToFile\">(file:$fileFrom)</a> $match3";
1449 } else {
1450 0 $return = $return.$match1."Warning: Log $fileFrom doesn't exist! $match3";
1451 }
1452 } else {
1453 0 $return = $return.$_."\n";
1454 }
1455 } else {
1456 0 ▶ if ($_ =~ s/_url_line_//i) {; } else {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ s/_url_line_//i) { } 0 0 0
1457 0 $_ =~ s/</__lt__/g; $_ =~ s/>/__gt__/g;
1458 0 $_ =~ s/__lt__/&lt;/g; $_ =~ s/__gt__/&gt;/g;
1459 }
1460 0 $return = $return.$_."\n";
1461 }
1462 }
1463 0 $return =~ s/__lt__/&lt;/g; $return =~ s/__gt__/&gt;/g; ###
1464 0 $return ;
1465 }
1466 sub addURLs_old {
1467 0 ▶ my $return="";
Subroutine addURLs_old: not called CC=6 SCAR=37.4
Pod undocumented
1468 0 foreach my $each (split "\n", shift ) {
1469  
1470 0 $_ = $each;
1471 0 s/_/_underscore_/g; s/\s/_ws_/g; s/\./_dot_/g; s/\\/_backslash_/g; s/\//_slash_/g; s/:/_col_/g; s/-/_dash_/g; s/\(/_leftPara/g; s/\)/_rightPara/g; s/</_lessThan/g; s/>/_greaterThan/g;s/=/_equal/g;
1472 0 s/"/_doubleQuote/g;
1473 0 s/'/_singleQuote/g;
1474 0 s/\$/_dollar_/g;
1475 0 s/\%/_percentage_/g;
1476 0 s/\@/_at_/g;
1477 0 s/;/_semiColumn_/g;
1478 0 s/\W//g;
1479 0 s/\_ws_/ /g; s/_dot_/\./g; s/_backslash_/\\/g; s/_slash_/\//g; s/_col_/:/g; s/_dash_/-/g; s/_underscore_/_/g; s/_leftPara/\(/g; s/_rightPara/\)/g; s/_lessThan/</g; s/_greaterThan/>/g;s/_equal/=/g;
1480 0 s/_doubleQuote/"/g;
1481 0 s/_singleQuote/'/g;
1482 0 s/_dollar_/\$/g;
1483 0 s/_percentage_/\%/g;
1484 0 s/_at_/\@/g;
1485 0 s/_semiColumn_/;/g;
1486 0 ▶ if (($_ !~ /href=\"/) && ($_ =~ /(.+)($c\S+)\s?(.+)?/i)) { # convert c:\abc.txt <a href file= abc.txt </a>
Branch: 1 branch
BranchTrueFalseTotal
if (not $_ =~ /href=\"/ and $_ =~ /(.+)($c\S+)\s?(.+)?/i) { } 0 0 0
Condition0%0/3
not $_ =~ /href=\"/ and $_ =~ /(.+)($c\S+)\s?(.+)?/i
!ll&&!rl&&r
000
MC/DC0%0/2
not $_ =~ /href=\"/ and $_ =~ /(.+)($c\S+)\s?(.+)?/i
not $_ =~ /href=\"/ $_ =~ /(.+)($c\S+)\s?(.+)?/i
Truth table0%0/3
not(A) and B
A= not $_ =~ /href=\"/B= $_ =~ /(.+)($c\S+)\s?(.+)?/i
ABresult
0X0
100
111
1487 0 ▶ my $match1 = $1; my $match2 = $2; my $match3=""; if ($3) {$match3 = $3;}
Branch: 1 branch
BranchTrueFalseTotal
if ($3) 0 0 0
1488  
1489 0 ▶ if ($match2 =~ /\.txt\s*$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($match2 =~ /\.txt\s*$/) { } 0 0 0
1490 0 my $currentTime = &UnixDate( "now", "%m-%d-%Y-%H_%M_%S" );
1491 0 my $fileFrom = $match2;
1492 0 my $fileTo = $match2; $fileTo =~ s/\.txt\s*$/_$currentTime\.txt/;
1493 #copy ($fileFrom, $fileTo);
1494 0 &addHtml ($fileFrom, $fileTo);
1495 0 $return = $return.$match1."<a href=\"file:////$fileTo\">$fileTo</a>$match3\n";
1496 } else {
1497 0 $return = $return.$_."\n";
1498 }
1499 } else {
1500 0 $return = $return.$_."\n";
1501 }
1502 }
1503  
1504 0 $return ;
1505 }
1506  
1507 sub addHtml {
1508 0 ▶ my $FNameFrom = shift; my $FNameTo = shift; my $str;
Subroutine addHtml: not called CC=5 SCAR=34.0
Pod undocumented
1509 0 ▶ if (-e &getDir($FNameTo)) {;} else { mkpath &getDir($FNameTo);}
Branch: 1 branch
BranchTrueFalseTotal
if (-e &getDir($FNameTo)) { } 0 0 0
1510 0 ▶ if (-e $FNameFrom) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $FNameFrom) { } 0 0 0
1511 0 open FNameTo , ">$FNameTo";
1512 0 open FNameFrom, $FNameFrom ; @_ = <FNameFrom>; $str .= "@_"; close FNameFrom;
1513
1514 0 $str =~ s/\r|\n/_realReturn_/ig;
1515 0 $str =~ s/\x{d}/_return_/ig; $str =~ s/\s*\x{8}//ig; # processing return and BS
1516 0 $str =~ s/_return_/....../g; # $str =~ s/\s+/_space_/g; $str =~ s/_space_/ /g;
1517 0 ▶ $str =~ s/</ ..../ig if ($str !~ /<a/);
Branch: 1 branch
BranchTrueFalseTotal
unless $str =~ /<a/ 0 0 0
1518 0 ▶ $str =~ s/>/ ..../ig if ($str !~ /a>/);
Branch: 1 branch
BranchTrueFalseTotal
unless $str =~ /a>/ 0 0 0
1519 0 $str =~ s/(_realReturn_)+/\n/g;
1520 0 $str = "\n<pre>\n$str\n</pre>\n";
1521  
1522 0 print FNameTo $str;
1523 0 close FNameTo;
1524 } else {
1525 0 print "Warning: addHtml: $FNameFrom deesn't exist!\n";
1526 }
1527  
1528 }
1529 sub addHtml_v1 {
1530 0 ▶ my $FNameFrom = shift; my $FNameTo = shift; my $str;
Subroutine addHtml_v1: not called CC=3 SCAR=24.8
Pod undocumented
1531 0 ▶ if (-e &getDir($FNameTo)) {;} else { mkpath &getDir($FNameTo);}
Branch: 1 branch
BranchTrueFalseTotal
if (-e &getDir($FNameTo)) { } 0 0 0
1532 0 ▶ if (-e $FNameFrom) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $FNameFrom) { } 0 0 0
1533 0 open FNameTo , ">$FNameTo";
1534 0 open FNameFrom, $FNameFrom ; @_ = <FNameFrom>; $str .= "@_"; close FNameFrom;
1535
1536 0 $str =~ s/\r|\n/_realReturn_/ig;
1537 0 $str =~ s/\x{d}/_return_/ig; $str =~ s/\s*\x{8}//ig; # processing return and BS
1538 0 $str =~ s/_return_/....../g; $str =~ s/\s+/_space_/g; $str =~ s/_space_/ /g;
1539 0 $str =~ s/</ ..../ig ; #if ($str !~ /<a/);
1540 0 $str =~ s/>/ ..../ig ; # if ($str !~ /a>/);
1541 0 $str =~ s/(_realReturn_)+/\n/g;
1542 0 $str = "\n<pre>\n$str\n</pre>\n";
1543  
1544 0 print FNameTo $str;
1545 0 close FNameTo;
1546 } else {
1547 0 print "Warning: addHtml: $FNameFrom deesn't exist!\n";
1548 }
1549  
1550 }
1551 sub addHtml_v0 {
1552 0 ▶ my $FNameFrom = shift; my $FNameTo = shift;
Subroutine addHtml_v0: not called CC=3 SCAR=24.8
Pod undocumented
1553 0 ▶ if (-e &getDir($FNameTo)) {;} else { mkpath &getDir($FNameTo);}
Branch: 1 branch
BranchTrueFalseTotal
if (-e &getDir($FNameTo)) { } 0 0 0
1554 0 ▶ if (-e $FNameFrom) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $FNameFrom) { } 0 0 0
1555 0 open FNameTo , ">$FNameTo";
1556 0 print FNameTo "\n<pre>\n";
1557 0 open FNameFrom, $FNameFrom ; @_ = <FNameFrom>;
1558 0 my $str = "@_";
1559 0 $str =~ s/\x{d}+/_rtn_/ig;
1560 0 $str =~ s/\x{d}+/_rtn_/ig;
1561 0 $str =~ s/\x{d}+/_rtn_/ig;
1562 0 $str =~ s/\x{d}+/_rtn_/ig;
1563 0 $str =~ s/\x{d}+/_rtn_/ig;
1564 0 $str =~ s/\s*\x{8}/_bs_/ig;
1565 #print FNameTo "@_";
1566 0 print FNameTo $str;
1567 0 print FNameTo "</pre>\n";
1568 0 close FNameFrom;
1569 0 close FNameTo;
1570 } else {
1571 0 print "Warning: addHtml: $FNameFrom deesn't exist!\n";
1572 }
1573  
1574 }
1575  
1576 sub ps12txt {
1577 0 ▶ my $return="";
Subroutine ps12txt: not called CC=2 SCAR=17.9
Pod undocumented
1578 0 foreach my $each (split "\n", shift ) {
1579 0 $_ = $each;
1580 0 s/_/_underscore_/g; s/\s/_ws_/g; s/\./_dot_/g; s/\\/_backslash_/g; s/\//_slash_/g; s/:/_col_/g; s/-/_dash_/g;
1581 0 s/\W//g;
1582 0 s/\_ws_/ /g; s/_dot_/\./g; s/_backslash_/\\/g; s/_slash_/\//g; s/_col_/:/g; s/_dash_/-/g; s/_underscore_/_/g;
1583 0 s/^\s*//g;
1584 0 $return = $return."\n".$_;
1585 }
1586 0 $return ;
1587 }
1588  
1589 sub addUrl {
1590 0 ▶ my $return; my $str = shift;
Subroutine addUrl: not called CC=4 SCAR=30.0
Pod undocumented
1591 0 foreach my $each (split /\n/, $str) {
1592 0 ▶ if ($each =~ /^\s*(.+\.html)/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($each =~ /^\s*(.+\.html)/) { } 0 0 0
elsif ($each =~ /^\s*(.+\.xml)/) { } 0 0 0
1593 0 my $line = $1;
1594 0 $line =~ s/^\s*//g;
1595 0 $line =~ s/\s*$//g;
1596 0 $line =~ s/\\/\//g;
1597 0 $line =~ s/HTML:\s*/file:\/\/\//i;
1598 0 $line =~ s//file:\/\/\//;
1599 0 $return = $return. "<a href=\"$line\">$each</a>\n";
1600 } elsif ($each =~ /^\s*(.+\.xml)/) {
1601 0 my $line = $1;
1602 0 $line =~ s/^\s*//g;
1603 0 $line =~ s/\s*$//g;
1604 0 $line =~ s/\\/\//g;
1605 0 $line =~ s/XML:\s*/file:\/\/\//i;
1606 0 $line =~ s//file:\/\/\//;
1607 0 $return = $return. "<a href=\"$line\">$each</a>\n";
1608 } else {
1609 0 $return = $return.$each."\n";
1610 }
1611 }
1612 0 return $return;
1613 }
1614  
1615 ################################################################################
1616 # Subroutine Name : getTCLogFname
1617 # Function: get valid Log (new log) fname
1618 # Input Parameters: c:\TC*\_thLog.txt
1619 # Output/Returns : noLog or hasWWWLog
1620 ################################################################################
1621 sub getTCLogFname { # Determine if a log exists (TH:TC Report)
1622 2 ▶ my $tcName = shift;
Subroutine getTCLogFname: called CC=6 SCAR=19.0
Pod undocumented
1623 2 my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1624 $size, $atime, $mtimePropertyFile, $ctime, $blksize, $blocks
1625 );
1626 2 my $mtimeLogWeb;
1627  
1628 2 ▶ if (-e $tcName.'/thProperty.txt' )
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcName . '/thProperty.txt') 1 1 2
1629 {
1630 (
1631 1 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1632 $size, $atime, $mtimePropertyFile, $ctime, $blksize, $blocks
1633 ) = stat($tcName.'/'.'thProperty.txt');
1634 }
1635 2 my $tcNameLog = $tcName."/_tcLogAppend.txt";
1636 2 ▶ if (-e $tcNameLog) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcNameLog) 1 1 2
1637 my (
1638 1 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1639 $size, $atime, $mtimeLog, $ctime, $blksize, $blocks
1640 ) = stat($tcNameLog);
1641 1 ▶ if ($mtimePropertyFile - $mtimeLog>= 0 ) { return $tcNameLog; }
Branch: 1 branch
BranchTrueFalseTotal
if ($mtimePropertyFile - $mtimeLog >= 0) 1 0 1
1642 }
1643  
1644 1 $tcNameLog = "$tcName/_tcLog.txt";
1645 1 ▶ if (-e $tcNameLog) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcNameLog) 0 1 1
1646 my (
1647 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1648 $size, $atime, $mtimeLog, $ctime, $blksize, $blocks
1649 ) = stat($tcNameLog);
1650 0 ▶ if ( $mtimePropertyFile - $mtimeLog>= 2 ) { return $tcNameLog; }
Branch: 1 branch
BranchTrueFalseTotal
if ($mtimePropertyFile - $mtimeLog >= 2) 0 0 0
1651 }
1652 1 return "noLog";
1653 }
1654  
1655 sub getTCLogFname_ { # Determine if a log exists (TH:TC Report)
1656 0 ▶ my $tcName = shift;
Subroutine getTCLogFname_: not called CC=6 SCAR=37.4
Pod undocumented
1657 0 my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1658 $size, $atime, $mtimePropertyFile, $ctime, $blksize, $blocks
1659 );
1660 0 my $mtimeLogWeb;
1661  
1662 0 ▶ if (-e $tcName.'/thProperty.txt' )
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcName . '/thProperty.txt') 0 0 0
1663 {
1664 (
1665 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1666 $size, $atime, $mtimePropertyFile, $ctime, $blksize, $blocks
1667 ) = stat($tcName.'/'.'thProperty.txt');
1668 }
1669  
1670 0 my $tcNameLog = $tcName."/_tcLogAppend_.txt";
1671 0 ▶ if (-e $tcNameLog) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcNameLog) 0 0 0
1672 my (
1673 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1674 $size, $atime, $mtimeLog, $ctime, $blksize, $blocks
1675 ) = stat($tcNameLog);
1676 0 ▶ if ($mtimePropertyFile - $mtimeLog>= 0 ) { return $tcNameLog; }
Branch: 1 branch
BranchTrueFalseTotal
if ($mtimePropertyFile - $mtimeLog >= 0) 0 0 0
1677 }
1678  
1679 0 $tcNameLog = "$tcName/_tcLog_.txt";
1680 0 ▶ if (-e $tcNameLog) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcNameLog) 0 0 0
1681 my (
1682 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1683 $size, $atime, $mtimeLog, $ctime, $blksize, $blocks
1684 ) = stat($tcNameLog);
1685 0 ▶ if ( $mtimePropertyFile - $mtimeLog>= 2 ) { return $tcNameLog; }
Branch: 1 branch
BranchTrueFalseTotal
if ($mtimePropertyFile - $mtimeLog >= 2) 0 0 0
1686 }
1687 0 return "noLog";
1688 }
1689  
1690 sub getTCLogFname__ { # Determine if a log exists (TH:TC Report)
1691 0 ▶ my $tcName = shift;
Subroutine getTCLogFname__: not called CC=6 SCAR=37.4
Pod undocumented
1692 0 my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1693 $size, $atime, $mtimePropertyFile, $ctime, $blksize, $blocks
1694 );
1695 0 my $mtimeLogWeb;
1696  
1697 0 ▶ if (-e $tcName.'/thProperty.txt' )
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcName . '/thProperty.txt') 0 0 0
1698 {
1699 (
1700 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1701 $size, $atime, $mtimePropertyFile, $ctime, $blksize, $blocks
1702 ) = stat($tcName.'/'.'thProperty.txt');
1703 }
1704  
1705 0 my $tcNameLog = $tcName."/_tcLogAppend__.txt";
1706 0 ▶ if (-e $tcNameLog) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcNameLog) 0 0 0
1707 my (
1708 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1709 $size, $atime, $mtimeLog, $ctime, $blksize, $blocks
1710 ) = stat($tcNameLog);
1711 0 ▶ if ($mtimePropertyFile - $mtimeLog>= 0 ) { return $tcNameLog; }
Branch: 1 branch
BranchTrueFalseTotal
if ($mtimePropertyFile - $mtimeLog >= 0) 0 0 0
1712 }
1713  
1714 0 $tcNameLog = "$tcName/_tcLog__.txt";
1715 0 ▶ if (-e $tcNameLog) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcNameLog) 0 0 0
1716 my (
1717 0 $dev, $ino, $mode, $nlink, $uid, $gid, $rdev,
1718 $size, $atime, $mtimeLog, $ctime, $blksize, $blocks
1719 ) = stat($tcNameLog);
1720 0 ▶ if ( $mtimePropertyFile - $mtimeLog>= 2 ) { return $tcNameLog; }
Branch: 1 branch
BranchTrueFalseTotal
if ($mtimePropertyFile - $mtimeLog >= 2) 0 0 0
1721 }
1722 0 return "noLog";
1723 }
1724  
1725 sub sortOnDate {
1726 0 ▶ my $return; my %record; my $str = shift; if ($str =~ /^\s*$/) { return " ";}
Subroutine sortOnDate: not called CC=8 SCAR=42.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($str =~ /^\s*$/) 0 0 0
1727 0 ▶ if ($str =~ /^\s*$/) { return "";}
Branch: 1 branch
BranchTrueFalseTotal
if ($str =~ /^\s*$/) 0 0 0
1728 0 @_ = split(/\n/, $str);
1729 0 ▶ foreach my $each (@_) { if ($each =~ /^\s*(\S+)\s+\S+\s+(\d+-\d+-\d+\s+\d+:\d+:\d+\s+).+$/) { my $rst = $1; $record{$2}=$each if ($rst !~ /mark/i && $rst !~ /dumy/i);}}
Branch: 2 branches
BranchTrueFalseTotal
if ($each =~ /^\s*(\S+)\s+\S+\s+(\d+-\d+-\d+\s+\d+:\d+:\d+\s+).+$/) 0 0 0
unless $rst =~ /mark/i or $rst =~ /dumy/i 0 0 0
Condition0%0/3
$rst =~ /mark/i or $rst =~ /dumy/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$rst =~ /mark/i or $rst =~ /dumy/i
$rst =~ /mark/i $rst =~ /dumy/i
Truth table0%0/3
A or B
A= $rst =~ /mark/iB= $rst =~ /dumy/i
ABresult
1X1
011
000
1730 0 foreach my $each (reverse sort keys %record) { $return = $return."$record{$each}\n"; }
1731 0 return $return;
1732 }
1733 sub reportTCSummary {
1734 0 ▶ $reportHtmlSummaryStr = '';
Subroutine reportTCSummary: not called CC=39 SCAR=73.5
Pod undocumented
1735  
1736 0 ▶ if ( -e "$SvrDrive/$SvrProjName/$reportHtmlHistory" ) {;} else { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$SvrDrive/$SvrProjName/$reportHtmlHistory") { } 0 0 0
1737 0 ▶ open Fin, "$SvrDrive/$SvrProjName/$reportHtmlHistory" || die "Can't open _tcReportHistory.html";
Condition0%0/2
"$SvrDrive/$SvrProjName/$reportHtmlHistory" || die(q[Can't open _tcReportHistory.html])
l!l
00
MC/DC0%0/1
"$SvrDrive/$SvrProjName/$reportHtmlHistory" || die(q[Can't open _tcReportHistory.html])
"$SvrDrive/$SvrProjName/$reportHtmlHistory"
Truth table0%0/2
A
A= "$SvrDrive/$SvrProjName/$reportHtmlHistory"
Aresult
11
00
1738  
1739 0 my $fname_ = $SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlSummary."_";
1740 0 ▶ while (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlSummary."_") { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtmlSummary . '_') 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
1741  
1742 0 ▶ open Fout, "> $SvrDrive/$SvrProjName/$reportHtmlSummary"."_" || die "Can't open _tcReportSummary_.html";
Condition0%0/2
"> $SvrDrive/$SvrProjName/$reportHtmlSummary" . '_' || die(q[Can't open _tcReportSummary_.html])
l!l
00
MC/DC0%0/1
"> $SvrDrive/$SvrProjName/$reportHtmlSummary" . '_' || die(q[Can't open _tcReportSummary_.html])
"> $SvrDrive/$SvrProjName/$reportHtmlSummary" . '_'
Truth table0%0/2
A
A= "> $SvrDrive/$SvrProjName/$reportHtmlSummary" . '_'
Aresult
11
00
1743  
1744 0 $reportHtmlSummaryStr = "<html><body><pre>\n"; $reportHtmlSummaryStr = $reportHtmlSummaryStr . "<META http-equiv=\"refresh\" content=\"$htmlRefreshRateWebUI\"> ";
1745 0 $reportHtmlSummaryStr = $reportHtmlSummaryStr . "\n_replace_here_";
1746 0 my $passFail ; my $dateTime; my $date1; my $date2; my %tcResult; my $tcName; my $passCtr=0;
1747 0 my $initStartTime = &UnixDate( "Jan 1, 2050", "%m/%d/%Y %H:%M:%S %Z" );
1748 0 my $endStartTime = &UnixDate( "Jan 1, 1900", "%m/%d/%Y %H:%M:%S %Z" );
1749 0 ▶while ($_ =<Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
1750 0 chop;
1751 0 ▶ if (($_ =~ /(testcase\d+)/) &&( $passCtr ==0 )) {
Branch: 2 branches
BranchTrueFalseTotal
if ($_ =~ /(testcase\d+)/ and $passCtr == 0) { } 0 0 0
elsif (/^\s+(\w+)\s+\w+\s+(\d+\-\d+\-\d+\s+\d+:\d+:\d+\s+)/) { } 0 0 0
Condition0%0/3
$_ =~ /(testcase\d+)/ and $passCtr == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$_ =~ /(testcase\d+)/ and $passCtr == 0
$_ =~ /(testcase\d+)/ $passCtr == 0
Truth table0%0/3
A and B
A= $_ =~ /(testcase\d+)/B= $passCtr == 0
ABresult
0X0
100
111
1752 0 $tcName = $1;
1753 0 $reportHtmlSummaryStr = $reportHtmlSummaryStr . "\n$tcName: ";
1754 0 $_ = <Fin>;
1755 0 ▶ if ($_ =~ /^\s+(\w+)\s+\w+\s+(\d+\-\d+\-\d+\s+\d+:\d+:\d+)\s+/) { # always skip
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^\s+(\w+)\s+\w+\s+(\d+\-\d+\-\d+\s+\d+:\d+:\d+)\s+/) 0 0 0
1756 0 $_ =~ /^\s+(\w+)\s+\w+\s+(\d+\-\d+\-\d+\s+\d+:\d+:\d+)\s+/;
1757 0 $passFail = $1; $dateTime= $2; $date1=&ParseDate($dateTime); my $title=" title=\"$dateTime\"";
1758 0 ▶ if (&Date_Cmp( &ParseDate($initStartTime), &ParseDate($dateTime) ) >=0 ) { $initStartTime = $dateTime; }
Branch: 1 branch
BranchTrueFalseTotal
if (&Date_Cmp(&ParseDate($initStartTime), &ParseDate($dateTime)) >= 0) 0 0 0
1759 0 ▶ if (&Date_Cmp( &ParseDate($endStartTime), &ParseDate($dateTime) ) <=0 ) { $endStartTime = $dateTime; }
Branch: 1 branch
BranchTrueFalseTotal
if (&Date_Cmp(&ParseDate($endStartTime), &ParseDate($dateTime)) <= 0) 0 0 0
1760 0 ▶ if ($passFail =~ /pass/i) { $passFail = '<a style="color:green"'.$title.'>*</a>'; }
Branch: 8 branches
BranchTrueFalseTotal
if ($passFail =~ /pass/i) { } 0 0 0
elsif ($passFail =~ /fail/i) { } 0 0 0
elsif ($passFail =~ /mark/i) { } 0 0 0
elsif ($passFail =~ /Perf/i) { } 0 0 0
elsif ($passFail =~ /null/i) { } 0 0 0
elsif ($passFail =~ /dumy/i) { } 0 0 0
elsif ($passFail =~ /expF/i) { } 0 0 0
elsif ($passFail =~ /bugF/i) { } 0 0 0
1761 0 elsif ($passFail =~ /fail/i) { $passFail = '<a style="color:red"'.$title.'>*</a>';}
1762 0 elsif ($passFail =~ /mark/i) {$passFail ="<a style=\"color:black\"$title>$markSymbol<\/a>";}
1763 0 elsif ($passFail =~ /Perf/i) {$passFail ="<a style=\"color:black\"$title>.<\/a>";}
1764 0 elsif ($passFail =~ /null/i) {$passFail ="<a style=\"color:black\"$title>.<\/a>";}
1765 0 elsif ($passFail =~ /dumy/i) {$passFail ="<a style=\"color:black\"$title> <\/a>";}
1766 0 elsif ($passFail =~ /expF/i) {$passFail ="<a style=\"color:black\"$title>*<\/a>";}
1767 0 elsif ($passFail =~ /bugF/i) {$passFail ="<a style=\"color:blue\"$title>*<\/a>";}
1768 0 $reportHtmlSummaryStr = $reportHtmlSummaryStr . $passFail;
1769 }
1770 } elsif (/^\s+(\w+)\s+\w+\s+(\d+\-\d+\-\d+\s+\d+:\d+:\d+\s+)/) {
1771 0 $_ =~ /^\s+(\w+)\s+\w+\s+(\d+\-\d+\-\d+\s+\d+:\d+:\d+)\s+(.+)/;
1772 0 my $note=$3;
1773 0 $passFail = $1; $dateTime= $2; $date2=&ParseDate($dateTime);
1774 0 my $title = " title=\"$dateTime $note\"";
1775  
1776 0 ▶ if ($passFail =~ /pass/i) { $passFail = '<a style="color:green"'.$title.'>*</a>'; }
Branch: 9 branches
BranchTrueFalseTotal
if ($passFail =~ /pass/i) { } 0 0 0
elsif ($passFail =~ /fail/i) { } 0 0 0
elsif ($passFail =~ /null/i) { } 0 0 0
elsif ($passFail =~ /mark/i) { } 0 0 0
elsif ($passFail =~ /Perf/i) { } 0 0 0
elsif ($passFail =~ /null/i) { } 0 0 0
elsif ($passFail =~ /dumy/i) { } 0 0 0
elsif ($passFail =~ /expF/i) { } 0 0 0
elsif ($passFail =~ /bugF/i) { } 0 0 0
1777 0 elsif ($passFail =~ /fail/i) { $passFail = '<a style="color:red"'.$title.'>*</a>';}
1778 0 elsif ($passFail =~ /null/i) { $passFail = '<a style="color:black"'.$title.'>.</a>';}
1779 0 elsif ($passFail =~ /mark/i) {$passFail ="<a style=\"color:black\"$title>$markSymbol<\/a>";}
1780 0 elsif ($passFail =~ /Perf/i) {$passFail ="<a style=\"color:black\"$title>.<\/a>";}
1781 0 elsif ($passFail =~ /null/i) {$passFail ="<a style=\"color:black\"$title>.<\/a>";}
1782 0 elsif ($passFail =~ /dumy/i) {$passFail ="<a style=\"color:black\"$title> <\/a>";}
1783 0 elsif ($passFail =~ /expF/i) {$passFail ="<a style=\"color:black\"$title>*<\/a>";}
1784 0 elsif ($passFail =~ /bugF/i) {$passFail ="<a style=\"color:blue\"$title>*<\/a>";}
1785 0 ▶ if (&Date_Cmp( &ParseDate($initStartTime), &ParseDate($dateTime) ) >=0 ) { $initStartTime = $dateTime; }
Branch: 1 branch
BranchTrueFalseTotal
if (&Date_Cmp(&ParseDate($initStartTime), &ParseDate($dateTime)) >= 0) 0 0 0
1786 0 ▶ if (&Date_Cmp( &ParseDate($endStartTime), &ParseDate($dateTime) ) <=0 ) { $endStartTime = $dateTime; }
Branch: 1 branch
BranchTrueFalseTotal
if (&Date_Cmp(&ParseDate($endStartTime), &ParseDate($dateTime)) <= 0) 0 0 0
1787  
1788 0 my $delta=&DateCalc($date2,$date1); $delta =~ s/\+//g; my ($Y,$M,$W,$D,$H,$MIN,$S) = split /:/, $delta;
1789 0 my $totalMIN ;
1790 0 ▶ if ($Y && $M && $D && $H && $MIN && $S && $reportHtmlSummaryScale) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Y and $M and $D and $H and $MIN and $S and $reportHtmlSummaryScale) { } 0 0 0
Condition0%0/18
$Y and $M and $D and $H and $MIN and $S and $reportHtmlSummaryScale
!ll&&!rl&&r
000
$Y and $M and $D and $H and $MIN and $S
!ll&&!rl&&r
000
$Y and $M and $D and $H and $MIN
!ll&&!rl&&r
000
$Y and $M and $D and $H
!ll&&!rl&&r
000
$Y and $M and $D
!ll&&!rl&&r
000
$Y and $M
!ll&&!rl&&r
000
MC/DC0%0/7
$Y and $M and $D and $H and $MIN and $S and $reportHtmlSummaryScale
$Y $M $D $H $MIN $S $reportHtmlSummaryScale
Truth table0%0/8
A and B and C and D and E and F and G
A= $YB= $MC= $DD= $HE= $MINF= $SG= $reportHtmlSummaryScale
ABCDEFGresult
0XXXXXX0
10XXXXX0
110XXXX0
1110XXX0
11110XX0
111110X0
11111100
11111111
1791 0 $totalMIN = int ((((($Y*365 + $M * 30 + $D) * 24 + $H) * 60 + $MIN) * 60 + $S)/$reportHtmlSummaryScale) ;
1792 } else {
1793 0 $totalMIN = 0;
1794 }
1795 0 $reportHtmlSummaryStr = $reportHtmlSummaryStr . $passFail;
1796 }
1797 }
1798  
1799 0 my $totalTimeSpan = &DateCalc($initStartTime,$endStartTime); my ($Y,$M,$W,$D,$H,$MIN,$S) = split /:/, $totalTimeSpan;
1800 0 my $NofX = int ((((($Y*365 + $M * 30 + $D) * 24 + $H) * 60 + $MIN) * 60 + $S)/$reportHtmlSummaryScale) ;
1801 0 my $X_Unit = int (3600/$reportHtmlSummaryScale);
1802  
1803 0 $reportHtmlSummaryStr = $reportHtmlSummaryStr. "\n_replace_here_\n";
1804 0 $reportHtmlSummaryStr = $reportHtmlSummaryStr . "</pre></body></html>\n";
1805  
1806 0 my $tmp = "---------- |<marquee width = 50><--</marquee> ".&UnixDate($endStartTime, "%m/%d/%Y %H:%M:%S %Z")." ---------- $SvrDrive/$SvrProjName Test Summary -----...... <marquee width = 50><--</marquee>|". &UnixDate($initStartTime, "%m/%d/%Y %H:%M:%S %Z" );
1807 0 $reportHtmlSummaryStr =~ s/_replace_here_/$tmp/g;
1808 0 print Fout $reportHtmlSummaryStr;
1809 0 close Fout;
1810 0 close Fin;
1811 0 move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlSummary."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlSummary);
1812  
1813 }
1814 ################################################################################
1815 # Subroutine Name : reportTCHistory
1816 # Function: append TC result History to htmlLog
1817 # Input Parameters: Test Case name
1818 ################################################################################
1819 sub reportTCHistory_ {
1820 0 ▶ my $tcname = shift;
Subroutine reportTCHistory_: not called CC=1 SCAR=6.9
Pod undocumented
1821 0 my $fileText = sprintf "%10s %s", "", &reportTC($tcname,"","History");
1822 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory, " ---------------------- TestCase: <a name=\"".&getTCName($tcname)."\"> ".&getTCName($tcname)." </a>-----------------------\n");
1823 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory, $fileText);
1824 }
1825  
1826  
1827 sub reportTCHistory {
1828 0 ▶ my $tcIdCtr_ = $tcIdCtr;
Subroutine reportTCHistory: not called CC=1 SCAR=6.9
Pod undocumented
1829 0 my $tcname = shift;
1830 0 $tcIdCtr=1;
1831 0 &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"");
1832 0 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"<html><body><pre>\n");
1833 0 ▶find({ preprocess => sub {return sort @_;}, wanted=> sub {if ( ($File::Find::name =~ /tc.pl\s*$/) && ($File::Find::name =~ /$SvrDrive\/$SvrProjName\/$testcaseNode/i) && ($File::Find::name =~ /$SvrTCNamePattern/i) ) { # fix tcDesc tag related
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=8 SCAR=42.8
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i) 0 0 0
Condition0%0/6
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i
!ll&&!rl&&r
000
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i
!ll&&!rl&&r
000
MC/DC0%0/3
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i
$File::Find::name =~ /tc.pl\s*$/ $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i $File::Find::name =~ /$SvrTCNamePattern/i
Truth table0%0/4
A and B and C
A= $File::Find::name =~ /tc.pl\s*$/B= $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]iC= $File::Find::name =~ /$SvrTCNamePattern/i
ABCresult
0XX0
10X0
1100
1111
1834 0 $SvrTCName = $File::Find::name;
1835 0 $SvrTCName =~ s/\/tc.pl//g;
1836 0 ▶ my $fileText = sprintf "%10s %s", "", &reportTC($tcname,"","History"); if ($fileText =~ /^\s*$/) { $fileText = " ";}
Branch: 1 branch
BranchTrueFalseTotal
if ($fileText =~ /^\s*$/) 0 0 0
1837 0 $fileText = &sortOnDate($fileText);
1838 0 ▶ if ($tcDesc[$tcIdCtr]) {;} else { $tcDesc[$tcIdCtr] ="tcDesc is unavailable. It will be updated in next \"list\"";}
Branch: 1 branch
BranchTrueFalseTotal
if ($tcDesc[$tcIdCtr]) { } 0 0 0
1839 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory, " ---- TestCase $tcIdCtr: <a name=\"".&getTCName($tcname)."\"> ".&processProperty("",$SvrTCName, "get_tcDesc")."</a>----\n");
1840 0 ▶ if (defined $fileText) { ; } else { $fileText="";}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fileText) { } 0 0 0
1841 0 ▶ &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory, "$fileText") if ( $fileText !~ /^\s*$/) ;
Branch: 1 branch
BranchTrueFalseTotal
unless $fileText =~ /^\s*$/ 0 0 0
1842 0 $tcIdCtr++;
1843 }
1844 0 }}, "$SvrDrive/$SvrProjName");
1845 0 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"</pre></body></html>\n") ;
1846 0 $tcIdCtr = $tcIdCtr_;
1847 }
1848  
1849  
1850 sub reportTCHistory_old {
1851 0 ▶ my $tcIdCtr_ = $tcIdCtr;
Subroutine reportTCHistory_old: not called CC=1 SCAR=6.9
Pod undocumented
1852 0 my $tcname = shift;
1853 0 $tcIdCtr=1;
1854 0 &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"");
1855 0 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"<html><body><pre>\n");
1856 0 ▶find({preprocess => sub {return reverse sort @_;}, wanted => sub { if ( ($File::Find::name =~ /tc.pl\s*$/) && ($File::Find::name =~ /$SvrDrive\/$SvrProjName\/$testcaseNode/i) && ($File::Find::name =~ /$SvrTCNamePattern/i) ) { # fix tcDesc tag related
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i) 0 0 0
Condition0%0/6
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i
!ll&&!rl&&r
000
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i
!ll&&!rl&&r
000
MC/DC0%0/3
$File::Find::name =~ /tc.pl\s*$/ and $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i and $File::Find::name =~ /$SvrTCNamePattern/i
$File::Find::name =~ /tc.pl\s*$/ $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]i $File::Find::name =~ /$SvrTCNamePattern/i
Truth table0%0/4
A and B and C
A= $File::Find::name =~ /tc.pl\s*$/B= $File::Find::name =~ m[$SvrDrive/$SvrProjName/$testcaseNode]iC= $File::Find::name =~ /$SvrTCNamePattern/i
ABCresult
0XX0
10X0
1100
1111
1857 0 $SvrTCName = $File::Find::name;
1858 0 $SvrTCName =~ s/\/tc.pl//g;
1859 0 my $fileText = sprintf "%10s %s", "", &reportTC($tcname,"","History");
1860 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory, " ---------------------- TestCase: <a name=\"".&getTCName($tcname)."\"> ".&getTCName($tcname)." </a>-----------------------\n");
1861 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory, $fileText);
1862 0 $tcIdCtr++;
1863 }
1864 0 }}, "$SvrDrive/$SvrProjName");
1865 0 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtmlHistory,"</pre></body></html>\n") ;
1866 0 $tcIdCtr = $tcIdCtr_;
1867 }
1868  
1869 ################################################################################
1870 # Subroutine Name : reportTC
1871 # Function: report TC results on STDOUT and Update TCProj HTML
1872 # Input Parameters: TC Name
1873 # TC PropertyName = tcRunResult
1874 # TC Report Type: 0 = latest 1 = historyical
1875 # Output/Returns : TC Reports displayed on webUI
1876 ################################################################################
1877 sub reportTC() { # TC Report Function (TH:TC Report)
1878 0 ▶ my $tcPropertyPatternPattern_ = ".*"; ####################### Reset the tcPropertyPatternPattern for index.htm
Subroutine reportTC: not called CC=74 SCAR=86.2
Pod undocumented
1879 0 ▶ my $cmd=''; $cmd = shift; if ($cmd !~ /^\s*cmd\s*=/i) { unshift @_, $cmd; } ;
Branch: 1 branch
BranchTrueFalseTotal
unless ($cmd =~ /^\s*cmd\s*=/i) 0 0 0
1880 0 my $timeSpan = "2000!now";
1881 0 my $tcname = $_[0]; my $propertyPattern = $_[1]; my $reportType = $_[2];
1882 0 $tcname = &getTCName($tcname);
1883 0 my ($timeSpanStart, $timeSpanEnd, $isInSpan, $beautifiedStr, $beautifiedStr4Web);
1884 0 my $returnValue="";
1885 0 my ($propertyName, $startTime, $endTime, $comment1, $comment2) ;
1886 0 my $passCtr =0; my $failCtr = 0; my $nullCtr = 0 ; my $totalTime=0; my $avgResponseTime; my $propertyValue ='';
1887 0 my $totalTimeDummy; my $passFailDisplay=""; my $passFailDisplay_ =""; my $tcTags="";
1888 0 &readTestSuitProperty();
1889 0 ▶ if( $propertyPattern =~ /^\s*$/) { $propertyPattern = 'tcRunResult';}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyPattern =~ /^\s*$/) 0 0 0
1890 0 ▶ if( $reportType =~ /^\s*$/) { $reportType = 'lastValue';}
Branch: 1 branch
BranchTrueFalseTotal
if ($reportType =~ /^\s*$/) 0 0 0
1891  
1892 0 ▶ if ($timeSpan) { $_ = $timeSpan;
Branch: 1 branch
BranchTrueFalseTotal
if ($timeSpan) 0 0 0
1893 0 ($timeSpanStart, $timeSpanEnd ) = split( /!|\|/, $timeSpan );
1894 0 $timeSpanStart = &ParseDate($timeSpanStart);
1895 0 $timeSpanEnd = &ParseDate($timeSpanEnd);
1896 }
1897 0 my $tcPassFailDisplayWidth = 0;
1898 # ############ get maxPassFailDisplayWidth #################
1899 # open Fin, "$tcname/thProperty.txt" || die "Can't open file:$!"; ################## Read Property File
1900 # ############################## Read Property File to update reportHtmlHistory ###########################
1901 # while ( $_ = <Fin> ) { chop;
1902  
1903 0 local @ARGV ;
1904 0 ▶my $propertyFName = "$tcname/thPropertyLink.txt"; if (-e $propertyFName) { open Fin, $propertyFName; @_ = <Fin>; close Fin; foreach my $each (@_) { if (-e $each) { push @ARGV, $each."/thProperty.txt"; } } }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $propertyFName) 0 0 0
if (-e $each) 0 0 0
1905 0 ▶ $propertyFName = "$tcname/thProperty.txt"; push @ARGV, $propertyFName if (-e $propertyFName );
Branch: 1 branch
BranchTrueFalseTotal
if -e $propertyFName 0 0 0
1906 0 ▶ while ( $_ = <> ) { chop;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline ARGV)) 0 0 0
1907 0 ▶ if ( $_ =~ /$propertyPattern/i ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($_ =~ /$propertyPattern/i) { } 0 0 0
elsif ($_ =~ /^\s*tcTags\s*\|(.+)\|?/) { } 0 0 0
1908 0 ( $propertyName, $propertyValue, $startTime, $endTime, $totalTimeDummy, $comment1, $comment2) = split( '\|', $_);
1909 0 my $flag1 = &Date_Cmp( &ParseDate($startTime), &ParseDate($timeSpanStart) );
1910 0 my $flag2 = &Date_Cmp( &ParseDate($timeSpanEnd), &ParseDate($endTime) );
1911 0 ▶ if ( ( $flag1 >= 0 ) && ( $flag2 >= 0 ) ) { $isInSpan = 1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($flag1 >= 0 and $flag2 >= 0) { } 0 0 0
Condition0%0/3
$flag1 >= 0 and $flag2 >= 0
!ll&&!rl&&r
000
MC/DC0%0/2
$flag1 >= 0 and $flag2 >= 0
$flag1 >= 0 $flag2 >= 0
Truth table0%0/3
A and B
A= $flag1 >= 0B= $flag2 >= 0
ABresult
0X0
100
111
1912 0 else { $isInSpan = -1; }
1913 0 my $date1=&ParseDate($startTime); my $date2=&ParseDate($endTime); my $delta=&DateCalc($date1,$date2); $delta =~ s/\+//g;
1914 0 my ($Y,$M,$W,$D,$H,$MIN,$S) = split /:/, $delta;
1915 0 my $totalSec = $D * 24 * 3600 + $H * 3600 + $MIN * 60 + $S;
1916 0 ▶ if ($propertyValue =~ /^\s*[\d|.]+\s*$/) { $totalSec = $propertyValue; $propertyValue = "Perf";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /^\s*[\d|.]+\s*$/) 0 0 0
1917 0 ▶ if ( $isInSpan == 1 ) {;
Branch: 1 branch
BranchTrueFalseTotal
if ($isInSpan == 1) 0 0 0
1918 0 ▶ if ( $propertyPattern =~ /tcRunResult/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyPattern =~ /tcRunResult/i) 0 0 0
1919 0 $tcPassFailDisplayWidth= $tcPassFailDisplayWidth + 1 ;
1920 }
1921 } # endif for InSpan
1922 } # endif for /propertyPattern= tcRunResult/
1923 elsif ($_=~ /^\s*tcTags\s*\|(.+)\|?/) {
1924 0 ( $propertyName, $propertyValue, $startTime, $endTime, $totalTimeDummy, $comment1, $comment2) = split( '\|', $_);
1925 0 $tcTags = $propertyValue;
1926 }
1927 }
1928 0 close Fin;
1929 0 ▶ if ($tcTags) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcTags) 0 0 0
1930 0 $tcTags =~ s/_//g;
1931 0 $tcTags =~ s/\t//g;
1932 0 $tcTags =~ s/null/ /g;
1933 }
1934  
1935 0 my $passFailDisplayWidth_1st= 0;
1936 # ############ get maxPassFailDisplayWidth #################
1937 # open Fin, "$tcname/thProperty.txt" || die "Can't open file:$!"; ################## Read Property File
1938 # ############################## Read Property File to update reportHtmlHistory ###########################
1939 # while ( $_ = <Fin> ) { chop;
1940
1941 # local @ARGV ; $propertyFName = "$tcname/thProperty.txt"; # Merge Ts 04/27/2013
1942 # push @ARGV, $propertyFName if (-e $propertyFName );
1943 #$propertyFName = "$tcname/thPropertyLink.txt";
1944 #if (-e $propertyFName) { open Fin, $propertyFName; @_ = <Fin>; close Fin; foreach my $each (@_) { if (-e $each) { push @ARGV, $each."/thProperty.txt"; } } }
1945 0 local @ARGV ;
1946 0 ▶ $propertyFName = "$tcname/thPropertyLink.txt"; if (-e $propertyFName) { open Fin, $propertyFName; @_ = <Fin>; close Fin; foreach my $each (@_) { if (-e $each) { push @ARGV, $each."/thProperty.txt"; } } }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $propertyFName) 0 0 0
if (-e $each) 0 0 0
1947 0 ▶ $propertyFName = "$tcname/thProperty.txt"; push @ARGV, $propertyFName if (-e $propertyFName );
Branch: 1 branch
BranchTrueFalseTotal
if -e $propertyFName 0 0 0
1948 0 ▶ while ( $_ = <> ) { chop;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline ARGV)) 0 0 0
1949 0 ▶ if ( $_ =~ /$propertyPattern/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$propertyPattern/i) 0 0 0
1950 0 ( $propertyName, $propertyValue, $startTime, $endTime, $totalTimeDummy, $comment1, $comment2) = split( '\|', $_);
1951 0 my $flag1 = &Date_Cmp( &ParseDate($startTime), &ParseDate($timeSpanStart) );
1952 0 my $flag2 = &Date_Cmp( &ParseDate($timeSpanEnd), &ParseDate($endTime) );
1953 0 ▶ if ( ( $flag1 >= 0 ) && ( $flag2 >= 0 ) ) { $isInSpan = 1; } else { $isInSpan = -1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($flag1 >= 0 and $flag2 >= 0) { } 0 0 0
Condition0%0/3
$flag1 >= 0 and $flag2 >= 0
!ll&&!rl&&r
000
MC/DC0%0/2
$flag1 >= 0 and $flag2 >= 0
$flag1 >= 0 $flag2 >= 0
Truth table0%0/3
A and B
A= $flag1 >= 0B= $flag2 >= 0
ABresult
0X0
100
111
1954 0 my $date1=&ParseDate($startTime); my $date2=&ParseDate($endTime); my $delta=&DateCalc($date1,$date2); $delta =~ s/\+//g;
1955 0 my ($Y,$M,$W,$D,$H,$MIN,$S) = split /:/, $delta;
1956 0 my $totalSec = $D * 24 * 3600 + $H * 3600 + $MIN * 60 + $S;
1957 0 ▶ if ($propertyValue =~ /^\s*([\d|.]+)\s*$/) { $totalSec = $propertyValue; $propertyValue = "Perf"; $comment2 = "Perf Test = ${1}s";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /^\s*([\d|.]+)\s*$/) 0 0 0
1958 0 ▶ if ($propertyValue =~ /null/i) { ; ; $comment2 = "TC returns NULL";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /null/i) 0 0 0
1959 0 ▶ if ($propertyValue =~ /pass/i) { ; ; $comment2 = "Test Passed" ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /pass/i) 0 0 0
1960 0 ▶ if ($propertyValue =~ /fail/i) { ; ; $comment2 = "Test Failed" ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /fail/i) 0 0 0
1961 0 ▶ if ($propertyValue =~ /bugF/i) { ; ; $comment2 = "Failed BugID : <TBD>" ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /bugF/i) 0 0 0
1962 0 ▶ if ($propertyValue =~ /expF/i) { ; ; $comment2 = "Expected Fail" ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /expF/i) 0 0 0
1963 0 ▶ if ($propertyValue =~ /expected_f_a_i_l/i) { ; $propertyValue = "expF"; $comment2 = "Expected Fail" ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /expected_f_a_i_l/i) 0 0 0
1964 0 ▶ if ( $isInSpan == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($isInSpan == 1) 0 0 0
1965 0 ▶ if ( $propertyPattern =~ /tcRunResult/i ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyPattern =~ /tcRunResult/i) { } 0 0 0
1966 0 $beautifiedStr = sprintf "%15s %-15s %-25s%-20s Note: %s", $propertyValue, $totalSec.'s', $startTime, $comment1, $comment2; # add comment2 for mouse-over display
1967 0 ▶ if ($propertyValue =~ /pass/i) {$passCtr++; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."p";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /pass/i) 0 0 0
1968 0 ▶ if ($propertyValue =~ /fail/i) {$failCtr++; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."f";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /fail/i) 0 0 0
1969 0 ▶ if ($propertyValue =~ /mark/i) { ; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."m";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /mark/i) 0 0 0
1970 0 ▶ if ($propertyValue =~ /Perf/i) { ; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."e";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /Perf/i) 0 0 0
1971 0 ▶ if ($propertyValue =~ /null/i) {$nullCtr++; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."n";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /null/i) 0 0 0
1972 0 ▶ if ($propertyValue =~ /expF/i) {$nullCtr++; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."x";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /expF/i) 0 0 0
1973 0 ▶ if ($propertyValue =~ /bugF/i) {$nullCtr++; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."b";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /bugF/i) 0 0 0
1974 0 ▶ if ($propertyValue =~ /dumy/i) { ; ; $passFailDisplay = $passFailDisplay."d";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /dumy/i) 0 0 0
1975 #if ($propertyValue =~ /dumy/i) {$nullCtr++; ; $passFailDisplay = $passFailDisplay."d";}
1976 0 ▶ if ($propertyValue =~ /expected_F_a_i_l/i) {; $totalTime =$totalTime + $totalSec; $passFailDisplay = $passFailDisplay."x";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /expected_F_a_i_l/i) 0 0 0
1977  
1978 0 ▶ if ($propertyValue =~ /pass/i) { $passFailDisplay_ = $passFailDisplay_."p $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /pass/i) 0 0 0
1979 0 ▶ if ($propertyValue =~ /fail/i) { $passFailDisplay_ = $passFailDisplay_."f $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /fail/i) 0 0 0
1980 0 ▶ if ($propertyValue =~ /mark/i) { $passFailDisplay_ = $passFailDisplay_."m $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /mark/i) 0 0 0
1981 0 ▶ if ($propertyValue =~ /Perf/i) { $passFailDisplay_ = $passFailDisplay_."e $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /Perf/i) 0 0 0
1982 0 ▶ if ($propertyValue =~ /null/i) { $passFailDisplay_ = $passFailDisplay_."n $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /null/i) 0 0 0
1983 0 ▶ if ($propertyValue =~ /expF/i) { $passFailDisplay_ = $passFailDisplay_."x $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /expF/i) 0 0 0
1984 0 ▶ if ($propertyValue =~ /bugF/i) { $passFailDisplay_ = $passFailDisplay_."b $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /bugF/i) 0 0 0
1985 0 ▶ if ($propertyValue =~ /dumy/i) { $passFailDisplay_ = $passFailDisplay_."d $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /dumy/i) 0 0 0
1986 0 ▶ if ($propertyValue =~ /expected_f_a_i_l/i) { $passFailDisplay_ = $passFailDisplay_."x $startTime: ${comment2}_|_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /expected_f_a_i_l/i) 0 0 0
1987 0 ▶ if ($propertyValue =~ /pass|fail|mark|Perf|null|bugF|expF/i) { $passFailDisplayWidth_1st ++ ; }
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyValue =~ /pass|fail|mark|Perf|null|bugF|expF/i) 0 0 0
1988 0 } else { $beautifiedStr = $_; } # endif for /tcRunResult/
1989  
1990 0 ▶ if ( $reportType =~ /history/i ) { $returnValue = "$beautifiedStr\n$returnValue"; }
Branch: 3 branches
BranchTrueFalseTotal
if ($reportType =~ /history/i) { } 0 0 0
elsif ($reportType =~ /lastValue/i) { } 0 0 0
elsif ($reportType =~ /forWeb/i) { } 0 0 0
1991 0 elsif ( $reportType =~ /lastValue/i ) { $returnValue = $beautifiedStr; }
1992 0 elsif ( $reportType =~ /forWeb/i ) { $returnValue .= $beautifiedStr4Web; }
1993 } # endif for InSpan
1994 } # endif for /propertyPattern/
1995 } #####################
1996  
1997  
1998  
1999 ############################## Adjust passFailDisplayWidth by _1st and max ###########################
2000 0 ▶ if ( $passFailDisplayWidth < $passFailDisplayWidth_1st ) { $passFailDisplayWidth = $passFailDisplayWidth_1st;}
Branch: 1 branch
BranchTrueFalseTotal
if ($passFailDisplayWidth < $passFailDisplayWidth_1st) 0 0 0
2001 0 ▶ if ( $passFailDisplayWidth > $maxPassFailDisplayWidth ) { $passFailDisplayWidth = $maxPassFailDisplayWidth ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($passFailDisplayWidth > $maxPassFailDisplayWidth) 0 0 0
2002 ############################## Read Property File to update reportHtmlHistory ###########################
2003 0 ▶ if ($passCtr + $failCtr + $nullCtr == 0) { ########## Generate TC webUI string
Branch: 1 branch
BranchTrueFalseTotal
if ($passCtr + $failCtr + $nullCtr == 0) { } 0 0 0
2004 0 $avgResponseTime = 0; } else {
2005 0 $avgResponseTime = $totalTime / ($passCtr + $failCtr + $nullCtr);
2006 }
2007 0 my $qtpHost; my $ATResultFname; my %color; my $color = 'gray'; my @color; my $colorIndex = 0; my $QASvrName; my $expFailure=""; my $bugFailure="";
2008 0 ▶ if ($propertyValue =~ /pass/i) { $color = "Green"; } elsif ($propertyValue =~ /fail/i) { $color = 'Red'; } elsif ($propertyValue =~ /bugF/i) {$color = "blue";}
Branch: 4 branches
BranchTrueFalseTotal
if ($propertyValue =~ /pass/i) { } 0 0 0
elsif ($propertyValue =~ /fail/i) { } 0 0 0
elsif ($propertyValue =~ /bugF/i) { } 0 0 0
elsif ($propertyValue =~ /expected\s*fail/i) { } 0 0 0
2009 0 elsif ($propertyValue =~ /expected\s*fail/i) { $expFailure = "_Expected_Failure_ "; }
2010  
2011 0 $color[0]=1;
2012  
2013 ##### testcase Desc ####
2014 0 my $TCDesc_displayTip = "Click to view TC logs";
2015 0 my $TCDesc_display ; my $TCDesc_display_ ;
2016 0 ▶ if ($tsProperty{$tcname}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tsProperty{$tcname}) { } 0 0 0
2017 ###### Handle expected failure
2018 0 ▶ if (($tsProperty{$tcname} =~ /_expected_fail_/i) && ($propertyValue =~ /fail/i)){ $color = "Green"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tsProperty{$tcname} =~ /_expected_fail_/i and $propertyValue =~ /fail/i) 0 0 0
Condition0%0/3
$tsProperty{$tcname} =~ /_expected_fail_/i and $propertyValue =~ /fail/i
!ll&&!rl&&r
000
MC/DC0%0/2
$tsProperty{$tcname} =~ /_expected_fail_/i and $propertyValue =~ /fail/i
$tsProperty{$tcname} =~ /_expected_fail_/i $propertyValue =~ /fail/i
Truth table0%0/3
A and B
A= $tsProperty{$tcname} =~ /_expected_fail_/iB= $propertyValue =~ /fail/i
ABresult
0X0
100
111
2019 0 ▶ if (($tsProperty{$tcname} =~ /_expected_fail_/i) && ($propertyValue =~ /pass/i)){ $color = "Red"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tsProperty{$tcname} =~ /_expected_fail_/i and $propertyValue =~ /pass/i) 0 0 0
Condition0%0/3
$tsProperty{$tcname} =~ /_expected_fail_/i and $propertyValue =~ /pass/i
!ll&&!rl&&r
000
MC/DC0%0/2
$tsProperty{$tcname} =~ /_expected_fail_/i and $propertyValue =~ /pass/i
$tsProperty{$tcname} =~ /_expected_fail_/i $propertyValue =~ /pass/i
Truth table0%0/3
A and B
A= $tsProperty{$tcname} =~ /_expected_fail_/iB= $propertyValue =~ /pass/i
ABresult
0X0
100
111
2020 ###### Handle expected failure
2021 0 $TCDesc_display_ = $expFailure.$tsProperty{$tcname};
2022  
2023 0 my $TCDesc_display__ = $TCDesc_display_;
2024  
2025 # $TCDesc_display__ =~ s/&lt;|&gt;|&amp;|&#37;|&#36;|&#166;/X/g;
2026 0 $TCDesc_display__ =~ s/&lt;|&gt;|&amp;|&#37;|&#36;|&#166;|&#40;|&#41;/X/g;
2027  
2028 0 my $n1 = () = $TCDesc_display_ =~ /&lt;|&gt;/g;
2029 # my $n2 = () = $TCDesc_display_ =~ /&amp;|&#37;|&#36;/g;
2030 0 my $n2 = () = $TCDesc_display_ =~ /&amp;|&#37;|&#36;|&#40;|&#401;/g;
2031 0 my $n3 = () = $TCDesc_display_ =~ /&#166;/g;
2032 0 my $extra = $n1 * 3 + $n2 * 4 + $n3 * 5;
2033  
2034 0 my $webUI_TCDescWidth_extra = $webUI_TCDescWidth + $extra ;
2035  
2036 0 ▶ if (length($TCDesc_display__) <= $webUI_TCDescWidth ) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $TCDesc_display__ <= $webUI_TCDescWidth) { } 0 0 0
2037 0 $TCDesc_display = sprintf "%-${webUI_TCDescWidth}s", $TCDesc_display_;
2038 } else {
2039 0 $TCDesc_display = sprintf "%-${webUI_TCDescWidth}s", substr $TCDesc_display_, 0, $webUI_TCDescWidth_extra;
2040 0 $TCDesc_displayTip = $tsProperty{$tcname};
2041 }
2042  
2043 0 } else { $TCDesc_display = sprintf "%-${webUI_TCDescWidth}s", $tcname; }
2044  
2045 # prHtml3 mark for search
2046  
2047  
2048 0 my $tcSerialN = $TCDesc_display;
2049 0 ▶ if ($tcSerialN =~ /^\s*\d+\D+/) {$tcSerialN =~ /^\s*(\d+)\D+/; $tcSerialN = "$1"; if ($tcSerialN) {;} else {$tcSerialN = "";}}
Branch: 2 branches
BranchTrueFalseTotal
if ($tcSerialN =~ /^\s*\d+\D+/) 0 0 0
if ($tcSerialN) { } 0 0 0
2050 0 my $dirRoot = &getRoot($tcname);
2051 0 my $TCCtrToolTip = sprintf "Run Test (Testcase Number == $tcSerialN [%s])", &timeConvert($avgResponseTime);
2052 0 my $TCCtrToolTipMin = sprintf "Run Tests (Testcase Number >= $tcSerialN)" ;
2053 0 my $TCScrollAmount = 0; my $CtrSeparator = "|";
2054 0 $passFailDisplay = &genPassFailDisplay ($passFailDisplay);
2055 0 $passFailDisplay = &genPassFailDisplay_ ($passFailDisplay_);
2056  
2057  
2058 0 my $stopTS = "<a href=\"${url}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName Execution_from_cgi=$Execution_from_cgi;Execution_local_only=$Execution_local_only;exitTAFGracefullyString=$tcname;exitTAF')\" title=\"Stop Test (Testcase Number = $tcSerialN)\" >.</a>";
2059 0 my $runTS24_7 = "<a href=\"${url}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName Execution_from_cgi=$Execution_from_cgi;Execution_local_only=$Execution_local_only;drive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseExec=$dirRoot;ExecutionType=runTC;Execution_24_7=y;exec')\" title=\"Exec Test 24/7 (Testcase Number == $tcSerialN)\"> ,</a>";
2060 0 my $runTCOnce = "<a href=\"${url}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName Execution_from_cgi=$Execution_from_cgi;Execution_local_only=$Execution_local_only;drive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseExec=$dirRoot;ExecutionType=runTC;exec')\" title=\"$TCCtrToolTip\">></a>";
2061 0 my $runTSOnce = "<a href=\"${url}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName Execution_from_cgi=$Execution_from_cgi;Execution_local_only=$Execution_local_only;drive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;tcIdMin=$tcIdCtr;testsuit=$SvrProjName;ExecutionType=runTS;exec')\" title=\"$TCCtrToolTipMin\"><marquee style=\"border:RED ${borderWidth}px ${borderStyle}\" width=48 direction=right behavior=alternate loop=10000 scrollamount=$scrollAmount>>\|</marquee></a>";
2062 0 my $html = sprintf( "<span style=\"color:black;\">$passFailDisplay${stopTS}$runTS24_7<font color=\"$color[$colorIndex]\"> $runTCOnce $runTSOnce</font><a href=\"${url}/$SvrProjName/".&getTCNameStr($SvrTCName)."/_tcLog.html\" title=\"$TCDesc_displayTip\">%-${webUI_TCDescWidth}s</a> <a href=\"${url}/$SvrProjName/${reportHtmlHistory}#$tcname\" title=\"Click to see Pass/Fail history\">%5d/%-5d</a> %10s $tcTags <font color=\"white\"> %s </font></span>\n",
2063 $TCDesc_display,
2064 $passCtr,
2065 $failCtr,
2066 &formatSeconds($avgResponseTime),
2067 $tcname.'/tc.pl',
2068 );
2069  
2070 # http
2071  
2072 0 $stopTS = "<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=Execution_from_cgi=y;Execution_local_only=$Execution_local_only;exitTAFGracefullyString=$tcname;exitTAF=_null__realSemi_tafRedirectory=${urlHttp}/$SvrProjName/$reportHtml_http\" title=\"Stop Test (Testcase Number = $tcSerialN)\" >.</a>";
2073 0 $runTS24_7 = "<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=Execution_from_cgi=y;Execution_local_only=$Execution_local_only;SysDrive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseExec=$dirRoot;ExecutionType=runTC;Execution_24_7=y;exec_realSemi_tafRedirectory=${urlHttp}/$SvrProjName/$reportHtml_http\" title=\"Exec Test 24/7 (Testcase Number == $tcSerialN)\"> ,</a>";
2074 0 $runTCOnce = "<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=Execution_from_cgi=y;Execution_local_only=$Execution_local_only;SysDrive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseExec=$dirRoot;ExecutionType=runTC;exec_realSemi_tafRedirectory=${urlHttp}/$SvrProjName/$reportHtml_http\" title=\"$TCCtrToolTip\">></a>";
2075 0 $runTSOnce = "<a href=\"${urlHttp}/${cgi_bin}$tafCGI?tafArgs=Execution_from_cgi=y;Execution_local_only=$Execution_local_only;SysDrive=$SvrDrive;tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;tcIdMin=$tcIdCtr;testsuit=$SvrProjName;ExecutionType=runTS;exec_realSemi_tafRedirectory=${urlHttp}/$SvrProjName/$reportHtml_http\" title=\"$TCCtrToolTipMin\"><marquee style=\"border:RED ${borderWidth}px ${borderStyle}\" width=48 direction=right behavior=alternate loop=10000 scrollamount=$scrollAmount>>\|</marquee></a>";
2076  
2077 0 $stopTS =~ s/;/_semi_/g; $stopTS =~ s/_realSemi_/$_realSemi_/g; # todo: taf.cgi need to handle exitGracefully scenario
2078 0 $runTS24_7=~ s/;/_semi_/g; $runTS24_7=~ s/_realSemi_/$_realSemi_/g;
2079 0 $runTCOnce=~ s/;/_semi_/g; $runTCOnce=~ s/_realSemi_/$_realSemi_/g;
2080 0 $runTSOnce=~ s/;/_semi_/g; $runTSOnce=~ s/_realSemi_/$_realSemi_/g;
2081  
2082 0 my $html_http = sprintf( "<span style=\"color:black;\">$passFailDisplay${stopTS}$runTS24_7<font color=\"$color[$colorIndex]\"> $runTCOnce $runTSOnce</font><a href=\"${urlHttp}/$SvrProjName/".&getTCNameStr($SvrTCName)."/_tcLog.html\" title=\"$TCDesc_displayTip\">%-${webUI_TCDescWidth}s</a> <a href=\"${urlHttp}/$SvrProjName/${reportHtmlHistory}#$tcname\" title=\"Click to see Pass/Fail history\">%5d/%-5d</a> %10s $tcTags <font color=\"white\"> %s </font></span>\n",
2083 $TCDesc_display,
2084 $passCtr,
2085 $failCtr,
2086 &formatSeconds($avgResponseTime),
2087 $tcname.'/tc.pl',
2088 );
2089  
2090  
2091 0 ▶ if ($cmd =~ /noprint/i) {;} else {
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /noprint/i) { } 0 0 0
2092 0 &appendtoFileUniq_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1, $html );
2093 0 &updateWeb1_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml, $html );
2094  
2095 0 &appendtoFileUniq_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http, $html_http);
2096 0 &updateWeb1Http_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http, $html_http );
2097 }
2098 0 close Fin;
2099 0 ▶ if ($returnValue) {$returnValue =~ s/^\s*//g;} else {$returnValue = "";}
Branch: 1 branch
BranchTrueFalseTotal
if ($returnValue) { } 0 0 0
2100 0 return $returnValue;
2101 }
2102  
2103 sub genPassFailDisplay {
2104 0 ▶ my $str = shift;
Subroutine genPassFailDisplay: not called CC=2 SCAR=17.9
Pod undocumented
2105 0 $str = reverse $str;
2106 0 $str = $str. " ";
2107 0 $str = substr ($str, 0, $passFailDisplayWidth);
2108 0 $str =~ s/p/<a style=\"color:green\">*<\/a>/g;
2109 0 $str =~ s/f/<a style=\"color:red\">*<\/a>/g;
2110 0 $str =~ s/m/|/g;
2111 0 ▶ if ($str =~ /^\s*$/) { $str = &genStr($passFailDisplayWidth);}
Branch: 1 branch
BranchTrueFalseTotal
if ($str =~ /^\s*$/) 0 0 0
2112 0 return $str;
2113 }
2114  
2115 sub genPassFailDisplay_ {
2116 0 ▶ my $str = shift; my $str_ =""; my $strLenCtr=0; my $mark4One=0;
Subroutine genPassFailDisplay_: not called CC=15 SCAR=54.8
Pod undocumented
2117 0 @_ = split /_\|_/, $str; $str="";
2118 0 ▶ for (my $i=$#_; $i >= 0; $i--) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i >= 0) 0 0 0
2119 0 my $tcResult ;
2120 0 ▶ if( $_[$i] =~ s/^\s*(\w)\s+//g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_[$i] =~ s/^\s*(\w)\s+//g) 0 0 0
2121 0 $tcResult = $1; $str_ = $_[$i]; $strLenCtr++;
2122 0 ▶ if ($tcResult =~ /p/i) { $str = $str."<a style=\"color:green\" title=\"$str_\">*<\/a>"; }
Branch: 9 branches
BranchTrueFalseTotal
if ($tcResult =~ /p/i) { } 0 0 0
elsif ($tcResult =~ /f/i) { } 0 0 0
elsif ($tcResult =~ /m/i) { } 0 0 0
elsif ($tcResult =~ /b/i) { } 0 0 0
elsif ($tcResult =~ /e/i) { } 0 0 0
elsif ($tcResult =~ /n/i) { } 0 0 0
elsif ($tcResult =~ /x/i) { } 0 0 0
elsif ($tcResult =~ /d/i) { } 0 0 0
elsif ($tcResult =~ /_/i) { } 0 0 0
2123 0 elsif ($tcResult =~ /f/i) { $str = $str."<a style=\"color:red\" title=\"$str_\">*<\/a>"; }
2124 elsif ($tcResult =~ /m/i) {
2125 #if ($mark4One == 2) { ; } else {
2126 0 $str = $str."<a style=\"color:black\" title=\"$str_\">$markSymbol<\/a>";
2127 #$mark4One = 0;
2128 }
2129  
2130 0 elsif ($tcResult =~ /b/i) { $str = $str."<a style=\"color:blue\" title=\"$str_\">*<\/a>"; }
2131 0 elsif ($tcResult =~ /e/i) { $str = $str."<a style=\"color:black\" title=\"$str_\">.<\/a>"; }
2132 0 elsif ($tcResult =~ /n/i) { $str = $str."<a style=\"color:black\" title=\"$str_\">.<\/a>"; }
2133 0 elsif ($tcResult =~ /x/i) { $str = $str."<a style=\"color:black\" title=\"$str_\">*<\/a>"; }
2134 0 elsif ($tcResult =~ /d/i) { $str = $str."<a style=\"color:black\" title=\"$str_\"> <\/a>"; }
2135 0 elsif ($tcResult =~ /_/i) { $str = $str."<a style=\"color:black\" title=\"$str_\">.<\/a>"; }
2136 }
2137 0 $mark4One++;
2138 0 ▶ if ($strLenCtr + 1 > $passFailDisplayWidth) { return $str; }
Branch: 1 branch
BranchTrueFalseTotal
if ($strLenCtr + 1 > $passFailDisplayWidth) 0 0 0
2139 }
2140 0 ▶ if ($strLenCtr < $passFailDisplayWidth) { for (my $i = $strLenCtr; $i < $passFailDisplayWidth; $i++) { $str = $str . "<a style=\"color:black\"> <\/a>"; } }
Branch: 2 branches
BranchTrueFalseTotal
if ($strLenCtr < $passFailDisplayWidth) 0 0 0
if ($i < $passFailDisplayWidth) 0 0 0
2141 0 return $str;
2142 }
2143  
2144 sub genPassFailDisplay_old {
2145 0 ▶ my $str = shift; my $str_ =""; my $strLenCtr=0;
Subroutine genPassFailDisplay_old: not called CC=9 SCAR=45.0
Pod undocumented
2146 0 @_ = split /_\|_/, $str; $str="";
2147 0 ▶ for (my $i=$#_; $i >= 0; $i--) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i >= 0) 0 0 0
2148 0 my $tcResult ;
2149 0 ▶ if( $_[$i] =~ s/^\s*(\w)\s+//g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_[$i] =~ s/^\s*(\w)\s+//g) 0 0 0
2150 0 $tcResult = $1; $str_ = $_[$i]; $strLenCtr++;
2151 0 ▶ if ($tcResult =~ /p/i) { $str = $str."<a style=\"color:green\" title=\"$str_\">*<\/a>"; }
Branch: 3 branches
BranchTrueFalseTotal
if ($tcResult =~ /p/i) { } 0 0 0
elsif ($tcResult =~ /f/i) { } 0 0 0
elsif ($tcResult =~ /m/i) { } 0 0 0
2152 0 elsif ($tcResult =~ /f/i) { $str = $str."<a style=\"color:red\" title=\"$str_\">*<\/a>"; }
2153 0 elsif ($tcResult =~ /m/i) { $str = $str."<a style=\"color:black\" title=\"$str_\">|<\/a>"; }
2154 }
2155 0 ▶ if ($strLenCtr + 1 > $passFailDisplayWidth) { return $str; }
Branch: 1 branch
BranchTrueFalseTotal
if ($strLenCtr + 1 > $passFailDisplayWidth) 0 0 0
2156 }
2157 0 ▶ if ($strLenCtr < $passFailDisplayWidth) { for (my $i = $strLenCtr; $i < $passFailDisplayWidth; $i++) { $str = $str . "<a style=\"color:blank\"> <\/a>"; } }
Branch: 2 branches
BranchTrueFalseTotal
if ($strLenCtr < $passFailDisplayWidth) 0 0 0
if ($i < $passFailDisplayWidth) 0 0 0
2158 0 return $str;
2159 }
2160  
2161 0 ▶sub genStr { my $strLen = shift; my $return=""; for (my $i = 0; $i < $strLen; $i++) { $return .= " "; } $return; }
Subroutine genStr: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $strLen) 0 0 0
2162  
2163 sub processTSs{
2164 0 ▶ shift;
Subroutine processTSs: not called CC=14 SCAR=53.5
Pod undocumented
2165 0 my $each = shift;
2166 0 ▶ if ($each !~ /=/) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $each =~ /=/) { } 0 0 0
2167 0 ▶ if ($each =~ /\bmarkblablaaaaa\b/i) { ;
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /\bmarkblablaaaaa\b/i) { } 0 0 0
2168 } else {
2169 # print "pa: $each\n";
2170 0 my %record;
2171 0 &processTCs("", "listAll");
2172 0 my $rst = $listAll_var;
2173 0 @_ = split (/\n|\r/, $rst);
2174 0 foreach my $each (@_) {
2175 0 $each =~ s/^$c//g;
2176 0 $each =~ s/^[\/|\\]//g;
2177 0 $each =~ s/^$_TAF//g;
2178 0 $each =~ s/^[\/|\\]//g;
2179 0 $each =~ s/testcase\d\d\d\d.*$//g;
2180 0 $each =~ s/[\/|\\]\s*$//g;
2181 0 $record{$each}=$each;
2182 }
2183 0 ▶ if ($each =~ /listTS/i) { # list all available TS
Branch: 2 branches
BranchTrueFalseTotal
if ($each =~ /listTS/i) { } 0 0 0
elsif ($each =~ /deleteTSs/i) { } 0 0 0
2184 0 foreach my $each (sort keys %record) { print "$each\n"; }
2185 } elsif ($each =~ /deleteTSs/i) {
2186 0 foreach my $each (sort keys %record) {
2187 0 print "pc: $SvrProjName, $each\n";
2188  
2189 # &deleteTAFTestsuite();
2190
2191 }
2192 }
2193  
2194  
2195 #print "pd: $SvrProjName, $each\n"; my $str = "\&$each();"; my $rst = eval $str; next ;
2196 }
2197 } else {
2198 0 $each =~ /^\s*(\S+)\s*=\s*(\S+)\s*/; my $varName = $1; my $varValue = $2 ;
2199 0 ▶ if (($varName !~ /^\s*$/) && ($varValue !~ /^\s*$/)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $varName =~ /^\s*$/ || $varValue =~ /^\s*$/) 0 0 0
Condition0%0/3
$varName =~ /^\s*$/ || $varValue =~ /^\s*$/
l!l&&r!l&&!r
000
MC/DC0%0/2
$varName =~ /^\s*$/ || $varValue =~ /^\s*$/
$varName =~ /^\s*$/ $varValue =~ /^\s*$/
Truth table0%0/3
A || B
A= $varName =~ /^\s*$/B= $varValue =~ /^\s*$/
ABresult
1X1
011
000
2200 0 ▶ if ($varName =~ /\bcreate\b/i) { &createTS($varValue); }
Branch: 4 branches
BranchTrueFalseTotal
if ($varName =~ /\bcreate\b/i) { } 0 0 0
elsif ($varName =~ /\badd\b/i) { } 0 0 0
elsif ($varName =~ /\bdelete\b/i) { } 0 0 0
elsif ($varName =~ /\bcheckStatus\b/i) { } 0 0 0
2201 0 elsif ($varName =~ /\badd\b/i) { &addTS($varValue); }
2202 0 elsif ($varName =~ /\bdelete\b/i) { &deleteTS($varValue); }
2203 0 elsif ($varName =~ /\bcheckStatus\b/i) { &checkStatusTS($varValue); }
2204 else {
2205 0 print "Unrecognized Testsuite Command: $varName\n";
2206 }
2207 }
2208 }
2209 }
2210  
2211 0 ▶sub checkStatusTS {
Subroutine checkStatusTS: not called CC=1 SCAR=0.0
Pod undocumented
2212 ; # print "pass a: ".shift."\n";
2213 }
2214 sub processTCs{
2215 5 ▶ shift;
Subroutine processTCs: called CC=26 SCAR=54.5
Pod undocumented
2216 5 my $isBatchProcessing = 1;
2217 5 my $tmp = shift;
2218 0 ▶ if (defined $tmp ) {;} else { return; }
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tmp) { } 5 0 5
2219 5 @_ = split /;/, $tmp;
2220 5 &genDriver_taf_pl ();
2221 5 &genDriver_taf_cgi ();
2222 5 &appendtoFile($commandLogName, "\n".&UnixDate( "now", "%m/%d/%Y %H:%M:%S %Z")."> ");
2223 5 &appendtoFile($commandLogName,"$c/$_TAF/$taf ");
2224 5 foreach my $each (@_) {
2225 #### uncomment for debugging print " cmd> $each\n";
2226 5 &appendtoFile($commandLogName,$each.";");
2227 5 ▶ if ($each !~ /=/) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $each =~ /=/) { } 3 2 5
2228 3 $isBatchProcessing = 0;
2229 0 ▶ if (($each =~ /\blistVars\b/i) || ($each =~ /\bgetVars\b/i)) { return &printGlobalVars();
Branch: 12 branches
BranchTrueFalseTotal
if ($each =~ /\blistVars\b/i or $each =~ /\bgetVars\b/i) { } 0 3 3
elsif ($each =~ /\bprintVars\b/i) { } 3 0 3
elsif ($each =~ /\bexec\b/i) { } 0 0 0
elsif ($each =~ /\blistTcFilters|printTcFilters\b/i) { } 0 0 0
elsif ($each =~ /\blist\b/i) { } 0 0 0
elsif ($each =~ /\blistHistory\b/i) { } 0 0 0
elsif ($each =~ /\bmark\b/i) { } 0 0 0
elsif ($each =~ /\blistAll\b/i) { } 0 0 0
elsif ($each =~ /refreshTS/i) { } 0 0 0
elsif ($each =~ /refreshHost/i) { } 0 0 0
elsif ($each =~ /releaseLock|refreshLock|refreshQueue|resetLock|resetQueue/i) { } 0 0 0
elsif ($each =~ /customer1/i) { } 0 0 0
Condition33%1/3
$each =~ /\blistVars\b/i or $each =~ /\bgetVars\b/i
l!l&&r!l&&!r
003
MC/DC0%0/2
$each =~ /\blistVars\b/i or $each =~ /\bgetVars\b/i
$each =~ /\blistVars\b/i $each =~ /\bgetVars\b/i
Truth table33%1/3
A or B
A= $each =~ /\blistVars\b/iB= $each =~ /\bgetVars\b/i
ABresult
1X1
011
000
2230 3 } elsif ($each =~ /\bprintVars\b/i) { print &printGlobalVars(); next ;
2231 } elsif ($each =~ /\bexec\b/i) { ;
2232 0 &setGlobalVars("","tcOP=exec") ;
2233 0 $isBatchProcessing = 1 ;
2234 } elsif ($each =~ /\blistTcFilters|printTcFilters\b/i) { ;
2235 0 &setGlobalVars("","tcOP=listtcfilters") ;
2236 0 $isBatchProcessing = 1 ;
2237 } elsif ($each =~ /\blist\b/i) { ;
2238 0 &setGlobalVars("","tcOP=list") ;
2239 0 $isBatchProcessing = 1 ;
2240 } elsif ($each =~ /\blistHistory\b/i) { ;
2241 0 &setGlobalVars("","tcOP=listHistory") ;
2242 0 $isBatchProcessing = 1 ;
2243 } elsif ($each =~ /\bmark\b/i) { ;
2244 0 &setGlobalVars("","tcOP=mark") ;
2245 0 $isBatchProcessing = 1 ;
2246 } elsif ($each =~ /\blistAll\b/i) { ;
2247 0 $SvrTCNamePattern =".*"; print &listAll() ;
2248 0 $isBatchProcessing = 0 ;
2249 } elsif ($each =~ /refreshTS/i) { ;
2250 0 &deleteTAFTestsuite() ;
2251 0 &generateTAFTestsuite() ;
2252 0 $isBatchProcessing = 0 ;
2253 } elsif ($each =~ /refreshHost/i) { ;
2254 #print "pa: $c/$_TAF/$tsProperty\n"; need to test on linux
2255 0 unlink "$c/$_TAF/$tsProperty";
2256 0 &generateRootIndex() ;
2257 0 &generateRootIndex() ;
2258 0 $isBatchProcessing = 0 ;
2259 } elsif ($each =~ /releaseLock|refreshLock|refreshQueue|resetLock|resetQueue/i) { ;
2260 0 &Queue("","releaseLock");
2261 # &generateTAFTestsuite() ;
2262 0 $isBatchProcessing = 0 ;
2263 } elsif ($each =~ /customer1/i) {
2264 0 &customer1();
2265 } else {
2266 0 my $str = "\&$each();";
2267 0 my $rst = eval $str;
2268 0 ▶ if ($rst) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rst) { } 0 0 0
2269 0 ▶ print "\`$each\` = \"$rst\"\n" if ($pr2Screen == 1);
Branch: 1 branch
BranchTrueFalseTotal
if $pr2Screen == 1 0 0 0
2270
2271 0 } else { print "\`$each\` is not a TAF command."; }
2272 0 next;
2273 }
2274 } else {
2275 2 ▶ if ( $each =~ /^\s*(\S+)\s*=\s*(\S+)\s*/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /^\s*(\S+)\s*=\s*(\S+)\s*/) { } 2 0 2
2276 2 $each =~ /^\s*(\S+)\s*=\s*(\S+)\s*/; my $varName = $1; my $varValue = $2 ;
2277 2 ▶ if (($varName !~ /^\s*$/) && ($varValue !~ /^\s*$/)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($varName =~ /^\s*$/ or $varValue =~ /^\s*$/) 2 0 2
Condition33%1/3
$varName =~ /^\s*$/ or $varValue =~ /^\s*$/
l!l&&r!l&&!r
002
MC/DC0%0/2
$varName =~ /^\s*$/ or $varValue =~ /^\s*$/
$varName =~ /^\s*$/ $varValue =~ /^\s*$/
Truth table33%1/3
A or B
A= $varName =~ /^\s*$/B= $varValue =~ /^\s*$/
ABresult
1X1
011
000
2278 0 ▶ if ($varName =~ /propertyOp/) { $isBatchProcessing = 1; } else { $isBatchProcessing = 0;} # 1 for propertyOp
Branch: 1 branch
BranchTrueFalseTotal
if ($varName =~ /propertyOp/) { } 0 2 2
2279 2 ▶ if (&setGlobalVars ("","$varName=$varValue;") == 1 ) { ; } # Process value assginment
Branch: 1 branch
BranchTrueFalseTotal
if (&setGlobalVars('', "$varName=$varValue;") == 1) { } 2 0 2
2280 0 else { my $rst = &processTC("",$each) ; } # Process TC
2281 }
2282 0 } else { next; }
2283 }
2284 0 ▶ if ($isBatchProcessing == 1) { if ($Execution_24_7 !~ /y/i) {$NofExecutionCtrExec=0}; $NofExecutionCtr = 0; &tcLoop(); } # NofExecutionCtr reset for each list/exec
Branch: 2 branches
BranchTrueFalseTotal
if ($isBatchProcessing == 1) 0 2 2
unless ($Execution_24_7 =~ /y/i) 0 0 0
2285 }
2286  
2287 }
2288  
2289 ################################################################################
2290 # Subroutine Name : process Test Case
2291 # Function: wrapper for Test Case management functions
2292 # Input Parameters: PropertyOP
2293 # Output/Returns : tcName and propertyO/proc
2294 ################################################################################
2295 sub processTC {
2296 46 ▶ my $tcname; my $cmd="";
Subroutine processTC: called CC=35 SCAR=46.2
Pod undocumented
2297 46 ▶ shift; my $tcOP= ''; $tcOP = shift if (@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 46 0 46
2298 46 ▶ my $prMsg = '' ; $prMsg= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 46 46
2299 46 $tcOP =~ /\s*([\w|\d]+)\s*(=)?\s*(\w+)?\s*([;|\/])?(\s*\S+\s*)?/;
2300 46 $tcOP = $1; $tcname = $3; $cmd = $5; $prMsg = $pr2Screen;
2301 46 ▶ if ($cmd) {$cmd =~ s/\n//g;} else { $cmd ="";}
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd) { } 6 40 46
2302 ######## This is for TCs processing (Batching)
2303 46 ▶ if ($tcOP =~ /\blistAll\b/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcOP =~ /\blistAll\b/i) 0 46 46
2304 # SvrTCName as a regExp
2305 0 ▶ if ($tcname =~ /^\s*$/) { $SvrTCNamePattern =".*";} else { $SvrTCNamePattern = $tcname; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tcname =~ /^\s*$/) { } 0 0 0
2306 0 print &listAll();
2307 0 return;
2308 }
2309 ######## The following are for TC processing
2310 46 ▶ if ((defined $tcname) && ($tcname =~ /^.$/) && ($cmd =~ /:[\\|\/]/)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tcname and $tcname =~ /^.$/ and $cmd =~ m[:[\\|/]]) 0 46 46
Condition66%4/6
defined $tcname and $tcname =~ /^.$/ and $cmd =~ m[:[\\|/]]
!ll&&!rl&&r
4510
defined $tcname and $tcname =~ /^.$/
!ll&&!rl&&r
0451
MC/DC0%0/3
defined $tcname and $tcname =~ /^.$/ and $cmd =~ m[:[\\|/]]
defined $tcname $tcname =~ /^.$/ $cmd =~ m[:[\\|/]]
Truth table50%2/4
A and B and C
A= defined $tcnameB= $tcname =~ /^.$/C= $cmd =~ m[:[\\|/]]
ABCresult
0XX0
10X0
1100
1111
2311 0 $tcname = $tcname.$cmd; # handle -s delete=c:\_ts1_
2312 }
2313 46 $tcname = &getTCName($tcname);
2314  
2315 46 ▶ if ((-e $tcname)||($tcOP =~ /create/i)) { printf "%-20s %-40s ", "processTC:", $tcname if (($outputFormat =~ /text/i) && ($pr2Screen ==1)) ; } # print for webUI 1/2
Branch: 2 branches
BranchTrueFalseTotal
if (-e $tcname or $tcOP =~ /create/i) 28 18 46
if $outputFormat =~ /text/i and $pr2Screen == 1 0 28 28
Condition66%4/6
-e $tcname or $tcOP =~ /create/i
l!l&&r!l&&!r
22618
$outputFormat =~ /text/i and $pr2Screen == 1
!ll&&!rl&&r
0280
MC/DC100%2/2
-e $tcname or $tcOP =~ /create/i
-e $tcname $tcOP =~ /create/i
MC/DC0%0/2
$outputFormat =~ /text/i and $pr2Screen == 1
$outputFormat =~ /text/i $pr2Screen == 1
Truth table100%3/3
A or B
A= -e $tcnameB= $tcOP =~ /create/i
ABresult
1X1
011
000
Truth table33%1/3
A and B
A= $outputFormat =~ /text/iB= $pr2Screen == 1
ABresult
0X0
100
111
2316  
2317 # printf "%-20s %-40s ", "processTC:", $tcname if (($outputFormat =~ /text/i) && ($pr2Screen ==1)) ; # print for webUI 1/2
2318 46 my $tmp = sprintf "%-20s %-40s\n", "processTC: ", $tcname ;
2319 46 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'."_listHistory.txt", "$tmp");
2320 46 my $rst;
2321  
2322 46 ▶ if ( $tcOP =~ /^\s*create/i ) {
Branch: 15 branches
BranchTrueFalseTotal
if ($tcOP =~ /^\s*create/i) { } 9 37 46
elsif ($tcOP =~ /^\s*exec\b/i) { } 6 31 37
elsif ($tcOP =~ /^\s*mark\b/i) { } 0 31 31
elsif ($tcOP =~ /^\s*execAll/i) { } 0 31 31
elsif ($tcOP =~ /^\s*UpdateWeb/i) { } 0 31 31
elsif ($tcOP =~ /^\s*getWeb_/i) { } 0 31 31
elsif ($tcOP =~ /^\s*log/i) { } 0 31 31
elsif ($tcOP =~ /^\s*detect/i) { } 16 15 31
elsif ($tcOP =~ /^\s*getLogName/i) { } 2 13 15
elsif ($tcOP =~ /^\s*listTCFilters/i) { } 0 13 13
elsif ($tcOP =~ /^\s*printtcFilters/i) { } 0 13 13
elsif ($tcOP =~ /^\s*listHistory/i) { } 0 13 13
elsif ($tcOP =~ /^\s*printResult/i) { } 0 13 13
elsif ($tcOP =~ /^\s*list|get\b/i) { } 0 13 13
elsif ($tcOP =~ /^\s*delete/i) { } 12 1 13
2323 9 ▶ if ($cmd) { $rst = &createTC("cmd=$cmd",$tcname); }
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd) { } 5 4 9
2324 4 else { $rst = &createTC($tcname); }
2325 } elsif ( $tcOP =~ /^\s*exec\b/i ) {
2326 0 ▶ if ($NofExecutionCtr== 1 ) {$rst = &markTC_($tcname);}
Branch: 1 branch
BranchTrueFalseTotal
if ($NofExecutionCtr == 1) 0 6 6
2327 6 $rst = &execTC_($tcname);
2328 6 my $rst1 = &mapTC($tcname);
2329 } elsif ( $tcOP =~ /^\s*mark\b/i ) {
2330 0 $rst = &markTC_($tcname);
2331 } elsif ( $tcOP =~ /^\s*execAll/i ) {
2332 0 $rst = &tcLoop();
2333 0 return $rst;
2334 } elsif ( $tcOP =~ /^\s*UpdateWeb/i ) {
2335 0 ▶ if (defined $cmd) {;} else { $cmd = 0;}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $cmd) { } 0 0 0
2336 0 $rst = &updateWeb_($tcname,$cmd);
2337 } elsif ( $tcOP =~ /^\s*getWeb_/i ) {
2338 0 $rst = &getWeb_($tcname);
2339 } elsif ( $tcOP =~ /^\s*log/i ) {
2340 0 $rst = &logTC($tcname);
2341 } elsif ( $tcOP =~ /^\s*detect/i ) {
2342 16 $rst = &detectTC($tcname, $SvrProjName, $SvrDrive);
2343 } elsif ( $tcOP =~ /^\s*getLogName/i ) {
2344 2 $rst = &getTCLogFname(&getTCName($tcname));
2345 } elsif ( $tcOP =~ /^\s*listTCFilters/i ) {
2346 0 $rst = &getProperties(&getTCName($tcname) , '.*_all_', 'latest');
2347 } elsif ( $tcOP =~ /^\s*printtcFilters/i ) {
2348 0 $rst = &getProperties(&getTCName($tcname) , '.*_all_', 'latest');
2349 } elsif ( $tcOP =~ /^\s*listHistory/i ) {
2350 0 $rst = &getProperties(&getTCName($tcname) , 'tcRunResult', 'history');
2351 } elsif ( $tcOP =~ /^\s*printResult/i ) {
2352  
2353 } elsif ( $tcOP =~ /^\s*list|get\b/i ) {
2354 0 $rst = &getProperties(&getTCName($tcname) , 'tcRunResult', 'last'); # return last valid TC result
2355 0 my $rst1 = &mapTC($tcname);
2356 } elsif ( $tcOP =~ /^\s*delete/i ) {
2357 12 $tcOP =~ s/^\s*delete\s*=//g;
2358 12 $tcOP =~ s/\s*$//g;
2359 12 $rst = &deleteTC($tcname);
2360 } else {
2361 1 ▶ if ( -e $tcname ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tcname) 0 1 1
2362 0 ▶ print "<- Test suite \n" if $prMsg;
Branch: 1 branch
BranchTrueFalseTotal
if $prMsg 0 0 0
2363 }
2364 1 return "_noProcessedTC_";
2365 }
2366 45 ▶ printf "%s\n", $rst if (($outputFormat =~ /text/i)&&($pr2Screen == 1)) ; # print for webUI 2/2
Branch: 1 branch
BranchTrueFalseTotal
if $outputFormat =~ /text/i and $pr2Screen == 1 0 45 45
Condition33%1/3
$outputFormat =~ /text/i and $pr2Screen == 1
!ll&&!rl&&r
0450
MC/DC0%0/2
$outputFormat =~ /text/i and $pr2Screen == 1
$outputFormat =~ /text/i $pr2Screen == 1
Truth table33%1/3
A and B
A= $outputFormat =~ /text/iB= $pr2Screen == 1
ABresult
0X0
100
111
2367 45 &appendtoFile_($SvrDrive.'/'.$SvrProjName.'/'."_listHistory.txt","$rst\n") ;
2368 45 $rst = sprintf "%-20s %-40s %s", "processTC:", $tcname, $rst ;
2369 45 return $rst;
2370 }
2371  
2372 sub Queue { # &Queue(push,"pushedContenet") $rst = &Queue(pop)
2373 0 ▶ shift;
Subroutine Queue: not called CC=37 SCAR=72.5
Pod undocumented
2374 0 my @pushQueue; my @popQueue; $#pushQueue=0, $#popQueue=0;
2375 0 ▶ my $operation = "push"; $operation = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
2376 0 my $tafCmd = shift;
2377 0 my $pushQueueSize; my $queueLength=0; my $queueSize=0;
2378  
2379 ################# Set/release/check Lock ###################
2380 0 ▶ if ($operation =~ /setLock/i) {
Branch: 3 branches
BranchTrueFalseTotal
if ($operation =~ /setLock/i) { } 0 0 0
elsif ($operation =~ /releaseLock/i) { } 0 0 0
elsif ($operation =~ /checkLock/i) { } 0 0 0
2381 0 open Fin, ">$lockFName"; print Fin "lock is ON\n"; close Fin; return;
2382 } elsif ($operation =~ /releaseLock/i) {
2383 0 unlink $lockFName;
2384 } elsif ($operation =~ /checkLock/i) {
2385 0 ▶ if (-e $lockFName) { return 1;}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $lockFName) { } 0 0 0
2386 0 else { return 0; }
2387 }
2388 ################# Set/release/check Lock ###################
2389 0 ▶ if (-e "$c/$_TAF/$queueFName") {;} else { open Fout, ">$c/$_TAF/$queueFName"; close Fout ; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/$queueFName") { } 0 0 0
2390 0 open Fin, "$c/$_TAF/$queueFName" ;
2391 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
2392 0 ▶ if ($_ =~ /^\s*(pushed|poped)\s*\((.+)\):\s*(.+)\s*$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^\s*(pushed|poped)\s*\((.+)\):\s*(.+)\s*$/) 0 0 0
2393 0 my $status = $1; my $index = $2; my $content = $3;
2394 0 ▶ if ($status =~ /pushed/) { $pushQueue[$index] = $content;}
Branch: 1 branch
BranchTrueFalseTotal
if ($status =~ /pushed/) 0 0 0
2395 0 ▶ if ($status =~ /poped/ ) { $popQueue[$index] = $content;}
Branch: 1 branch
BranchTrueFalseTotal
if ($status =~ /poped/) 0 0 0
2396 }
2397 }
2398 0 close Fin;
2399  
2400 ################# generate Active Queue & update Queue Operation ###################
2401 0 ▶ if (($#popQueue < $#pushQueue ) || ($operation =~ /updateQueue/i)) { open Fin, ">$c/$_TAF/${queueFName}_active";
Branch: 1 branch
BranchTrueFalseTotal
if ($#popQueue < $#pushQueue or $operation =~ /updateQueue/i) 0 0 0
Condition0%0/3
$#popQueue < $#pushQueue or $operation =~ /updateQueue/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$#popQueue < $#pushQueue or $operation =~ /updateQueue/i
$#popQueue < $#pushQueue $operation =~ /updateQueue/i
Truth table0%0/3
A or B
A= $#popQueue < $#pushQueueB= $operation =~ /updateQueue/i
ABresult
1X1
011
000
2402 0 ▶ for (my $i = $#popQueue+1; $i<=$#pushQueue; $i++) { printf Fin "[%5d] %s\n", $i, $pushQueue[$i] if (defined $pushQueue[$i]); }
Branch: 2 branches
BranchTrueFalseTotal
if ($i <= $#pushQueue) 0 0 0
if defined $pushQueue[$i] 0 0 0
2403 0 ▶ if ($#popQueue+1 > $#pushQueue) { print Fin "No task to proceed\n";}
Branch: 1 branch
BranchTrueFalseTotal
if ($#popQueue + 1 > $#pushQueue) 0 0 0
2404 0 close Fin; }
2405 ################# generate Active Queue & reset Queue Operation ###################
2406 0 ▶ if (($#popQueue < $#pushQueue ) || ($operation =~ /reset/i)) { open Fin, ">$c/$_TAF/${queueFName}_active";
Branch: 1 branch
BranchTrueFalseTotal
if ($#popQueue < $#pushQueue or $operation =~ /reset/i) 0 0 0
Condition0%0/3
$#popQueue < $#pushQueue or $operation =~ /reset/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$#popQueue < $#pushQueue or $operation =~ /reset/i
$#popQueue < $#pushQueue $operation =~ /reset/i
Truth table0%0/3
A or B
A= $#popQueue < $#pushQueueB= $operation =~ /reset/i
ABresult
1X1
011
000
2407 0 ▶ for (my $i = $#popQueue+1; $i<=$#pushQueue; $i++) { printf Fin "[%5d] %s\n", $i, $pushQueue[$i] if (defined $pushQueue[$i]); }
Branch: 2 branches
BranchTrueFalseTotal
if ($i <= $#pushQueue) 0 0 0
if defined $pushQueue[$i] 0 0 0
2408 0 ▶ if ($#popQueue+1 > $#pushQueue) { print Fin "No task to proceed\n";}
Branch: 1 branch
BranchTrueFalseTotal
if ($#popQueue + 1 > $#pushQueue) 0 0 0
2409 0 close Fin; }
2410  
2411 ################# autoReset Operation ###################
2412 0 ▶ if (($#popQueue > $queueSizeLimit ) || ($operation =~ /reset/i)) { open Fin, ">$c/$_TAF/$queueFName"; close Fin; return; }
Branch: 1 branch
BranchTrueFalseTotal
if ($#popQueue > $queueSizeLimit or $operation =~ /reset/i) 0 0 0
Condition0%0/3
$#popQueue > $queueSizeLimit or $operation =~ /reset/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$#popQueue > $queueSizeLimit or $operation =~ /reset/i
$#popQueue > $queueSizeLimit $operation =~ /reset/i
Truth table0%0/3
A or B
A= $#popQueue > $queueSizeLimitB= $operation =~ /reset/i
ABresult
1X1
011
000
2413
2414 0 $pushQueueSize = $#pushQueue + 1;
2415 ################# QueueSize ###################
2416 0 ▶ if ($operation =~ /queueSize/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($operation =~ /queueSize/i) 0 0 0
2417 0 return ($#pushQueue - $#popQueue);
2418 }
2419  
2420 ################# Push Operation ###################
2421 0 ▶ if ($operation =~ /push/i) {
Branch: 3 branches
BranchTrueFalseTotal
if ($operation =~ /push/i) { } 0 0 0
elsif ($operation =~ /pop/i) { } 0 0 0
elsif ($operation =~ /checkQueue/i) { } 0 0 0
2422  
2423 0 ▶ if (defined $tafCmd) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $tafCmd) 0 0 0
2424 0 ▶ if (($tafCmd =~ /set_property[1-2]/i) || ($tafCmd =~ /get_property[1-2]/i) || ($tafCmd =~ /printTcFilters/i)) { ;
Branch: 1 branch
BranchTrueFalseTotal
if ($tafCmd =~ /set_property[1-2]/i or $tafCmd =~ /get_property[1-2]/i or $tafCmd =~ /printTcFilters/i) { } 0 0 0
Condition0%0/6
$tafCmd =~ /set_property[1-2]/i or $tafCmd =~ /get_property[1-2]/i or $tafCmd =~ /printTcFilters/i
l!l&&r!l&&!r
000
$tafCmd =~ /set_property[1-2]/i or $tafCmd =~ /get_property[1-2]/i
l!l&&r!l&&!r
000
MC/DC0%0/3
$tafCmd =~ /set_property[1-2]/i or $tafCmd =~ /get_property[1-2]/i or $tafCmd =~ /printTcFilters/i
$tafCmd =~ /set_property[1-2]/i $tafCmd =~ /get_property[1-2]/i $tafCmd =~ /printTcFilters/i
Truth table0%0/4
A or B or C
A= $tafCmd =~ /set_property[1-2]/iB= $tafCmd =~ /get_property[1-2]/iC= $tafCmd =~ /printTcFilters/i
ABCresult
1XX1
01X1
0011
0000
2425 } else {
2426 0 open Fin, ">>$c/$_TAF/$queueFName"; print Fin "pushed ($pushQueueSize): $tafCmd\n"; close Fin;
2427 0 return;
2428 }
2429 }
2430 }
2431  
2432 ################# Pop Operation ###################
2433 elsif ($operation =~ /pop/i) {
2434 0 ▶ for (my $i = 1; $i <= $#pushQueue; $i++ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#pushQueue) 0 0 0
2435 0 ▶ if (defined $popQueue[$i] ) { ; } else { # already popped
Branch: 1 branch
BranchTrueFalseTotal
if (defined $popQueue[$i]) { } 0 0 0
2436 0 ▶ if ((defined $pushQueue[$i]) && ($pushQueue[$i] !~ /_notPushed_ignored/i)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $pushQueue[$i] and not $pushQueue[$i] =~ /_notPushed_ignored/i) { } 0 0 0
Condition0%0/3
defined $pushQueue[$i] and not $pushQueue[$i] =~ /_notPushed_ignored/i
!ll&&!rl&&r
000
MC/DC0%0/2
defined $pushQueue[$i] and not $pushQueue[$i] =~ /_notPushed_ignored/i
defined $pushQueue[$i] not $pushQueue[$i] =~ /_notPushed_ignored/i
Truth table0%0/3
A and not(B)
A= defined $pushQueue[$i]B= not $pushQueue[$i] =~ /_notPushed_ignored/i
ABresult
0X0
100
111
2437 0 open Fin, ">>$c/$_TAF/$queueFName"; print Fin "poped ($i): $pushQueue[$i]\n"; close Fin;
2438 0 return $pushQueue[$i];
2439 } else {
2440 0 open Fin, ">>$c/$_TAF/$queueFName"; print Fin "poped ($i): _notPushed_ignored\n"; close Fin;
2441 0 return "_notPushed_ignored";
2442 }
2443 }
2444 }
2445 }
2446 ################# check Operation ###################
2447 elsif ($operation =~ /checkQueue/i) {
2448 0 ▶ for (my $i = 0; $i <= $#pushQueue; $i++ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#pushQueue) 0 0 0
2449 0 ▶ if (defined $popQueue[$i] ) { ; } else { # already popped
Branch: 1 branch
BranchTrueFalseTotal
if (defined $popQueue[$i]) { } 0 0 0
2450 0 return $pushQueue[$i];
2451 }
2452 }
2453 }
2454  
2455 }
2456  
2457 sub listAll {
2458 0 ▶ find({preprocess=> sub {return reverse sort @_;}, wanted=> \&recursiveSearchListAll}, $SvrDrive); }
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine listAll: not called CC=1 SCAR=6.9
Pod undocumented
2459 sub recursiveSearchListAll() {
2460 0 ▶ if (($File::Find::name =~ /tc.pl/) && ($File::Find::name =~ /$SvrTCNamePattern/i))
Subroutine recursiveSearchListAll: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($File::Find::name =~ /tc.pl/ and $File::Find::name =~ /$SvrTCNamePattern/i) 0 0 0
Condition0%0/3
$File::Find::name =~ /tc.pl/ and $File::Find::name =~ /$SvrTCNamePattern/i
!ll&&!rl&&r
000
MC/DC0%0/2
$File::Find::name =~ /tc.pl/ and $File::Find::name =~ /$SvrTCNamePattern/i
$File::Find::name =~ /tc.pl/ $File::Find::name =~ /$SvrTCNamePattern/i
Truth table0%0/3
A and B
A= $File::Find::name =~ /tc.pl/B= $File::Find::name =~ /$SvrTCNamePattern/i
ABresult
0X0
100
111
2461 {
2462 0 print "$File::Find::name\n";
2463
2464 }
2465 }
2466  
2467 sub createTS { # Create Testsuite for Testbed
2468 # 1 create index.pl from /tmp/createTS_indexindex.pl
2469 # 2 create index.pl from /tmp/createTS_index.pl
2470 # 3 create powershell HelloWorld TS (index.pl and index.ps)
2471 # 4 create Perl HelloWorld TS (index.pl)
2472 # &generateTAFTestsuie() displays TS on webUI
2473  
2474  
2475 0 ▶ if ($SvrProjName !~ /$c/i) { print "Warning: testcase should start with $c\n"; }
Subroutine createTS: not called CC=9 SCAR=45.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless ($SvrProjName =~ /$c/i) 0 0 0
2476 0 ▶ my $tsName = $SvrProjName; $tsName = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
2477 0 ▶ $SvrProjName = $tsName; if (-e $SvrProjName) {;} else { mkdir $SvrProjName; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrProjName) { } 0 0 0
2478  
2479 0 ▶ if (-e "$SvrProjName/$TSHookNameParent") {
Branch: 5 branches
BranchTrueFalseTotal
if (-e "$SvrProjName/$TSHookNameParent") { } 0 0 0
elsif (-e "$c/$_TAF/$createTS_indexindex") { } 0 0 0
elsif (-e "$c/$_TAF/$createTS_index") { } 0 0 0
elsif ($SvrProjName =~ s/_powershell_//i) { } 0 0 0
elsif ($NofTCinTSTemplate != -1) { } 0 0 0
2480 0 my $rst = `$perl $SvrProjName/$TSHookNameParent`;
2481 0 print "$SvrProjName/$TSHookName is generated from $SvrProjName/$TSHookNameParent\n";
2482 ;
2483 } elsif (-e "$c/$_TAF/$createTS_indexindex" ) {
2484 0 print " --> Create $SvrProjName <- from $c/$_TAF/$createTS_indexindex\n";
2485 0 copy ("$c/$_TAF/$createTS_indexindex", "$SvrProjName/$createTS_indexindex");
2486 0 print "$SvrProjName/$createTS_indexindex is running ......\n";
2487 0 my $rst = `$perl $SvrProjName/$createTS_indexindex`;
2488 0 print "$SvrProjName/$createTS_indexindex is completed.....\n";
2489 } elsif (-e "$c/$_TAF/$createTS_index" ) {
2490 0 print " --> Create $SvrProjName <- from $c/$_TAF/$createTS_index\n";
2491 0 move ("$c/$_TAF/$createTS_index", "$SvrProjName/$TSHookNameGenerated");
2492 } elsif ($SvrProjName =~ s/_powershell_//i) {
2493 0 print " --> Create Powershell Testsuite: $SvrProjName\n"; &generatePowershell_ps1_template($SvrProjName);
2494 } elsif ($NofTCinTSTemplate != -1 ) {
2495 0 &createTS_B($SvrProjName);
2496 } else {
2497 0 print " --> Create Perl Testsuite: $SvrProjName\n"; &generatePerl_pl_template($SvrProjName);
2498 }
2499 0 &generateTAFTestsuite ();
2500 0 1;
2501 }
2502  
2503  
2504 sub createTS_save { # Create Testsuite for Testbed
2505  
2506 0 ▶ if ($SvrProjName !~ /$c/i) { print "Warning: testcase should start with $c\n"; }
Subroutine createTS_save: not called CC=8 SCAR=42.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless ($SvrProjName =~ /$c/i) 0 0 0
2507 0 ▶ my $tsName = $SvrProjName; $tsName = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
2508 0 ▶ $SvrProjName = $tsName; if (-e $SvrProjName) {;} else { mkdir $SvrProjName; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrProjName) { } 0 0 0
2509 0 ▶ if (-e "$c/$_TAF/$createTS_indexindex" ) {
Branch: 4 branches
BranchTrueFalseTotal
if (-e "$c/$_TAF/$createTS_indexindex") { } 0 0 0
elsif (-e "$c/$_TAF/$createTS_index") { } 0 0 0
elsif ($SvrProjName =~ s/_powershell_//i) { } 0 0 0
elsif ($NofTCinTSTemplate != -1) { } 0 0 0
2510 0 print " --> Create $SvrProjName <- from $c/$_TAF/$createTS_indexindex\n";
2511 0 copy ("$c/$_TAF/$createTS_indexindex", "$SvrProjName/$createTS_indexindex");
2512 0 print "$SvrProjName/$createTS_indexindex is running ......\n";
2513 0 my $rst = `$perl $SvrProjName/$createTS_indexindex`;
2514 0 print "$SvrProjName/$createTS_indexindex is completed.....\n";
2515 } elsif (-e "$c/$_TAF/$createTS_index" ) {
2516 0 print " --> Create $SvrProjName <- from $c/$_TAF/$createTS_index\n";
2517 0 move ("$c/$_TAF/$createTS_index", "$SvrProjName/$TSHookNameGenerated");
2518 } elsif ($SvrProjName =~ s/_powershell_//i) {
2519 0 print " --> Create Powershell Testsuite: $SvrProjName\n"; &generatePowershell_ps1_template($SvrProjName);
2520 } elsif ($NofTCinTSTemplate != -1 ) {
2521 0 &createTS_B($SvrProjName);
2522 } else {
2523 0 print " --> Create Perl Testsuite: $SvrProjName\n"; &generatePerl_pl_template($SvrProjName);
2524 }
2525 0 &generateTAFTestsuite ();
2526 0 1;
2527 }
2528 sub addTS {
2529 0 ▶ my $tsName = "_testsuite_"; $tsName = shift if @_;
Subroutine addTS: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
2530 0 ▶ if (-e $tsName) { print " --> Add Testsuite Hook : $tsName \n"; return 0; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $tsName) { } 0 0 0
2531 0 else { print "[Warning] Testsuite ($tsName) doesn't exist. No testsuite hook is added\n";
2532 0 return 1;}
2533 }
2534  
2535  
2536  
2537 0 ▶sub deleteTS { goto &deleteTAFTestsuite }
Subroutine deleteTS: not called CC=1 SCAR=6.9
Pod undocumented
2538 0 ▶sub updateTS {goto &listTS}
Subroutine updateTS: not called CC=1 SCAR=6.9
Pod undocumented
2539 sub listTS {
2540 0 ▶ my $tsName = $SvrProjName; $tsName = shift if @_;
Subroutine listTS: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
2541 0 $SvrProjName = $tsName;
2542 0 &processTCs ("","tcDelay=0;performanceMode=fast;testcaseNode=$testcaseNode;testsuite=$SvrProjName;AutomationtsName=$SvrProjName;list");
2543 0 return 1;
2544 }
2545  
2546 sub generateIndexIndexIndex {
2547 0 ▶my $str=<<'EOFIndex3'
Subroutine generateIndexIndexIndex: not called CC=4 SCAR=30.0
Pod undocumented
2548 use File::Path;
2549 $tcName = "_testsuite1_";
2550 if ($ARGV[0] =~ /\bh\b/i) {
2551 print<<EOF;
2552 ##############################################################################
2553 Purpose: create a skeleton of indexindex.pl for AF delivery testing
2554  
2555 Format : $0 tsName (like _testsuit1_)
2556  
2557 Output c:/iiiiiiii/\$tsName/indexindex.pl
2558 ##############################################################################
2559  
2560 [WindowOS]
2561 * T Purpose: Delivery TS (indexindex.pl) commands
2562 Setup : c:/iiiiiiii/bin/indexindexindex.pl _testsuite4_
2563 Execution: c:/iiiiiiii/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action installIndexIndex -tsName _testsuite4_
2564 Verify. : WebUI http://pppppppppp01.iiiiiiiinp.com:1234/index_http.htm has _testsuite4_
2565 Teardown : c:/iiiiiiii/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action delete -tsName _testsuite3_
2566  
2567 * T Purpose: Delivery TS (index.pl) commands
2568 Setup : c:/_TAF/taf.pl testsuite=c:/iiiiiiii/_testsuite5_;createTS
2569 Execution: c:/iiiiiiii/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action installIndex -tsName _testsuite5_
2570 Verify. : WebUI http: http://pppppppppp01.iiiiiiiinp.com:1234/index_http.htm has _testsuite5_
2571 Teardown : c:/iiiiiiii/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action delete -tsName _testsuite5_
2572  
2573  
2574 [LinuxOS]
2575 * T Purpose: Delivery TS (indexindex.pl) commands
2576 Setup : /usr/bin/perl /tmp/var/www/cgi-bin/indexindexindex.pl _testsuite4_
2577 Execution: /usr/bin/perl /tmp/var/www/cgi-bin/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action installIndexIndex -tsName _testsuite4_
2578 Verify. : WebUI http://pppppppppp01.iiiiiiiinp.com:1234/index_http.htm has _testsuite4_
2579 Teardown : /usr/bin/perl /tmp/var/www/cgi-bin/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action delete -tsName _testsuite3_
2580  
2581 * T Purpose: Delivery TS (index.pl) commands
2582 Setup : /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_testsuite5_~createTS
2583 Execution: /usr/bin/perl /tmp/var/www/cgi-bin/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action installIndex -tsName _testsuite5_
2584 Verify. : /usr/bin/perl /tmp/var/www/cgi-bin/ WebUI http: http://pppppppppp01.iiiiiiiinp.com:1234/index_http.htm has _testsuite5_
2585 Teardown : /usr/bin/perl /tmp/var/www/cgi-bin/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action delete -tsName _testsuite5_
2586  
2587 Note: Remote Test Case and Test Suite Execution Commands
2588  
2589 c:/iiiiiiii/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action installIndexIndex -tsName _testsuite4_
2590 /tmp/var/www/cgi-bin/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action installIndexIndex -tsName _testsuite4_
2591  
2592 c:/iiiiiiii/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action run -tsName _testsuite4_~testcase=testcase0006
2593 /tmp/var/www/cgi-bin/AutomationFramework/index.pl -runAsCmd -host pppppppppp01.iiiiiiiinp.com -action run -tsName _testsuite4_~testcase=testcase0006
2594
2595  
2596 EOF
2597 exit;
2598 }
2599 if ($ARGV[0]) {$tcName = $ARGV[0]; }
2600 my $tcDir = "/tmp/var/www/cgi-bin/$tcName"; if ($^O =~ /linux/) { $tcDir = "/tmp/var/www/cgi-bin/$tcName"; } elsif ($^O =~ /win32/i) { $tcDir = "c:/iiiiiiii/$tcName"; }
2601  
2602 if (-e $tcDir ) {;} else { mkpath $tcDir ;}
2603 my $index = "$tcDir/indexindex.pl"; my $ctr; my %tcExec ; my %tcDesc;
2604  
2605 open Fout, "> $index";
2606  
2607 my $str=<<'EOF3';
2608 use File::Path;
2609 $tcName = "_testsuite1_";
2610  
2611 my $tcDir = "/tmp/var/www/cgi-bin/$tcName"; if ($^O =~ /linux/) { $tcDir = "/tmp/var/www/cgi-bin/$tcName"; } elsif ($^O =~ /win32/i) { $tcDir = "c:/iiiiiiii/$tcName"; }
2612  
2613 if (-e $tcDir ) {;} else { mkpath $tcDir ;}
2614 my $index = "$tcDir/index.pl"; my $ctr; my %tcExec ; my %tcDesc;
2615  
2616 open Fout, ">$index";
2617 my $str=<<'EOF1'
2618 #!C:/strawberry/perl/bin/perl.exe
2619 $tcName = "_testsuite1_";
2620 if ($^O =~ /win32/i) { $_TAF = "c:"; } if ($^O =~ /linux/i) { $_TAF = "/tmp/var/www/cgi-bin"; }
2621 $tcDir = "$_TAF/$tcName";
2622  
2623  
2624 if ($ARGV[0]) {
2625 open Fout, ">$tcDir/_tcLogAppend.txt";
2626 if ($ARGV[0] == 1) { print "pass"; } # <<< plug in the test case 1 here e.g. print `index.pl 1` ; >>>
2627 if ($ARGV[0] == 2) { print "pass"; } # <<< plug in the test case 2 here e.g. print `index.pl 2`>>>
2628 if ($ARGV[0] == 3) { print "pass"; } # <<< plug in the test case 3 here e.g. print `index.pl 3`>>>
2629 if ($ARGV[0] == 4) { print "pass"; } # <<< plug in the test case 4 here e.g. print `index.pl 4`>>>
2630 if ($ARGV[0] == 5) { print "pass"; } # <<< plug in the test case 5 here e.g. print `index.pl 5`>>>
2631 if ($ARGV[0] == 6) { print "pass"; } # <<< plug in the test case 6 here e.g. print `index.pl 6`>>>
2632 close Fout;
2633 } else {
2634 print <<EOF;
2635 1. Test case description 1 for < > \$ \% @ ( ) testing the function 1 --- Please modifyaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa _smoke_ _regression_
2636 2. Test case description 2 for testing _smoketest__regressiontest_the function 2 --- Please modifybbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb _smoke_
2637 3. Test case description 3 for testing _smoketest_the function 3 --- Please modifycddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd _regression_
2638 4. Test case description 4 for testing _regressiontest_the function 4 --- Please modify _smoke_
2639 5. Test case description 5 for testing _regressiontest_the function 5 --- Please modify
2640 6. Test case description 6 for testing the function 6 --- Please modify
2641 EOF
2642 ;
2643 }
2644  
2645 EOF1
2646 ;
2647 $str =~ s/_testsuite1_/$tcName/g;
2648 print Fout $str;
2649 close Fout;
2650 print " -> c:/iiiiiiii/_testsuite1_/index.pl";
2651  
2652 EOF3
2653 ;
2654  
2655 $str =~ s/_testsuite1_/$tcName/g;
2656  
2657 print Fout $str;
2658 close Fout;
2659 print " -> $index\n";
2660 EOFIndex3
2661 ;
2662  
2663 0 my $fname ;
2664 0 ▶if ($^O =~ /win32/i) { $fname = "$_TAF/bin/indexindexindex.pl"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 0 0
2665 0 ▶if ($^O =~ /linux/i) { $fname = "/tmp/indexindexindex.pl"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 0 0 0
2666 0 ▶if ( -e $fname) {;} else { open Fout, ">$fname"; print Fout $str; close Fout; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) { } 0 0 0
2667 # print " -> $fname\n";
2668 }
2669  
2670  
2671 sub createTS_B { # $NofTCinTSTenplate is a global var
2672 0 ▶ my $cmd = $SvrProjName; my $tcDir = "c:/_TAF";
Subroutine createTS_B: not called CC=5 SCAR=34.0
Pod undocumented
2673 0 ▶ if (-e $cmd) {;} else { mkdir $cmd; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $cmd) { } 0 0 0
2674 0 mkpath $cmd;
2675 0 open Fout, "> $cmd/index.pl";
2676 0 my $tsNameTmp = &getRoot($cmd);
2677  
2678 0 my %tcDesc; my %tcExec;
2679 0 ▶for (my $i = 1; $i <= $NofTCinTSTemplate; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $NofTCinTSTemplate) 0 0 0
2680 0 $tcExec{"$i"}=" if (\$ARGV[0] == $i) { print \\\"pass\\\"; } # <<< plug in the test case 1 here e.g. print `index.pl 1` ; >>>";
2681 0 $tcDesc{"$i"}=" $i Test case Desc for TC$i";
2682 }
2683  
2684 0 print Fout <<EOF;
2685 #!/usr/bin/perl.exe
2686 \$tcName = "$tsNameTmp";
2687 if (\$^O =~ /win32/i) { \$_TAF = "c:"; } if (\$^O =~ /linux/i) { \$_TAF = "/tmp/var/www/cgi-bin"; }
2688 \$tcDir = "\$_TAF/\$tcName";
2689  
2690 if (\$ARGV[0]) {
2691 open Fout, ">\$tcDir/_tcLogAppend.txt";
2692  
2693 EOF
2694  
2695 0 my $ctr = 1;
2696 0 foreach my $each (sort {$a <=> $b} keys %tcExec) { print Fout "if (\$ARGV[0] == ".$ctr++.") \{print Fout \"$tcExec{$each}\"; print \"null\";\}\n"; }
2697  
2698 0 print Fout <<EOF;
2699 close Fout;
2700 } else {
2701  
2702 EOF
2703 0 print Fout "\nprint<<EOF;\n";
2704  
2705 0 $ctr = 1;
2706 0 foreach my $each (sort {$a <=> $b} keys %tcDesc) { print Fout $ctr++.". $tcDesc{$each}\n"; }
2707  
2708 0 print Fout "EOF\n}\n";
2709  
2710 0 close Fout;
2711 0 print " -> $cmd/index.pl\n";
2712 }
2713  
2714  
2715 sub createTC {
2716 0 ▶ my $tc_pl="tc.pl"; my $cmd=''; $cmd = shift;
Subroutine createTC: called CC=28 SCAR=49.7
Pod undocumented
2717 9 ▶ if ($cmd =~ /^\s*$/) { print "Warning: createTC lack the cmd. \n"; exit; }
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /^\s*$/) 0 9 9
2718 0 ▶ if ($cmd !~ /^\s*cmd\s*=/i) { unshift @_, $cmd; } ;
Branch: 1 branch
BranchTrueFalseTotal
unless ($cmd =~ /^\s*cmd\s*=/i) 4 5 9
2719 9 my $tcNameRoot = "@_"; my $sleep = 0;
2720 9 ▶ if ($cmd =~ /sleep\s*=\s*(\d+)/ ) { $sleep = $1; }
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /sleep\s*=\s*(\d+)/) 0 9 9
2721 9 my $tcName = &getTCName("@_");
2722 0 ▶ if( &detectTC($tcName) =~ /exists/ && ($cmd !~ /Over/i) && ( $overWriteTC =~ /n/i)) { # overwrite
Branch: 1 branch
BranchTrueFalseTotal
if (&detectTC($tcName) =~ /exists/ and not $cmd =~ /Over/i and $overWriteTC =~ /n/i) { } 0 9 9
Condition83%5/6
&detectTC($tcName) =~ /exists/ and not $cmd =~ /Over/i and $overWriteTC =~ /n/i
!ll&&!rl&&r
720
&detectTC($tcName) =~ /exists/ and not $cmd =~ /Over/i
!ll&&!rl&&r
612
MC/DC0%0/3
&detectTC($tcName) =~ /exists/ and not $cmd =~ /Over/i and $overWriteTC =~ /n/i
&detectTC($tcName) =~ /exists/ not $cmd =~ /Over/i $overWriteTC =~ /n/i
Truth table75%3/4
A and not(B) and C
A= &detectTC($tcName) =~ /exists/B= not $cmd =~ /Over/iC= $overWriteTC =~ /n/i
ABCresult
0XX0
10X0
1100
1111
2723 9 return "\n\tWarning $tcName already exist! (use -create;cmd=overwrite to overwrite)" ; }
2724 else {
2725 9 mkpath($tcName);
2726 ######################## tc.hta ##########################
2727 0 @_ = split "\/", $tcName;
2728 9 my $testsuite = $_[2]; my $testcase = $_[3];
2729 9 my $now = &UnixDate(&DateCalc("now","+ 6 seconds") , "%H:%M:%S" );
2730  
2731 9 ▶ if ($testsuite) {;} else { print "[Info] \$testsuite is null. Note \$tcName = $tcName\n"; $testsuite ="";}
Branch: 1 branch
BranchTrueFalseTotal
if ($testsuite) { } 9 0 9
2732 0 ▶ if ($testcase ) {;} else { print "[Info] \$testcase is null. Note \$tcName = $tcName\n"; $testcase = "";}
Branch: 1 branch
BranchTrueFalseTotal
if ($testcase) { } 9 0 9
2733  
2734 0 my $tcNameIIS = $tcName;
2735 0 ▶ if ($tcNameIIS) {;} else { print "[Info] \$tcName is null, \$tcNameIIS = $c.':/inetpub/wwwroot/'\n"; $tcNameIIS = $c.':/inetpub/wwwroot/';}
Branch: 1 branch
BranchTrueFalseTotal
if ($tcNameIIS) { } 9 0 9
2736 0 &createFile( $tcNameIIS.'/'.'tc.hta',
2737 "
2738 <html>
2739 <head>
2740 <script language=\"JavaScript\">
2741 function RunFileHTTP(testsuite, testcase) {
2742 // alert(\"testsuite is \" + testsuite + \" testcase is \" + testcase );
2743 WshShell = new ActiveXObject(\"WScript.Shell\");
2744 cmd= '$c\\\\windows\\\\system32\\\\schtasks.exe /delete /tn TAF_'+ testsuite + '_' + testcase + ' /f';
2745 sleep (1000);
2746 //alert (cmd);
2747 WshShell.Run(cmd, 1, false);
2748 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /create /TR \"$c\\\\$_TAF\\\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec\" /TN TAF_'+testsuite+'_'+testcase+' /sc monthly /mo 1 /F';
2749 sleep (1000);
2750 //alert (cmd);
2751 WshShell.Run(cmd, 1, false);
2752 cmd= '$c\\\\windows\\\\system32\\\\schtasks.exe /run /tn TAF_'+testsuite+'_'+testcase;
2753 sleep (1000);
2754 //alert (cmd);
2755 WshShell.Run(cmd, 1, false);
2756 }
2757  
2758 function sleep(milliseconds) {
2759 var start = new Date().getTime();
2760 for (var i = 0; i < 1e7; i++) {
2761 if ((new Date().getTime() - start) > milliseconds){
2762 break;
2763 }
2764 }
2765 }
2766  
2767  
2768 // <a onclick=\"RunFileHTTP(\'$testsuite\', \'$testcase\')\">Click this to run Run Program</button> <p>
2769 </script>
2770 </head>
2771 <body onLoad =\"RunFileHTTP(\'$testsuite\', \'$testcase\')\">Run $testsuite\/$testcase\/tc.hta</button> <p>
2772 </body>
2773 </html>
2774 "
2775 );
2776  
2777 ######################## tc.hta ##########################
2778  
2779 0 ▶ if ($cmd =~ /\bPerf\b/i) { # PerformanceTC
Branch: 6 branches
BranchTrueFalseTotal
if ($cmd =~ /\bPerf\b/i) { } 1 8 9
elsif ($cmd =~ /\bExpectedFail\b/i) { } 0 8 8
elsif ($cmd =~ /\bexpF\b/i) { } 0 8 8
elsif ($cmd =~ /\bbugF\b/i) { } 0 8 8
elsif ($cmd =~ /\bFail\b/i) { } 3 5 8
elsif ($cmd =~ /\bcustomTC\b/i) { } 0 5 5
2780 9 &createFile( $tcName.'/'.$tc_pl, "\$| = 1; print \"1234567.89\\n\"; sleep $sleep; ");
2781 } elsif ($cmd =~ /\bExpectedFail\b/i) { # ExpectedFailedTC
2782 9 &createFile( $tcName.'/'.$tc_pl, "\$| = 1; print \"Expected_f_a_i_l\\n\"; sleep $sleep; ");
2783 } elsif ($cmd =~ /\bexpF\b/i) { # ExpF for ExpectedFailedTC
2784 1 &createFile( $tcName.'/'.$tc_pl, "\$| = 1; print \"expF\\n\"; sleep $sleep; ");
2785 } elsif ($cmd =~ /\bbugF\b/i) { # ExpF for ExpectedFailedTC
2786 0 &createFile( $tcName.'/'.$tc_pl, "\$| = 1; print \"bugF\\n\"; sleep $sleep; ");
2787 } elsif ($cmd =~ /\bFail\b/i) { # FailedTC
2788 0 &createFile( $tcName.'/'.$tc_pl, "\$| = 1; print \"fail\\n\"; sleep $sleep; ");
2789 } elsif ($cmd =~ /\bcustomTC\b/i) { # CustomTC
2790 0 ▶ $cmd=~ /customTC:\s*(.+)\s*:customTC/; $cmd =$1; if (defined $cmd) {;} else { $cmd="";} $cmd =~ s/_space_/ /;
Branch: 1 branch
BranchTrueFalseTotal
if (defined $cmd) { } 0 0 0
2791 0 ▶ if ($cmd =~ /ps1\b/) { # Powershell plugin
Branch: 8 branches
BranchTrueFalseTotal
if ($cmd =~ /ps1\b/) { } 0 0 0
elsif ($cmd =~ /pyanvil/i and $tc_pl =~ /index_pyAnvil\.pl/i) { } 0 0 0
elsif ($cmd =~ /\S+\.pl\b/) { } 0 0 0
elsif ($cmd =~ /taftestcase1/) { } 0 0 0
elsif ($cmd =~ /taftestcase2/) { } 0 0 0
elsif ($cmd =~ /taftestcase3/) { } 0 0 0
elsif ($cmd =~ /taftestcase4/) { } 0 0 0
elsif ($cmd =~ /powershellTC/) { } 0 0 0
2792 ###########
2793 0 &createFile( $tcName.'/'.$tc_pl,
2794 "#!$perl_
2795 use File::Copy;\n\$| = 1;
2796 if (-e \"".&getDir($cmd)."\/_tcLogAppend.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend.txt\" , \"".&getDir($cmd)."\/_tcLogAppend.bak\");}
2797 if (-e \"".&getDir($cmd)."\/_tcLogAppend_.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend_.txt\", \"".&getDir($cmd)."\/_tcLogAppend_.bak\");}
2798 if (-e \"".&getDir($cmd)."\/_tcLogAppend__.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend__.txt\", \"".&getDir($cmd)."\/_tcLogAppend__.bak\");}
2799 print `powershell -executionpolicy unrestricted -file $cmd $ps1_args`; # custom TC tc.pl
2800 if (-e \"".&getDir($cmd)."\/_tcLogAppend.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend.txt\" , \"$tcName\/_tcLogAppend.txt\");}
2801 if (-e \"".&getDir($cmd)."\/_tcLogAppend_.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend_.txt\", \"$tcName\/_tcLogAppend_.txt\");}
2802 if (-e \"$externalLogName\") {copy(\"$externalLogName\", \"$tcName\/_tcLogAppend__.txt\");}
2803 "
2804 );
2805 ###########
2806 ▶ } elsif (($cmd =~ /pyanvil/i) &&( $tc_pl =~ /index_pyAnvil\.pl/i)) { # pyAnvil plugin
Condition0%0/3
$cmd =~ /pyanvil/i and $tc_pl =~ /index_pyAnvil\.pl/i
!ll&&!rl&&r
000
MC/DC0%0/2
$cmd =~ /pyanvil/i and $tc_pl =~ /index_pyAnvil\.pl/i
$cmd =~ /pyanvil/i $tc_pl =~ /index_pyAnvil\.pl/i
Truth table0%0/3
A and B
A= $cmd =~ /pyanvil/iB= $tc_pl =~ /index_pyAnvil\.pl/i
ABresult
0X0
100
111
2807 ###########
2808 0 &createFile( $tcName.'/'.$tc_pl,
2809 "#!$perl_
2810 use File::Copy;\n\$| = 1;
2811 if (-e \"".&getDir($cmd)."\/_tcLogAppend.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend.txt\" , \"".&getDir($cmd)."\/_tcLogAppend.bak\");}
2812 if (-e \"".&getDir($cmd)."\/_tcLogAppend_.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend_.txt\", \"".&getDir($cmd)."\/_tcLogAppend_.bak\");}
2813 if (-e \"".&getDir($cmd)."\/_tcLogAppend__.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend__.txt\", \"".&getDir($cmd)."\/_tcLogAppend__.bak\");}
2814 print `$perl_ $cmd $ps1_args`; # tc.pl
2815 if (-e \"".&getDir($cmd)."\/_tcLogAppend.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend.txt\" , \"$tcName\/_tcLogAppend.txt\");}
2816 if (-e \"".&getDir($cmd)."\/_tcLogAppend_.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend_.txt\", \"$tcName\/_tcLogAppend_.txt\");}
2817 if (-e \"$externalLogName\") {copy(\"$externalLogName\", \"$tcName\/_tcLogAppend__.txt\");}
2818 #if (-e \"".&getDir($cmd)."\/_tcLogAppend__.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend__.txt\", \"$tcName\/_tcLogAppend__.txt\");}
2819 "
2820 );
2821 ###########
2822 #} elsif ($cmd =~ /\S+\.pl\s*/) { # perl plugin
2823 } elsif ($cmd =~ /\S+\.pl\b/) { # perl plugin
2824 ###########
2825 0 &createFile( $tcName.'/'.$tc_pl,
2826 "#!$perl_
2827 use File::Copy;\n\$| = 1;
2828 if (-e \"".&getDir($cmd)."\/_tcLogAppend.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend.txt\" , \"".&getDir($cmd)."\/_tcLogAppend.bak\");}
2829 if (-e \"".&getDir($cmd)."\/_tcLogAppend_.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend_.txt\", \"".&getDir($cmd)."\/_tcLogAppend_.bak\");}
2830 if (-e \"".&getDir($cmd)."\/_tcLogAppend__.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend__.txt\", \"".&getDir($cmd)."\/_tcLogAppend__.bak\");}
2831 print `$perl_ $cmd`; # $c/$_TAF/index.pl
2832 if (-e \"".&getDir($cmd)."\/_tcLogAppend.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend.txt\" , \"$tcName\/_tcLogAppend.txt\");}
2833 if (-e \"".&getDir($cmd)."\/_tcLogAppend_.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend_.txt\", \"$tcName\/_tcLogAppend_.txt\");}
2834 if (-e \"$externalLogName\") {copy(\"$externalLogName\", \"$tcName\/_tcLogAppend__.txt\");}
2835 #if (-e \"".&getDir($cmd)."\/_tcLogAppend__.txt\" ) {move(\"".&getDir($cmd)."\/_tcLogAppend__.txt\", \"$tcName\/_tcLogAppend__.txt\");}
2836 "
2837 );
2838 ###########
2839 } elsif ( $cmd =~ /taftestcase1/) {
2840 ###########
2841 0 &createFile( $tcName.'/'.$tc_pl,
2842 "#!$perl_
2843 \$| = 1;
2844 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property1_as_propertyValue1_doit_`;
2845 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=get_property1`;
2846 if ( \$rst =~ /propertyValue1/) { print \"pass\\n\";} else {print \"fail\\n\";}
2847 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property1_as_propertyValue0_doit_`;
2848 "
2849 );
2850 ###########
2851 ;
2852 } elsif ( $cmd =~ /taftestcase2/) {
2853 ###########
2854 0 &createFile( $tcName.'/'.$tc_pl,
2855 "#!$perl_
2856 \$| = 1;
2857 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property1_as_propertyValue1A_doit_`;
2858 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=get_property1`;
2859 if ( \$rst =~ /propertyValue1A/) { print \"pass\\n\";} else {print \"fail\\n\";}
2860 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property1_as_propertyValue0_doit_`;
2861 "
2862 );
2863 ###########
2864 ;
2865 } elsif ( $cmd =~ /taftestcase3/) {
2866 ###########
2867 0 &createFile( $tcName.'/'.$tc_pl,
2868 "#!$perl_
2869 \$| = 1;
2870 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOP=set_property2_as_propertyValue2_doit_`;
2871 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=get_property2`;
2872 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOP=get_property2`;
2873 if (( \$rst =~ /testcase1/) && (\$rst =~ /testcase2/) && (\$rst =~ /property2\\s*=\\s*propertyValue2/)) { print \"pass\\n\";} else {print \"fail\\n\";}
2874 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property1_as_propertyValue0_doit_`;
2875 "
2876 );
2877 ###########
2878 ;
2879 } elsif ( $cmd =~ /taftestcase4/) {
2880 ###########
2881 0 &createFile( $tcName.'/'.$tc_pl,
2882 "#!$perl_
2883 \$| = 1;
2884  
2885 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOP=set_property2_as_propertyValue1_doit_`;
2886 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOP=set_property2_as_propertyValue2_doit_`;
2887 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOP=set_property2_as_propertyValue2A_doit_`;
2888 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOP=set_property1_as_propertyValue1A_doit_`;
2889 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}printTcFilters`;
2890 if (( \$rst =~ /property1\\s+propertyValue1A/) && (\$rst =~ /property2\\s+propertyValue2A/)) { print \"pass\\n\";} else {print \"fail\\n\";}
2891  
2892 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property1_as_propertyValue0_doit_`;
2893 \$rst = `$perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=_testcase2_${deli}propertyOP=set_property2_as_propertyValue0_doit_`;
2894 "
2895 );
2896 ###########
2897 ;
2898 } elsif ( $cmd =~ /powershellTC/) {
2899 ###########
2900 0 &createFile( $tcName.'/'.$tc_pl,
2901 "
2902 "
2903 );
2904 ###########
2905 ;
2906 } else {
2907 ;
2908 }
2909 } else {
2910 0 &createFile( $tcName.'/'.$tc_pl, "\$| = 1; print \"pass\\n\"; sleep $sleep; ");
2911 }
2912 0 &createPropertyTemplate($tcName);
2913  
2914 5 my $tmp =<<EOF;
2915 open Fout, '>$tcName/_tcLogAppend.txt';
2916 #!/usr/bin/perl
2917 print Fout "* This is the content of TC log file\\n";
2918 print Fout "* TC Log can has URL (file:///) pointed to <a href=\\"file:////$c/$_TAF/_blabla.html\\" >File Archieve</a> _url_line_ \\n";
2919 print Fout "* TC Log can has URL (file:///) pointed to <a href=\\"file:////$c/$_TAF/_testsuite2_/testcase0002/_tcLog.html\\" >Another TC's Log _url_line_ </a>\\n";
2920 print Fout "* TC Log can has URL (file:///) pointed to <a href=\\"file:////$c/$_TAF/index.htm\\" >TAF</a> _url_line_ \\n";
2921 print Fout "* TC Log can has URL (http:///) pointed to <a href=\\"$urlHttp/_blabla.html\\" >File Archieve</a> _url_line_ \\n";
2922 print Fout "* TC Log can has URL (http:///) pointed to <a href=\\"$urlHttp/_testsuite2_/testcase0002/_tcLog.html\\" >Another TC's Log _url_line_ </a>\\n";
2923 print Fout "* TC Log can has URL (http:///) pointed to <a href=\\"$urlHttp/index.htm\\" >TAF</a> _url_line_ \\n";
2924 print Fout "* TC Log can has special characters like Dollor \\\$, Percentage \\\% AT \\\@ \\n";
2925 print Fout "* TC Log can display (add _url_line_ in the line) URL http://localhost$http_port _ url_line_line _url_line_ (_url_line_ indicates a real url. Not translation will be done.)\\n";
2926 print Fout "* TC Log can parse log (*.txt) in log $c/$_TAF/_testLog.txt and add its Http and File links.\\n";
2927 print Fout "* TC Log can parse log (*.txt) in log $c/$_TAF/_testLog.htm and add its Http and File links.\\n";
2928 close Fout;
2929 exit;
2930 EOF
2931 9 ▶ if (($cmd =~ /genLog/i) || ($cmd =~ /addLog/i)) {&appendtoFile( $tcName.'/'.$tc_pl, $tmp) ; undef $tmp; }
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /genLog/i or $cmd =~ /addLog/i) 1 8 9
Condition66%2/3
$cmd =~ /genLog/i or $cmd =~ /addLog/i
l!l&&r!l&&!r
108
MC/DC50%1/2
$cmd =~ /genLog/i or $cmd =~ /addLog/i
$cmd =~ /genLog/i $cmd =~ /addLog/i
Truth table66%2/3
A or B
A= $cmd =~ /genLog/iB= $cmd =~ /addLog/i
ABresult
1X1
011
000
2932 1 $tcName =~ s/\\\\/\\/g; # todo \\
2933  
2934 1 return "is created";
2935 }
2936 }
2937  
2938  
2939 sub execTC {
2940 0 ▶ my $tcName = &getTCName(@_); my $timeStart = &getDate(); my $rst='' ;
Subroutine execTC: not called CC=6 SCAR=36.0
Pod undocumented
2941 0 ▶ if ( -e "$tcName/tc.pl" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcName/tc.pl") { } 0 0 0
2942 0 my $cmd = "$tcName/tc.pl"; $rst = `$cmd`; my $timeEnd= &getDate() ;
2943 0 $rst =~ /(pass|fail|bugF|expF|todo|[\d|.]+)$/i; $rst = $1;
2944 0 ▶ if ($rst) {;} else {$rst = "null";}
Branch: 1 branch
BranchTrueFalseTotal
if ($rst) { } 0 0 0
2945 0 ▶ if (($rst =~ /Expected_f_a_i_l/i) || ($rst =~ /null/i)) { sleep 10; }
Branch: 1 branch
BranchTrueFalseTotal
if ($rst =~ /Expected_f_a_i_l/i or $rst =~ /null/i) 0 0 0
Condition0%0/3
$rst =~ /Expected_f_a_i_l/i or $rst =~ /null/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$rst =~ /Expected_f_a_i_l/i or $rst =~ /null/i
$rst =~ /Expected_f_a_i_l/i $rst =~ /null/i
Truth table0%0/3
A or B
A= $rst =~ /Expected_f_a_i_l/iB= $rst =~ /null/i
ABresult
1X1
011
000
2946 0 $rst =~ s/^\s*0+//g;
2947 0 my $rstStr = sprintf "%20s|%10s|%s", "tcRunResult",$rst , $timeStart ;
2948 0 $rstStr .= "|"; $rstStr .= "$timeEnd"; $rstStr .= "|"; $rstStr .= "0:0:0:0s"; $rstStr .= "|";
2949 0 ▶ if ( $rst =~ /^\s*[\d+|\.]+\s*$/ ) { $rstStr .= "Performance Test ($rst) "; }
Branch: 1 branch
BranchTrueFalseTotal
if ($rst =~ /^\s*[\d+|\.]+\s*$/) { } 0 0 0
2950 0 else { $rstStr .= "Functional Test ($rst) "; }
2951 0 $rstStr .= '|comment2';
2952 0 &addProperty(&getTCName($tcName), "add=$rstStr");
2953 0 return $rst;
2954 } else {
2955 0 return "tcName: $tcName doesn't exist.\n";
2956 }
2957 }
2958  
2959 sub dumyTC_ { # create a dumy tc result
2960 0 ▶ my $tcName = &getTCName(@_);
Subroutine dumyTC_: not called CC=3 SCAR=24.8
Pod undocumented
2961 0 my $timeStart = &getDate(); my $rst='';
2962 0 ▶ if ( -e "$tcName/$tc_pl" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcName/$tc_pl") { } 0 0 0
2963 0 my $cmd = "$tcName/$tc_pl"; $rst = "dump";
2964 0 my $timeEnd= &getDate();
2965 0 $rst = "dumy";
2966 0 ▶ if ($rst) {;} else {$rst = "null";}
Branch: 1 branch
BranchTrueFalseTotal
if ($rst) { } 0 0 0
2967 0 my $rstStr = sprintf "%20s|%10s|%s", "tcRunResult",$rst , $timeStart;
2968 0 $rstStr .= "|"; $rstStr .= "$timeEnd"; $rstStr .= "|"; $rstStr .= "0:0:0:0s";
2969 0 $rstStr .= "|";
2970 0 $rstStr .= "Functional Test ($rst) ";
2971 0 $rstStr .= '|'.$tcComment2;
2972 0 &addProperty(&getTCName($tcName), "add=$rstStr");
2973 0 return $rst;
2974 } else {
2975 0 return "tcName: $tcName doesn't exist.\n";
2976 }
2977 }
2978  
2979  
2980 sub markTC_ {
2981 0 ▶ my $tcName = &getTCName(@_);
Subroutine markTC_: not called CC=4 SCAR=30.0
Pod undocumented
2982 0 my $timeStart = &getDate(); my $rst='';
2983 0 ▶ if ( -e "$tcName/$tc_pl" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcName/$tc_pl") { } 0 0 0
2984 0 my $cmd = "$tcName/$tc_pl"; $rst = "mark"; # $rst = `$cmd`;
2985 0 my $timeEnd= &getDate();
2986 0 $rst =~ /(mark|pass|fail|bugF|expF|todo|[\d|.]+)$/i; $rst = $1;
2987 0 ▶ if ($rst) {;} else {$rst = "null";}
Branch: 1 branch
BranchTrueFalseTotal
if ($rst) { } 0 0 0
2988 0 $rst =~ s/^\s*0+//g;
2989 0 my $rstStr = sprintf "%20s|%10s|%s", "tcRunResult",$rst , $timeStart;
2990 0 $rstStr .= "|"; $rstStr .= "$timeEnd"; $rstStr .= "|"; $rstStr .= "0:0:0:0s";
2991 0 $rstStr .= "|";
2992 0 ▶ if ( $rst =~ /^\s*[\d+|\.]+\s*$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rst =~ /^\s*[\d+|\.]+\s*$/) { } 0 0 0
2993 0 $rstStr .= "Performance Test ($rst) ";
2994 } else {
2995 0 $rstStr .= "Functional Test ($rst) ";
2996 }
2997 0 $rstStr .= '|'.$tcComment2;
2998 0 &addProperty(&getTCName($tcName), "add=$rstStr");
2999 0 return $rst;
3000 } else {
3001 0 return "tcName: $tcName doesn't exist.\n";
3002 }
3003 }
3004  
3005  
3006 sub execTC_ {
3007 0 ▶ my $tcName = &getTCName(@_);
Subroutine execTC_: called CC=6 SCAR=18.7
Pod undocumented
3008 0 my $timeStart = &getDate(); my $rst='';
3009 6 ▶ if ( -e "$tcName/$tc_pl" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcName/$tc_pl") { } 6 0 6
3010 6 my $cmd = "$perl_ $tcName/$tc_pl";
3011 6 $rst = `$cmd`; my $timeEnd= &getDate();
3012 6 $rst =~ /(pass|fail|todo|bugF|expF|expected_f_a_i_l|task|[\d|.]+)$/i; $rst = $1;
3013 6 ▶ if ($rst) { if ($rst =~ /expected_f_a_i_l/) { $rst = "expF"; } ;} else {$rst = "null";}
Branch: 2 branches
BranchTrueFalseTotal
if ($rst) { } 6 0 6
if ($rst =~ /expected_f_a_i_l/) 0 6 6
3014 0 $rst =~ s/^\s*0+//g;
3015 0 my $rstStr = sprintf "%20s|%10s|%s", "tcRunResult",$rst , $timeStart; $rstStr .= "|"; $rstStr .= "$timeEnd"; $rstStr .= "|"; $rstStr .= "0:0:0:0s"; $rstStr .= "|";
3016 6 ▶ if ( $rst =~ /^\s*[\d+|\.]+\s*$/ ) { $rstStr .= "Performance Test ($rst) "; } elsif ( $rst =~ /task/i ) { $rstStr .= "Task "; } else { $rstStr .= "Functional Test ($rst) "; }
Branch: 2 branches
BranchTrueFalseTotal
if ($rst =~ /^\s*[\d+|\.]+\s*$/) { } 1 5 6
elsif ($rst =~ /task/i) { } 0 5 5
3017 0 $rstStr .= '|comment2PlaceHolder';
3018 5 &addProperty(&getTCName($tcName), "add=$rstStr");
3019 6 return $rst;
3020 } else {
3021 6 return "tcName: $tcName doesn't exist.\n";
3022 }
3023 }
3024  
3025 sub mapTC {
3026 6 ▶ my $tcName = &getTCName(@_);
Subroutine mapTC: called CC=3 SCAR=13.1
Pod undocumented
3027 0 my $timeStart = &getDate(); my $rst='';
3028 6 ▶ if ( -e "$tcName/$tc_pl" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcName/$tc_pl") { } 6 0 6
3029 6 ▶ if (-e "$c/$_TAF/$SvrProjName/_tcMap.txt") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/$SvrProjName/_tcMap.txt") 0 6 6
3030 6 my $tcName_ = &getTCName($tcName); $tcName_ =~ s/$c\/$_TAF\///i;
3031 0 &mergethProperty($tcName_,"$c/$_TAF/$SvrProjName/_tcMap.txt");
3032 }
3033 0 return $rst;
3034 } else {
3035 0 return "tcName: $tcName doesn't exist.\n";
3036 }
3037 }
3038  
3039 sub mergethProperty {
3040 0 ▶my $thPropertyString ="_CRB_/AppBuildpath/_automated_testsuites_/_testsuite_pl/testcase0002"; $thPropertyString= shift if @_;
Subroutine mergethProperty: not called CC=20 SCAR=60.1
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3041 0 ▶my $tcMapFName = "_tcMap.txt"; $tcMapFName = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3042 0 my $propertyName = "tcRunResult";my %records; my %record_out; my $tag = "tag"; my $content_out=""; my $parent=""; my $child;
3043 0 open Fin, $tcMapFName;
3044 0 ▶ while ($_=<Fin>) { chop;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
3045 0 ▶ if ($_ =~ /$thPropertyString/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$thPropertyString/) 0 0 0
3046 0 my $thPropertyFName;
3047 0 $content_out = "";
3048 0 ($parent, $child) = split (/\s*=>\s*/, $_);
3049 0 ▶ if (($parent !~ /^\s*$/) && ($child !~ /^\s*$/)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($parent =~ /^\s*$/ or $child =~ /^\s*$/) 0 0 0
Condition0%0/3
$parent =~ /^\s*$/ or $child =~ /^\s*$/
l!l&&r!l&&!r
000
MC/DC0%0/2
$parent =~ /^\s*$/ or $child =~ /^\s*$/
$parent =~ /^\s*$/ $child =~ /^\s*$/
Truth table0%0/3
A or B
A= $parent =~ /^\s*$/B= $child =~ /^\s*$/
ABresult
1X1
011
000
3050 0 ▶ $thPropertyFName=$parent."/thProperty.txt"; if ($thPropertyFName !~ /$c\/$_TAF/) {$thPropertyFName =~ s/$c/$c\/$_TAF/;} # TS->TAF TS conversion
Branch: 1 branch
BranchTrueFalseTotal
unless ($thPropertyFName =~ m[$c/$_TAF]) 0 0 0
3051 0 ▶ open Fin1, $thPropertyFName or die "Can't open $thPropertyFName:$!";
Branch: 1 branch
BranchTrueFalseTotal
open Fin1, $thPropertyFName or die "Can't open ${thPropertyFName}:$!" 0 0 0
3052 0 ▶ while ($_ = <Fin1>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin1)) 0 0 0
3053 0 ▶ if ($_ =~ /$tags/) { $tag=$1;} # todo
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tags/) 0 0 0
3054 0 ▶ if ($_ =~ /^\s*$propertyName\s*\|/) { @_ = split (/\|/, $_); $records{$_[2]}=$_; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^\s*$propertyName\s*\|/) { } 0 0 0
3055 0 else { $content_out = $content_out.$_; }
3056 }
3057 0 close Fin1;
3058 0 ▶ $thPropertyFName=$child."/thProperty.txt"; if ($thPropertyFName !~ /$c\/$_TAF/){ $thPropertyFName =~ s/$c/$c\/$_TAF/;} # TS->TAF TS conversion
Branch: 1 branch
BranchTrueFalseTotal
unless ($thPropertyFName =~ m[$c/$_TAF]) 0 0 0
3059 0 ▶ if ( -e $thPropertyFName ) { ; } else { return ;}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $thPropertyFName) { } 0 0 0
3060 0 ▶ open Fin1, "$thPropertyFName" or die "Can't open $thPropertyFName:$!";
Branch: 1 branch
BranchTrueFalseTotal
open Fin1, "$thPropertyFName" or die "Can't open ${thPropertyFName}:$!" 0 0 0
3061 0 ▶ while ($_ = <Fin1>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin1)) 0 0 0
3062 0 ▶ if ($_ =~ /$tags/i) { $tag=$1;} # todo
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tags/i) 0 0 0
3063 0 ▶ if ($_ =~ /^\s*$propertyName\s*\|/) { $_ =~ s/Comment2\s*$/$tag/i; @_ = split (/\|/, $_); $records{$_[2]}=$_;
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /^\s*$propertyName\s*\|/) 0 0 0
3064 }
3065 }
3066 0 close Fin1;
3067 }
3068 }
3069 }
3070 0 close Fin;
3071 0 ▶ if (-e $parent) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $parent) 0 0 0
3072 0 open Fout1, ">$parent/thProperty.txt_";
3073 0 print Fout1 $content_out;
3074 0 foreach my $each (sort keys %records) {print Fout1 "$records{$each}\n"; }
3075 0 close Fout1;
3076 0 &copyFile("$parent/thProperty.txt_", "$parent/thProperty.txt");
3077 }
3078  
3079 }
3080 sub deleteTC {
3081 0 ▶ if ($_[1]) { $SvrProjName = $_[1];}
Subroutine deleteTC: called CC=3 SCAR=15.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1]) 0 12 12
3082 0 ▶ if ($_[2]) { $SvrDrive = $_[2];}
Branch: 1 branch
BranchTrueFalseTotal
if ($_[2]) 0 12 12
3083 12 my $tcName = &getTCName(@_);
3084 #### todo backup deleted TCs. move ($tcName, $tcName."_". &UnixDate( "now", "%m_%d_%Y_%H_%M_%S_%Z" ) ."_backup");
3085 0 rmtree $tcName;
3086 12 return "$tcName is deleted (saved as *_backup)";
3087 }
3088  
3089 sub detectTC {
3090 12 ▶ if ($_[1]) { $SvrProjName = $_[1];}
Subroutine detectTC: called CC=4 SCAR=13.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1]) 16 9 25
3091 25 ▶ if ($_[2]) { $SvrDrive = $_[2];}
Branch: 1 branch
BranchTrueFalseTotal
if ($_[2]) 16 9 25
3092 25 my $tcName = '';
3093 16 $tcName = &getTCName(@_);
3094 25 ▶ if (-e "$tcName/tc.pl" ) { return "exists"; } else { return 'does not exist';}
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcName/tc.pl") { } 9 16 25
3095 }
3096  
3097 sub getTSName {
3098 9 ▶ my $tsname = shift;
Subroutine getTSName: not called CC=1 SCAR=0.4
Pod undocumented
3099 16 $tsname =~ s/\/testcase\d+.+//g;
3100 0 return $tsname;
3101 }
3102  
3103 sub getTCName {
3104 0 ▶ my $SvrProjNameTmp; my $SvrDriveTmp; my $SvrTCNameTmp="" ;
Subroutine getTCName: called CC=8 SCAR=23.6
Pod undocumented
3105 136 ▶ $SvrTCNameTmp = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 136 0 136
3106 136 ▶ if ($notUsegetTCName==1) { return $SvrTCName; } # Do nothing
Branch: 1 branch
BranchTrueFalseTotal
if ($notUsegetTCName == 1) 0 136 136
3107 0 ▶ if ($SvrTCNameTmp) {;} else { $SvrTCNameTmp = $SvrTCName; } # get current SvrTCName
Branch: 1 branch
BranchTrueFalseTotal
if ($SvrTCNameTmp) { } 136 0 136
3108 0 ▶ if ($SvrProjNameTmp) {;} else { $SvrProjNameTmp = $SvrProjName; } # do nothing
Branch: 1 branch
BranchTrueFalseTotal
if ($SvrProjNameTmp) { } 0 136 136
3109 136 ▶ if ($SvrDriveTmp) {;} else { $SvrDriveTmp = $SvrDrive; } # do nothing
Branch: 1 branch
BranchTrueFalseTotal
if ($SvrDriveTmp) { } 0 136 136
3110 136 ▶ if ($SvrTCNameTmp =~ /[a-z]:/i) { return $SvrTCNameTmp; } # remove c:
Branch: 2 branches
BranchTrueFalseTotal
if ($SvrTCNameTmp =~ /[a-z]:/i) { } 66 70 136
elsif ($SvrTCNameTmp =~ /$c/i) { } 0 70 70
3111 136 elsif ($SvrTCNameTmp =~ /$c/i) { return $SvrTCNameTmp; } # remove c:
3112 66 else { return ($SvrDriveTmp.'/'.$SvrProjNameTmp.'/'.$SvrTCNameTmp) ; } # c:/testcase/testsuite
3113 }
3114  
3115 sub getTCNameStr{
3116 0 ▶ my $SvrTCNameStr = shift;
Subroutine getTCNameStr: not called CC=1 SCAR=2.6
Pod undocumented
3117 70 @_ = split /\\|\//, $SvrTCNameStr;
3118 0 pop;
3119 }
3120  
3121 ################################################################################
3122 # Subroutine Name : processProperty
3123 # Function: wrapper for property management functions
3124 # Input Parameters: PropertyOP
3125 # Output/Returns : tcName and propertyOp
3126 ################################################################################
3127 sub processProperty {
3128 0 ▶ shift; my $tcname = shift; my $propertyOP = shift; my $rst=""; my $prMsg=0;
Subroutine processProperty: called CC=30 SCAR=51.8
Pod undocumented
3129 #### PropertyOp String Translation
3130 24 $propertyOP =~ s/^\s*propertyOp\s*=//g; $propertyOP =~ s/^\s*po\s*=//g; $propertyOP =~ s/_doit_//g;
3131 24 ▶ if ($propertyOP =~ /^\s*_?modify_(.+)_(as|eq)_(.+)/) { $propertyOP = "add_eq_$1_column_$3"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOP =~ /^\s*_?modify_(.+)_(as|eq)_(.+)/) 0 24 24
3132 0 ▶ if ($propertyOP =~ /^\s*_?set_(.+)_(as|eq)_(.+)/) { $propertyOP = "add_eq_$1_column_$3"; }
Branch: 9 branches
BranchTrueFalseTotal
if ($propertyOP =~ /^\s*_?set_(.+)_(as|eq)_(.+)/) { } 10 14 24
elsif ($propertyOP =~ /^\s*_?get_history(.+)/) { } 0 14 14
elsif ($propertyOP =~ /^\s*_?list_history(.+)/) { } 0 14 14
elsif ($propertyOP =~ /^\s*_?get_latest(.+)/) { } 0 14 14
elsif ($propertyOP =~ /^\s*_?list_latest(.+)/) { } 0 14 14
elsif ($propertyOP =~ /^\s*_?get_last(.+)/) { } 0 14 14
elsif ($propertyOP =~ /^\s*_?list_last(.+)/) { } 0 14 14
elsif ($propertyOP =~ /^\s*_?get_(.+)/) { } 14 0 14
elsif ($propertyOP =~ /^\s*_?list_(.+)/) { } 0 0 0
3133 24 elsif ($propertyOP =~ /^\s*_?get_history(.+)/) { $propertyOP = "get_history$1"; }
3134 10 elsif ($propertyOP =~ /^\s*_?list_history(.+)/) { $propertyOP = "get_history$1"; }
3135  
3136 0 elsif ($propertyOP =~ /^\s*_?get_latest(.+)/) { $propertyOP = "get_latest$1"; }
3137 0 elsif ($propertyOP =~ /^\s*_?list_latest(.+)/) { $propertyOP = "get_latest$1"; }
3138  
3139 0 elsif ($propertyOP =~ /^\s*_?get_last(.+)/) { $propertyOP = "get_last$1"; }
3140 0 elsif ($propertyOP =~ /^\s*_?list_last(.+)/) { $propertyOP = "get_last$1"; }
3141  
3142 0 elsif ($propertyOP =~ /^\s*_?get_(.+)/) { $propertyOP = "get_$1"; }
3143 0 elsif ($propertyOP =~ /^\s*_?list_(.+)/) { $propertyOP = "get_$1"; }
3144 #### PropertyOp String Translation
3145 0 ▶ if (defined $propertyOP) {;} else { $rst = "Warning: wrong format. Correct format is -add=prop:value"; return $rst; }
Branch: 1 branch
BranchTrueFalseTotal
if (defined $propertyOP) { } 24 0 24
3146 0 ▶ if ($propertyOP =~ /;\s*pr2Screen\s*/) { $prMsg = 1; $propertyOP =~ s/;\s*pr2Screen\s*(=\s*\d*\s*)?//; }
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOP =~ /;\s*pr2Screen\s*/) 0 24 24
3147 0 ▶ if ( $propertyOP =~ /^\s*add/i ) {
Branch: 10 branches
BranchTrueFalseTotal
if ($propertyOP =~ /^\s*add/i) { } 10 14 24
elsif ($propertyOP =~ /^\s*del/i) { } 0 14 14
elsif ($propertyOP =~ /^\s*reset/i) { } 0 14 14
elsif ($propertyOP =~ /^\s*modify/i) { } 0 14 14
elsif ($propertyOP =~ /^\s*get_history|list_history_/i) { } 0 14 14
elsif ($propertyOP =~ /^\s*get_latest|list_latest/i) { } 0 14 14
elsif ($propertyOP =~ /^\s*get_last|list_last/i) { } 0 14 14
elsif ($propertyOP =~ /^\s*get|list/i) { } 14 0 14
elsif ($propertyOP =~ /^\s*create/i) { } 0 0 0
elsif ($propertyOP =~ /^\s*match|filter/i) { } 0 0 0
3148 0 $rst = &addProperty( &getTCName($tcname), $propertyOP );
3149 }
3150 elsif ( $propertyOP =~ /^\s*del/i ) {
3151 24 $rst = &deleteProperty( &getTCName($tcname), $propertyOP );
3152 }
3153 elsif ( $propertyOP =~ /^\s*reset/i ) {
3154 ;
3155 } # copy to a backup and create a property file
3156 elsif ( $propertyOP =~ /^\s*modify/i ) {
3157 10 $rst = &modifyProperty( &getTCName($tcname), $propertyOP );
3158 }
3159 elsif ( $propertyOP =~ /^\s*get_history|list_history_/i ) {
3160 0 $propertyOP =~ s/^\s*get_history_+\s*//g; $propertyOP =~ s/^\s*list_history_+\s*//g;
3161 0 $rst = &getProperties(&getTCName($tcname), $propertyOP, "history" );
3162 }
3163 elsif ( $propertyOP =~ /^\s*get_latest|list_latest/i ) {
3164 0 $propertyOP =~ s/^\s*get_latest_+\s*//g; $propertyOP =~ s/^\s*list_latest_+\s*//g;
3165 0 $rst = &getProperties(&getTCName($tcname), $propertyOP, "latest" );
3166 }
3167 elsif ( $propertyOP =~ /^\s*get_last|list_last/i ) {
3168 0 $propertyOP =~ s/^\s*get_last_+\s*//g; $propertyOP =~ s/^\s*list_last_+\s*//g;
3169 0 $rst = &getProperties(&getTCName($tcname), $propertyOP, "last" );
3170 }
3171 elsif ( $propertyOP =~ /^\s*get|list/i ) {
3172 0 $propertyOP =~ s/^\s*get_\s*//g; $propertyOP =~ s/^\s*list_\s*//g;
3173 14 ▶ if ($propertyOP =~ /;/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOP =~ /;/) { } 13 1 14
3174 14 @_ = split /;/, $propertyOP ;
3175 14 $rst = &getProperties(&getTCName($tcname), $_[0], $_[1]);
3176 } else {
3177 13 $rst = &getProperties(&getTCName($tcname), $propertyOP, "value" );
3178 }
3179 }
3180 elsif ( $propertyOP =~ /^\s*create/i ) {
3181 13 $rst = &createPropertyTemplate($tcname);
3182 }
3183 elsif ( $propertyOP =~ /^\s*match|filter/i ) {
3184 1 ▶ if ($propertyOP =~ s/^\s*match\s*_//g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOP =~ s/^\s*match\s*_//g) 0 0 0
3185 0 $propertyOP =~ /\s*(\S+)\s*_(as|eq)_\s*(\S+)\s*/;
3186 0 $rst = &matchProperty($1, $3, $tcname);
3187 }
3188 } else {
3189 0 $rst = sprintf "ProcessProperty (no match OP) %40s %20s", $tcname, $propertyOP;
3190 }
3191  
3192 0 ▶ if (($rst) && ($rst =~ /^\s*$/)) { $rst = "_noMatchedPropertyOP_";}
Branch: 1 branch
BranchTrueFalseTotal
if ($rst and $rst =~ /^\s*$/) 0 24 24
Condition33%1/3
$rst and $rst =~ /^\s*$/
!ll&&!rl&&r
0240
MC/DC0%0/2
$rst and $rst =~ /^\s*$/
$rst $rst =~ /^\s*$/
Truth table33%1/3
A and B
A= $rstB= $rst =~ /^\s*$/
ABresult
0X0
100
111
3193 0 ▶ if ((defined $prMsg) && ($prMsg ==1)) { print $rst;}
Branch: 1 branch
BranchTrueFalseTotal
if (defined $prMsg and $prMsg == 1) 0 24 24
Condition33%1/3
defined $prMsg and $prMsg == 1
!ll&&!rl&&r
0240
MC/DC0%0/2
defined $prMsg and $prMsg == 1
defined $prMsg $prMsg == 1
Truth table33%1/3
A and B
A= defined $prMsgB= $prMsg == 1
ABresult
0X0
100
111
3194 0 ▶ if ($rst) { return $rst; } else { return "doen't exist"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($rst) { } 24 0 24
3195 }
3196  
3197 ################################################################################
3198 # Subroutine Name : matchProperties
3199 # Function: return true/false
3200 # Input Parameters: Property Name in regExp
3201 # Output/Returns : True/False
3202 ################################################################################
3203 sub matchProperty { # &matchProperty("QAOwner","ywang", "TC_tc1");
3204 0 ▶ my $propertyName = ".*"; my $propertyPattern = ".*"; my %array; my $tcname = "TC_tc1";
Subroutine matchProperty: not called CC=9 SCAR=44.1
Pod undocumented
3205 0 ▶ $propertyName = shift if (@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3206 0 ▶ $propertyPattern= shift if (@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3207 0 ▶ $tcname = shift if (@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3208  
3209 0 ▶ if (&getProperties(&getTCName($tcname), "" ) =~ /info:There is no/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (&getProperties(&getTCName($tcname), "") =~ /info:There is no/) 0 0 0
3210 0 return "False";
3211 }
3212  
3213 0 foreach my $each (split /\n/, &getProperties(&getTCName($tcname), "", "_all_")) {
3214 0 $each =~ /^\s*(\w+)\s+(\w+)\s*$/;
3215 0 $array {$1} = $2;
3216 }
3217 0 foreach my $each (sort keys %array) {
3218 0 ▶ if (($array{$each} =~ /$propertyPattern/) && ( $each =~ /$propertyName/)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($array{$each} =~ /$propertyPattern/ and $each =~ /$propertyName/) 0 0 0
Condition0%0/3
$array{$each} =~ /$propertyPattern/ and $each =~ /$propertyName/
!ll&&!rl&&r
000
MC/DC0%0/2
$array{$each} =~ /$propertyPattern/ and $each =~ /$propertyName/
$array{$each} =~ /$propertyPattern/ $each =~ /$propertyName/
Truth table0%0/3
A and B
A= $array{$each} =~ /$propertyPattern/B= $each =~ /$propertyName/
ABresult
0X0
100
111
3219 0 return "True\n$each:$array{$each}"; }
3220 }
3221 0 return 'False';
3222 }
3223  
3224 ################################################################################
3225 # Subroutine Name : getProperties
3226 # Function: return Test Case Property
3227 # Input Parameters: Property Name (regExp) (tcName, tcPattern, value)
3228 # Output/Returns : Property Value
3229 ################################################################################
3230 sub getProperties() { # get TC Property Names (TH:TC Managements)
3231 0 ▶ my %array; my $returnValue;
Subroutine getProperties: called CC=28 SCAR=44.2
Pod undocumented
3232 0 ▶ my $tcname ; $tcname = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 14 0 14
3233 14 ▶ my $propertyOp ; $propertyOp = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 14 0 14
3234 14 ▶ my $returnType= 'latest'; $returnType = shift if @_ ;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 14 0 14
3235  
3236 14 ▶ if ($propertyOp =~ s/^\s*add\s*=\s*//ig) {;}
Branch: 4 branches
BranchTrueFalseTotal
if ($propertyOp =~ s/^\s*add\s*=\s*//gi) { } 0 14 14
elsif ($propertyOp =~ s/^\s*_eq_\s*//g) { } 0 14 14
elsif ($propertyOp =~ s/\s*_eq_\s*/=/g) { } 0 14 14
elsif ($propertyOp =~ s/_column_/:/g) { } 0 14 14
3237 elsif ($propertyOp =~ s/^\s*_eq_\s*//g) {;}
3238 elsif ($propertyOp =~ s/\s*_eq_\s*/=/g) {;}
3239 elsif ($propertyOp =~ s/_column_/:/g) {;}
3240  
3241 14 ▶ if ($propertyOp =~ /_all_/) { $returnType = "_all_"; $propertyOp =~ s/_all_//g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyOp =~ /_all_/) 0 14 14
3242  
3243 # if ( -e "$tcname/thProperty.txt" ) { ; } else { return "info:There is no $_[0]/thProperty.txt here";}
3244 0 ▶ if ( -e "$tcname/thProperty.txt" ) { ; } else { return "info:There is no $tcname/thProperty.txt here";}
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcname/thProperty.txt") { } 14 0 14
3245 14 ▶ open Fin, "$tcname/thProperty.txt" || die "Can't open file:$!";
Condition50%1/2
"$tcname/thProperty.txt" || die("Can't open file:$!")
l!l
140
MC/DC0%0/1
"$tcname/thProperty.txt" || die("Can't open file:$!")
"$tcname/thProperty.txt"
Truth table50%1/2
A
A= "$tcname/thProperty.txt"
Aresult
11
00
3246 0 ▶ while ( $_ = <Fin> ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 300 14 314
3247  
3248 #local @ARGV ; my $propertyFName ; $propertyFName = "$tcname/thProperty.txt"; push @ARGV, $propertyFName if (-e $propertyFName );
3249 #$propertyFName = "$tcname/thPropertyLink.txt";
3250 #if (-e $propertyFName) { open Fin, $propertyFName; @_ = <Fin>; close Fin; foreach my $each (@_) { if (-e $each) { push @ARGV, $each."/thProperty.txt"; } } }
3251 # while ( $_ = <> ) {
3252 14 @_= split /\|/, $_;
3253  
3254 14 my $propertyName_ = $_[0]; my $propertyValue_ = $_[1]; $propertyName_ =~ s/^\s*//g; $propertyName_ =~ s/\s*$//g; my $propertyStartTime = $_[2];
3255 300 ▶ if (($propertyName_ !~ /^\s*$/) && ( $propertyValue_ !~ /^\s*$/)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($propertyName_ =~ /^\s*$/ or $propertyValue_ =~ /^\s*$/) 300 0 300
Condition33%1/3
$propertyName_ =~ /^\s*$/ or $propertyValue_ =~ /^\s*$/
l!l&&r!l&&!r
00300
MC/DC0%0/2
$propertyName_ =~ /^\s*$/ or $propertyValue_ =~ /^\s*$/
$propertyName_ =~ /^\s*$/ $propertyValue_ =~ /^\s*$/
Truth table33%1/3
A or B
A= $propertyName_ =~ /^\s*$/B= $propertyValue_ =~ /^\s*$/
ABresult
1X1
011
000
3256  
3257 300 ▶ if (($propertyName_ =~ /$propertyOp/i) || ( $propertyOp eq '')) { # PropertyPattern Filter
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyName_ =~ /$propertyOp/i or $propertyOp eq "") 21 279 300
Condition66%2/3
$propertyName_ =~ /$propertyOp/i or $propertyOp eq ""
l!l&&r!l&&!r
210279
MC/DC50%1/2
$propertyName_ =~ /$propertyOp/i or $propertyOp eq ""
$propertyName_ =~ /$propertyOp/i $propertyOp eq ""
Truth table66%2/3
A or B
A= $propertyName_ =~ /$propertyOp/iB= $propertyOp eq ""
ABresult
1X1
011
000
3258 300 ▶ if ($returnType =~ /^\s*$/) { $returnValue .= sprintf "%-20s=%s\n",$propertyName_, $propertyValue_;
Branch: 7 branches
BranchTrueFalseTotal
if ($returnType =~ /^\s*$/) { } 0 21 21
elsif ($returnType =~ /values/i) { } 0 21 21
elsif ($returnType =~ /_all_/i) { } 0 21 21
elsif ($returnType =~ /history/i) { } 0 21 21
elsif ($returnType =~ /\blatest\b/i) { } 20 1 21
elsif ($returnType =~ /\blast\b/i) { } 0 1 1
elsif ($returnType =~ /\bvalue\b/i) { } 1 0 1
3259 } elsif ($returnType =~ /values/i) {
3260 21 $returnValue .= sprintf "%s\n", $propertyValue_;
3261 } elsif ($returnType =~ /_all_/i) {
3262 0 $propertyValue_ =~ s/^\s*//g;
3263 0 $propertyValue_ =~ s/\s*$//g;
3264 0 $returnValue = sprintf "\t%s\n", $propertyValue_;
3265 } elsif ($returnType =~ /history/i) {
3266 0 $returnValue .= sprintf "%-20s=%s \@ $propertyStartTime\n",$propertyName_, $propertyValue_;
3267 } elsif ($returnType =~ /\blatest\b/i) {
3268 0 $returnValue = "$propertyValue_\n";
3269 } elsif ($returnType =~ /\blast\b/i) {
3270 0 ▶ if ($propertyValue_ !~ /dumy/) { $returnValue = "$propertyValue_\n"; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($propertyValue_ =~ /dumy/) 0 0 0
3271 } elsif ($returnType =~ /\bvalue\b/i) {
3272 0 $returnValue = sprintf "%s\n", $propertyValue_;
3273 }
3274 }
3275 0 $array{$propertyName_} = $returnValue;
3276 }
3277 }
3278 1 close Fin;
3279 300 $returnValue = "\n";
3280 14 ▶ if ($returnType =~ /_all_/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($returnType =~ /_all_/i) { } 0 14 14
3281 14 foreach my $each (sort keys %array) {
3282 14 $returnValue .= sprintf "%20s%s", $each, $array{$each}; }
3283 0 return $returnValue;
3284 } else {
3285 0 $returnValue = $array{$propertyOp} ;
3286 0 ▶ if ($returnValue ) { $returnValue =~ s/\s*\n\s*$//g; if ($returnValue =~ /^\s*$/) { $returnValue = "_noMatch_";} ; return $returnValue; }
Branch: 2 branches
BranchTrueFalseTotal
if ($returnValue) { } 14 0 14
if ($returnValue =~ /^\s*$/) 0 14 14
3287 0 else { return ""; }
3288 }
3289 }
3290  
3291 ################################################################################
3292 # Subroutine Name : modfyProperty
3293 # Function: modify Test Case Property
3294 # Input Parameters: Test Case Property Name
3295 # Output/Returns : updated c:\TC_*\thProperty.txt
3296 # Subroutine Name :
3297 # Function:
3298 # Input Parameters:
3299 # Output/Returns :
3300 ################################################################################
3301 sub modifyProperty() { # modify TC Property (TH:TC Managements)
3302 14 ▶ my $tcname = $_[0];
Subroutine modifyProperty: not called CC=2 SCAR=16.6
Pod undocumented
3303 0 my $propertyName = $_[1];
3304 0 my $propertyValue ;
3305 0 ▶ if ($propertyName =~ s/^\s*modify\s*_\s*//g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyName =~ s/^\s*modify\s*_\s*//g) 0 0 0
3306 0 $propertyName =~ /(\w+)\s*_as_\s*(\w+)\s*/;
3307 0 $propertyName = $1; $propertyValue = $2;
3308 }
3309 0 my $cmdStr = "delete=$propertyName";
3310 0 &deleteProperty( $tcname, $cmdStr );
3311 0 $cmdStr = "add_${propertyName}_column_${propertyValue}"; # todo
3312 0 print "pa; addProperty\n";
3313 0 &addProperty( $tcname, $cmdStr );
3314 0 return "$propertyName is modified to $propertyValue for $tcname";
3315 }
3316  
3317 ################################################################################
3318 # Subroutine Name : deleteProperty
3319 # Function: delete Test Case Property
3320 # Input Parameters: Test Case Property Name
3321 # Output/Returns : update c:\TC_*\thProperty.txt
3322 ################################################################################
3323 sub deleteProperty() { # delete TC Property (TH:TC Managements)
3324 0 ▶ my $fname = "$_[0]/thProperty.txt";
Subroutine deleteProperty: not called CC=7 SCAR=40.3
Pod undocumented
3325 0 my $fout = $fname; $fout =~ s/\.txt/_Dumpster\.txt/;
3326  
3327 0 my $propertyName = $_[1];
3328 0 ▶ if ($propertyName !~ /\s*del\S*\s*_\s*/) { return "Warning: wrong format -del=prop1;pr2Screen";} else {
Branch: 1 branch
BranchTrueFalseTotal
if (not $propertyName =~ /\s*del\S*\s*_\s*/) { } 0 0 0
3329 0 $propertyName =~ s/^\s*del\S*\s*_\s*//g; $propertyName =~ s/:\s*\S*//; }
3330 0 my %array ;
3331 0 open Fin, "$fname"; @_ = <Fin>; close Fin;
3332  
3333 0 open Fout, ">>$fout";
3334 0 foreach my $each (@_) {
3335 0 ▶ if ( $each =~ /^\s*$propertyName\s*\|/i ) { print Fout "$each"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /^\s*$propertyName\s*\|/i) 0 0 0
3336 }
3337 0 close Fout;
3338  
3339 0 ▶ open Fout, ">${fname}" || die "Can't open $fname:$!";
Condition0%0/2
">$fname" || die("Can't open ${fname}:$!")
l!l
00
MC/DC0%0/1
">$fname" || die("Can't open ${fname}:$!")
">$fname"
Truth table0%0/2
A
A= ">$fname"
Aresult
11
00
3340 0 foreach my $each (@_) {
3341 0 ▶ if ( $each !~ /^\s*$propertyName\s*\|/i ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($each =~ /^\s*$propertyName\s*\|/i) 0 0 0
3342 0 print Fout "$each";
3343 }
3344 }
3345 0 close Fout;
3346 0 return "$propertyName is deleted from $fname";
3347 }
3348  
3349 ################################################################################
3350 # Subroutine Name : createPropertyTemplate
3351 # Function:
3352 # Input Parameters:
3353 # Output/Returns :
3354 ################################################################################
3355 sub createPropertyTemplate() { # create TC Property File (TH:TC Managements)
3356 0 ▶ my $timeStr = getDate(); $timeStr = "|$timeStr|$timeStr|0:0:0:0s|Comment1|Comment2";
Subroutine createPropertyTemplate: called CC=2 SCAR=6.9
Pod undocumented
3357 9 my $tcDesc = "@_";
3358 9 my $fname = "@_/thProperty.txt";
3359 9 ▶ if (-e $fname) { open Fout, ">>$fname"; } else { open Fout, ">$fname";}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) { } 3 6 9
3360 3 printf Fout "%20s|%10s%s\n", 'tcId','null',$timeStr;
3361 6 printf Fout "%20s|%10s%s\n", 'tcDesc',$tcDesc,$timeStr;
3362 9 printf Fout "%20s|%10s%s\n", 'tcSPR','null',$timeStr;
3363 9 printf Fout "%20s|%10s%s\n", 'tcSCR','null',$timeStr;
3364 9 printf Fout "%20s|%10s%s\n", 'QA','null',$timeStr;
3365 9 printf Fout "%20s|%10s%s\n", 'modolID','null',$timeStr;
3366 9 printf Fout "%20s|%10s%s\n", 'priority','null',$timeStr;
3367 9 printf Fout "%20s|%10s%s\n", 'openSPR','null',$timeStr;
3368 9 printf Fout "%20s|%10s%s\n", 'tcID','null',$timeStr;
3369 9 printf Fout "%20s|%10s%s\n", 'tcOwner','null',$timeStr;
3370 9 printf Fout "%20s|%10s%s\n", 'tcId','null',$timeStr;
3371 9 printf Fout "%20s|%10s%s\n", 'resultN','null',$timeStr;
3372 9 close Fout;
3373 }
3374  
3375 ################################################################################
3376 # Subroutine Name : addProperty
3377 # Function: add Test Case Property
3378 # Input Parameters: Test Case Property Name
3379 # Output/Returns : updated c:\TC_*\thProperty.txt
3380 ################################################################################
3381 sub addProperty() { # add TC Property (TH:TC Managements)
3382 9 ▶ my $timeStr = &getDate(); $timeStr = "|$timeStr|$timeStr|0:0:0:0s|comment1|comment2";
Subroutine addProperty: called CC=5 SCAR=16.2
Pod undocumented
3383 16 my $fname = "$_[0]/thProperty.txt";
3384 16 my $propertyName = $_[1];
3385 16 $propertyName =~ s/^\s*add\s*=//g;
3386 16 $propertyName =~ s/^\s*add\s*_eq_\s*//g;
3387 16 ▶ if (-e $_[0]) {;} else { mkpath $_[0]; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $_[0]) { } 16 0 16
3388 16 open Fout, ">>$fname";
3389 0 ▶ if ($propertyName =~ /\|/) { # for tcRunResult
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyName =~ /\|/) { } 6 10 16
3390 16 $propertyName =~ /^\s*(\S+)\s*\|\s*(\S+)\s*\|(.+)\s*$/;
3391 16 my $propName = $1 ;
3392 6 my $propValue = $2 ;
3393 6 my $propComment = $3 ;
3394 6 $propValue =~ s/_space_/ /g ;
3395 6 $propValue =~ s/_eq_/=/g ;
3396 6 $propValue =~ s/_column_/:/g ;
3397 6 printf Fout "%20s|%10s|%s\n",$propName, $propValue,$propComment;
3398 } else {
3399 6 $propertyName =~ /^\s*(\S+)_column_(\S+)\s*/;
3400 6 my $propName = $1 ;
3401 10 my $propValue = $2 ;
3402 10 $propName = &match1stRegexp($propertyName, "_column_");
3403 10 $propValue= &matchRestRegexp($propertyName, "_column_");
3404 10 ▶ if ($propName && $propValue) {
Branch: 1 branch
BranchTrueFalseTotal
if ($propName and $propValue) 10 0 10
Condition33%1/3
$propName and $propValue
!ll&&!rl&&r
0010
MC/DC0%0/2
$propName and $propValue
$propName $propValue
Truth table33%1/3
A and B
A= $propNameB= $propValue
ABresult
0X0
100
111
3405 10 $propValue =~ s/_column_/:/g ;
3406 10 $propValue =~ s/_space_/ /g ;
3407 10 $propValue =~ s/_eq_/=/g ;
3408 10 $propValue =~ s/___/ /g ;
3409 10 $propName =~ s/^\s*add\s*=//g ;
3410 10 $propName =~ s/_space_/ /g ;
3411 10 printf Fout "%20s|%10s%s\n",$propName, $propValue,$timeStr;
3412 }
3413 }
3414 10 close Fout;
3415 10 return "$propertyName is added to $fname";
3416 }
3417  
3418 sub printGlobalVars {
3419 16 ▶my $return=<<EOF;
Subroutine printGlobalVars: called CC=1 SCAR=0.0
Pod undocumented
3420 ##################### Frequently Used Setting ####################
3421 web_ui_title =$web_ui_title
3422 tags =$tags
3423 ps1_args =$ps1_args
3424 Execution_24_7 =$Execution_24_7
3425 Execution_24_7_title =$Execution_24_7_title
3426 Execution_local_only =$Execution_local_only
3427 outputFromat =$outputFormat (text,noOutput -todo ,html-todo)
3428 htmlRefreshRate =$htmlRefreshRate
3429 htmlRefreshRateWebUI =$htmlRefreshRateWebUI
3430 htmlRefreshRateLogUI =$htmlRefreshRateLogUI
3431 ##################### WebUI Setting ####################
3432 excelReportColumnWidth =$excelReportColumnWidth
3433 pr2Screen =$pr2Screen
3434 webUI_TCDescWidth =$webUI_TCDescWidth
3435 scrollAmount =$scrollAmount
3436 borderWidth =$borderWidth
3437 borderStyle =$borderStyle
3438 passFailDisplayWidth =$passFailDisplayWidth
3439 maxPassFailDisplayWidth =$maxPassFailDisplayWidth
3440 tsPropertyWidth =$tsPropertyWidth
3441 webUITreeViewLevel =$webUITreeViewLevel
3442 ##################### TAF Default Settings ####################
3443 ip =$ip
3444 c =$c
3445 taf =$taf
3446 _TAF =$_TAF
3447 overWriteTC =$overWriteTC
3448 reportHtmlSummaryScale =$reportHtmlSummaryScale
3449 reportHtmlSummaryScaleMajor =$reportHtmlSummaryScaleMajor
3450 testcaseNode =$testcaseNode
3451 NofExecution =$NofExecution
3452 ExecutionLength =$ExecutionLength
3453 tsFilter =$tsFilter
3454 tcComment1 =$tcComment1
3455 tcComment2 =$tcComment2
3456 MaxTCExecTime =$MaxTCExecTime
3457 TSHookName =$TSHookName
3458 TSHookNameGenerated =$TSHookNameGenerated
3459 TSHookIsPerl =$TSHookIsPerl
3460 interact =$interact
3461 tcPropertyPatternName =$tcPropertyPatternName
3462 tcPropertyPatternPattern =$tcPropertyPatternPattern
3463 tcPropertyPatternName1 =$tcPropertyPatternName1
3464 tcPropertyPatternPattern1 =$tcPropertyPatternPattern1
3465 tcPropertyPatternName2 =$tcPropertyPatternName2
3466 tcPropertyPatternPattern2 =$tcPropertyPatternPattern2
3467 tcPropertyPatternName3 =$tcPropertyPatternName3
3468 tcPropertyPatternPattern3 =$tcPropertyPatternPattern3
3469 tcPropertyName =$tcPropertyName
3470 tcNamePattern =$tcNamePattern
3471 tcOp =$tcOp
3472 tcCtr =$tcCtr
3473 tcDelta =$tcDelta
3474 markSymbol =$markSymbol
3475 tsFilterDefault =$tsFilterDefault
3476 tcFilterDefault =$tcFilterDefault
3477 SvrDrive =$SvrDrive
3478 SvrProjName_ignore =$SvrProjName
3479 SvrTCName_ignore =$SvrTCName
3480 SvrTCNamePattern =$SvrTCNamePattern
3481 SvrPropNamePattern =$SvrPropNamePattern
3482 SvrPropValuePattern =$SvrPropValuePattern
3483 SvrTCNameExecPattern =$SvrTCNameExecPattern
3484 exitTAFGracefullyLock =$exitTAFGracefullyLock
3485 performanceMode =$performanceMode
3486 resetTSFileName =$resetTSFileName
3487 externalLogName =$externalLogName
3488 commandLogName =$commandLogName
3489 commandLogLifeSpan =$commandLogLifeSpan
3490 testType =$testType
3491 AutomationtsName =$AutomationtsName
3492 tsProperty =$tsProperty
3493 sleep4Display =$sleep4Display
3494 createOrAppendTS =$createOrAppendTS
3495 NofTCinTSTemplate =$NofTCinTSTemplate
3496 EOF
3497 }
3498 ################
3499
3500  
3501 sub printTSGlobalVars {
3502 16 ▶my $return=<<EOF;
Subroutine printTSGlobalVars: not called CC=1 SCAR=0.0
Pod undocumented
3503 ##################### Frequently Used Setting ####################
3504 Execution_24_7 =$Execution_24_7
3505 Execution_24_7_title =$Execution_24_7_title
3506 Execution_local_only =$Execution_local_only
3507 htmlRefreshRate =$htmlRefreshRate
3508 htmlRefreshRateWebUI =$htmlRefreshRateWebUI
3509 htmlRefreshRateLogUI =$htmlRefreshRateLogUI
3510 ##################### WebUI Setting ####################
3511 EOF
3512 }
3513  
3514 sub printTCGlobalVars {
3515 9 ▶my $return=<<EOF;
Subroutine printTCGlobalVars: not called CC=1 SCAR=0.0
Pod undocumented
3516 ##################### Frequently Used Setting ####################
3517 Execution_24_7 =$Execution_24_7
3518 Execution_24_7_title =$Execution_24_7_title
3519 Execution_local_only =$Execution_local_only
3520 htmlRefreshRate =$htmlRefreshRate
3521 htmlRefreshRateWebUI =$htmlRefreshRateWebUI
3522 htmlRefreshRateLogUI =$htmlRefreshRateLogUI
3523 ##################### WebUI Setting ####################
3524 EOF
3525 }
3526  
3527  
3528  
3529 ###############
3530  
3531 # sub readTAFTCVars { open Fin, "$c/$_TAF/$SvrProjName/$SvrTCName/_tafGlobalVars.txt" ; while (<Fin>) { chop; if ($_ =~ /(.+)=(.+)/ ) { &readTAFGlobalVars1($1, $2); } }; close Fin; }
3532 0 ▶sub readTAFTCVars { open Fin, "$SvrTCName/_tafGlobalVars.txt" ; while (<Fin>) { chop; if ($_ =~ /(.+)=(.+)/ ) { &readTAFGlobalVars1($1, $2); } }; close Fin; }
Subroutine readTAFTCVars: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ /(.+)=(.+)/) 0 0 0
3533 0 ▶sub readTAFTSVars { open Fin, "$c/$_TAF/$SvrProjName/_tafGlobalVars.txt" ; while (<Fin>) { chop; if ($_ =~ /(.+)=(.+)/ ) { &readTAFGlobalVars1($1, $2); } }; close Fin; }
Subroutine readTAFTSVars: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ /(.+)=(.+)/) 0 0 0
3534 0 ▶sub readTAFGlobalVars { open Fin, "$c/$_TAF/_tafGlobalVars.txt" ; while (<Fin>) { chop; if ($_ =~ /(.+)=(.+)/ ) { &readTAFGlobalVars1($1, $2); } } close Fin; }
Subroutine readTAFGlobalVars: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ /(.+)=(.+)/) 0 0 0
3535 sub readTAFGlobalVars1 {
3536 0 ▶ my $varName = shift;
Subroutine readTAFGlobalVars1: not called CC=74 SCAR=86.2
Pod undocumented
3537 0 my $varValue = shift;
3538 0 $varName =~ s/^\s*//g; $varName =~ s/\s*$//g;
3539 0 $varValue =~ s/^\s*//g; $varValue=~ s/\s*$//g;
3540 0 ▶if ($varName eq "web_ui_title" ) { $web_ui_title = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "web_ui_title") 0 0 0
3541 0 ▶if ($varName eq "tags" ) { $tags = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tags") 0 0 0
3542 0 ▶if ($varName eq "ps1_args" ) { $ps1_args = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "ps1_args") 0 0 0
3543 0 ▶if ($varName eq "excelReportColumnWidth" ) { $excelReportColumnWidth = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "excelReportColumnWidth") 0 0 0
3544 0 ▶if ($varName eq "testcaseNode" ) { $testcaseNode = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "testcaseNode") 0 0 0
3545 0 ▶if ($varName eq "pr2Screen" ) { $pr2Screen = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "pr2Screen") 0 0 0
3546 0 ▶if ($varName eq "webUI_TCDescWidth" ) { $webUI_TCDescWidth = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "webUI_TCDescWidth") 0 0 0
3547 0 ▶if ($varName eq "webUITreeViewLevel" ) { $webUITreeViewLevel = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "webUITreeViewLevel") 0 0 0
3548 0 ▶if ($varName eq "scrollAmount" ) { $scrollAmount = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "scrollAmount") 0 0 0
3549 0 ▶if ($varName eq "borderWidth" ) { $borderWidth = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "borderWidth") 0 0 0
3550 0 ▶if ($varName eq "borderStyle" ) { $borderStyle = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "borderStyle") 0 0 0
3551 0 ▶if ($varName eq "passFailDisplayWidth" ) { $passFailDisplayWidth = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "passFailDisplayWidth") 0 0 0
3552 0 ▶if ($varName eq "maxPassFailDisplayWidth" ) { $maxPassFailDisplayWidth = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "maxPassFailDisplayWidth") 0 0 0
3553 0 ▶if ($varName eq "reportHtmlSummaryScale" ) { $reportHtmlSummaryScale = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "reportHtmlSummaryScale") 0 0 0
3554 0 ▶if ($varName eq "reportHtmlSummaryScaleMajor" ) { $reportHtmlSummaryScaleMajor = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "reportHtmlSummaryScaleMajor") 0 0 0
3555 0 ▶if ($varName eq "tsPropertyWidth" ) { $tsPropertyWidth = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tsPropertyWidth") 0 0 0
3556 0 ▶if ($varName eq "c" ) { $c = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "c") 0 0 0
3557 0 ▶if ($varName eq "taf" ) { $taf = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "taf") 0 0 0
3558 0 ▶if ($varName eq "_TAF" ) { $_TAF = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "_TAF") 0 0 0
3559 0 ▶if ($varName eq "Execution_24_7" ) { $Execution_24_7 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "Execution_24_7") 0 0 0
3560 0 ▶if ($varName eq "Execution_24_7_title" ) { $Execution_24_7_title = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "Execution_24_7_title") 0 0 0
3561 0 ▶if ($varName eq "Execution_local_only" ) { $Execution_local_only = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "Execution_local_only") 0 0 0
3562 0 ▶if ($varName eq "Execution_from_cgi" ) { $Execution_from_cgi = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "Execution_from_cgi") 0 0 0
3563 0 ▶if ($varName eq "NofExecution" ) { $NofExecution = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "NofExecution") 0 0 0
3564 0 ▶if ($varName eq "ExecutionLength" ) { $ExecutionLength = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "ExecutionLength") 0 0 0
3565 0 ▶if ($varName eq "tsFilter" ) { $tsFilter = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tsFilter") 0 0 0
3566 0 ▶if ($varName eq "tcComment1" ) { $tcComment1 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcComment1") 0 0 0
3567 0 ▶if ($varName eq "tcComment2" ) { $tcComment2 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcComment2") 0 0 0
3568 0 ▶if ($varName eq "MaxTCExecTime" ) { $MaxTCExecTime = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "MaxTCExecTime") 0 0 0
3569 0 ▶if ($varName eq "TSHookName" ) { $TSHookName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "TSHookName") 0 0 0
3570 0 ▶if ($varName eq "TSHookNameGenerated" ) { $TSHookNameGenerated = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "TSHookNameGenerated") 0 0 0
3571 0 ▶if ($varName eq "interact" ) { $interact = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "interact") 0 0 0
3572 0 ▶if ($varName eq "tcPropertyPatternName" ) { $tcPropertyPatternName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternName") 0 0 0
3573 0 ▶if ($varName eq "tcPropertyPatternPattern" ) { $tcPropertyPatternPattern = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternPattern") 0 0 0
3574 0 ▶if ($varName eq "tcPropertyPatternName1" ) { $tcPropertyPatternName1 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternName1") 0 0 0
3575 0 ▶if ($varName eq "tcPropertyPatternPattern1" ) { $tcPropertyPatternPattern1 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternPattern1") 0 0 0
3576 0 ▶if ($varName eq "tcPropertyPatternName2" ) { $tcPropertyPatternName2 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternName2") 0 0 0
3577 0 ▶if ($varName eq "tcPropertyPatternPattern2" ) { $tcPropertyPatternPattern2 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternPattern2") 0 0 0
3578 0 ▶if ($varName eq "tcPropertyPatternName3" ) { $tcPropertyPatternName3 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternName3") 0 0 0
3579 0 ▶if ($varName eq "tcPropertyPatternPattern3" ) { $tcPropertyPatternPattern3 = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyPatternPattern3") 0 0 0
3580 0 ▶if ($varName eq "tcPropertyName" ) { $tcPropertyName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcPropertyName") 0 0 0
3581 0 ▶if ($varName eq "tcNamePattern" ) { $tcNamePattern = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcNamePattern") 0 0 0
3582 0 ▶if ($varName eq "tcOp" ) { $tcOp = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcOp") 0 0 0
3583 0 ▶if ($varName eq "tcCtr" ) { $tcCtr = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcCtr") 0 0 0
3584 0 ▶if ($varName eq "tcDelta" ) { $tcDelta = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcDelta") 0 0 0
3585 0 ▶if ($varName eq "markSymbol" ) { $markSymbol = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "markSymbol") 0 0 0
3586 0 ▶if ($varName eq "tsFilterDefault" ) { $tsFilterDefault = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tsFilterDefault") 0 0 0
3587 0 ▶if ($varName eq "tcFilterDefault" ) { $tcFilterDefault = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tcFilterDefault") 0 0 0
3588 0 ▶if ($varName eq "SvrDrive" ) { $SvrDrive = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrDrive") 0 0 0
3589 0 ▶if ($varName eq "SvrProjName" ) { $SvrProjName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrProjName") 0 0 0
3590 0 ▶if ($varName eq "SvrTCName" ) { $SvrTCName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrTCName") 0 0 0
3591 0 ▶if ($varName eq "SvrTCNamePattern" ) { $SvrTCNamePattern = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrTCNamePattern") 0 0 0
3592 0 ▶if ($varName eq "SvrPropNamePattern" ) { $SvrPropNamePattern = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrPropNamePattern") 0 0 0
3593 0 ▶if ($varName eq "SvrPropValuePattern" ) { $SvrPropValuePattern = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrPropValuePattern") 0 0 0
3594 0 ▶if ($varName eq "SvrTCNameExecPattern" ) { $SvrTCNameExecPattern = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "SvrTCNameExecPattern") 0 0 0
3595 0 ▶if ($varName eq "exitTAFGracefullyLock" ) { $exitTAFGracefullyLock = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "exitTAFGracefullyLock") 0 0 0
3596 0 ▶if ($varName eq "performanceMode" ) { $performanceMode = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "performanceMode") 0 0 0
3597 0 ▶if ($varName eq "tsFrom" ) { $tsFrom = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tsFrom") 0 0 0
3598 0 ▶if ($varName eq "tsTo" ) { $tsTo = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tsTo") 0 0 0
3599 0 ▶if ($varName eq "resetTSFileName" ) { $resetTSFileName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "resetTSFileName") 0 0 0
3600 0 ▶if ($varName eq "externalLogName" ) { $externalLogName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "externalLogName") 0 0 0
3601 0 ▶if ($varName eq "commandLogName" ) { $commandLogName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "commandLogName") 0 0 0
3602 0 ▶if ($varName eq "commandLogLifeSpan" ) { $commandLogLifeSpan = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "commandLogLifeSpan") 0 0 0
3603 0 ▶if ($varName eq "testType" ) { $testType = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "testType") 0 0 0
3604 0 ▶if ($varName eq "AutomationtsName" ) { $AutomationtsName = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "AutomationtsName") 0 0 0
3605 0 ▶if ($varName eq "tsProperty" ) { $tsProperty = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "tsProperty") 0 0 0
3606 0 ▶if ($varName eq "TsHookIsPerl" ) { $TSHookIsPerl = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "TsHookIsPerl") 0 0 0
3607 0 ▶if ($varName eq "createOrAppendTS" ) { $createOrAppendTS = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "createOrAppendTS") 0 0 0
3608 0 ▶if ($varName eq "htmlRefreshRate" ) { $htmlRefreshRate = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "htmlRefreshRate") 0 0 0
3609 0 ▶if ($varName eq "htmlRefreshRateWebUI" ) { $htmlRefreshRateWebUI = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "htmlRefreshRateWebUI") 0 0 0
3610 0 ▶if ($varName eq "NofTCinTSTemplate" ) { $NofTCinTSTemplate = $varValue; }
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "NofTCinTSTemplate") 0 0 0
3611  
3612 0 ▶if ($varName eq "testcaseNode" ) { $testcaseNode = $varValue;
Branch: 1 branch
BranchTrueFalseTotal
if ($varName eq "testcaseNode") 0 0 0
3613 # &updateTAFGlobalVars();
3614 0 ▶if ($testcaseNode =~ /_null_/) { $testcaseNode = "";}
Branch: 1 branch
BranchTrueFalseTotal
if ($testcaseNode =~ /_null_/) 0 0 0
3615 }
3616 }
3617  
3618 sub getGlobalVars_old {
3619 0 ▶ my $return = <<EOF;
Subroutine getGlobalVars_old: not called CC=1 SCAR=6.9
Pod undocumented
3620 \$ip = $ip
3621 \$c = $c
3622 \$_TAF = $_TAF
3623 \$SvrDrive = $SvrDrive
3624 \$SvrProjName = $SvrProjName
3625 \$SvrTCName = $SvrTCName
3626 \$SvrTCNamePattern = $SvrTCNamePattern
3627 \$SvrTCNameExecPattern = $SvrTCNameExecPattern
3628 \$tcOp = $tcOp
3629 \$SvrPropNamePattern = $SvrPropNamePattern
3630 \$SvrPropValuePattern = $SvrPropValuePattern
3631 \$pr2Screen = $pr2Screen
3632 \$tc_pl = $tc_pl
3633 \$tsDriver = $tsDriver
3634 \$web_ui_title = $web_ui_title
3635 \$workingDir = $workingDir
3636 \$tcIdMin = $tcIdMin
3637 \$tcPropertyPatternPattern = $tcPropertyPatternPattern
3638 \$tcPropertyPatternName = $tcPropertyPatternName
3639 \$ps1_args = $ps1_args
3640 \$sleep4Display = $sleep4Display
3641 \$Execution_24_7 = $Execution_24_7
3642 \$NofExecution = $NofExecution
3643 \$ExecutionLength = $ExecutionLength
3644 \$ExecutionType = $ExecutionType
3645 \$performanceMode = $performanceMode
3646 \$testcaseNode = $testcaseNode
3647 \$testType = $testType
3648 \$tsTo = $tsTo
3649 \$tsFrom = $tsFrom
3650 \$sleep4Display = $sleep4Display
3651 \$makeMark = $makeMark
3652 \$externalLogName = $externalLogName
3653 \$tags = $tags
3654
3655 EOF
3656 0 return $return;
3657 }
3658 sub setGlobalVars {
3659 6 ▶ shift;
Subroutine setGlobalVars: called CC=113 SCAR=90.4
Pod undocumented
3660 6 @_ = split /;/, shift;
3661 6 my $foundMatch = 0;
3662 6 foreach my $each (@_) {
3663 8 my $varName = ""; my $varValue = "";
3664 8 ▶ if ($each =~ /^\s*(\S+)\s*=\s*(\S+)?\s*/) { $varName = $1; $varValue = $2; }
Branch: 2 branches
BranchTrueFalseTotal
if ($each =~ /^\s*(\S+)\s*=\s*(\S+)?\s*/) { } 8 0 8
elsif (/^\s*(\S+)\s*=\s*(\S+)?\s*/) { } 0 0 0
3665 0 elsif (/^\s*(\S+)\s*=\s*(\S+)?\s*/) { $varName =$1; $varValue = "";}
3666 0 ▶ if ($varName =~ /SysDrive/i) { $SvrDrive = $varValue; $foundMatch = 1;}
Branch: 105 branches
BranchTrueFalseTotal
if ($varName =~ /SysDrive/i) { } 0 8 8
elsif ($varName =~ /SvrDrive/i) { } 2 6 8
elsif ($varName =~ /SvrProjName/i) { } 2 4 6
elsif ($varName =~ /SvrTCName\b/i) { } 0 4 4
elsif ($varName =~ /SvrTCNamePattern\b/i) { } 0 4 4
elsif ($varName =~ /SvrTCNameExecPattern/i) { } 0 4 4
elsif ($varName =~ /SvrPropNamePattern\b/i) { } 0 4 4
elsif ($varName =~ /SvrPropValuePattern/i) { } 0 4 4
elsif ($varName =~ /\bDrive\b/i) { } 0 4 4
elsif ($varName =~ /\bProjName\b/i) { } 0 4 4
elsif ($varName =~ /\bTCName\b/i) { } 0 4 4
elsif ($varName =~ /\bTCNamePattern\b/i) { } 0 4 4
elsif ($varName =~ /\bTCNameExecPattern/i) { } 0 4 4
elsif ($varName =~ /\btcOp\b/i) { } 0 4 4
elsif ($varName =~ /\bPropNamePattern\b/i) { } 0 4 4
elsif ($varName =~ /\bPropValuePattern\b/i) { } 0 4 4
elsif ($varName =~ /\bTestSuit\b/i) { } 0 4 4
elsif ($varName =~ /\bTestSuite\b/i) { } 0 4 4
elsif ($varName =~ /\bsubTestSuite\b/i) { } 0 4 4
elsif ($varName =~ /\bTestSuiteSub\b/i) { } 0 4 4
elsif ($varName =~ /\bTCNameFilter\b/i) { } 0 4 4
elsif ($varName =~ /\bTCNameExecFilter\b/i) { } 0 4 4
elsif ($varName =~ /\bTestCaseExec\b/i) { } 0 4 4
elsif ($varName =~ /\bTestCase\b/i) { } 0 4 4
elsif ($varName =~ /\bPropNameFilter\b/i) { } 0 4 4
elsif ($varName =~ /\bPropValueFilter\b/i) { } 0 4 4
elsif ($varName =~ /\btcPropertyName\b/i) { } 0 4 4
elsif ($varName =~ /\btsuit\b/i) { } 0 4 4
elsif ($varName =~ /\btname\b/i) { } 0 4 4
elsif ($varName =~ /\bpname\b/i) { } 0 4 4
elsif ($varName =~ /\bpvalue\b/i) { } 0 4 4
elsif ($varName =~ /\btop\b/i) { } 0 4 4
elsif ($varName =~ /\bts\b/i) { } 0 4 4
elsif ($varName =~ /\btn\b/i) { } 0 4 4
elsif ($varName =~ /\btc\b/i) { } 0 4 4
elsif ($varName =~ /\btne\b/i) { } 0 4 4
elsif ($varName =~ /\bop\b/i) { } 0 4 4
elsif ($varName =~ /\bpr2Screen\b/i) { } 2 2 4
elsif ($varName =~ /\bnotUsegetTCName\b/i) { } 2 0 2
elsif ($varName =~ /\btc_pl\b/i) { } 0 0 0
elsif ($varName =~ /\btcDriver\b/i) { } 0 0 0
elsif ($varName =~ /\btsDriver\b/i) { } 0 0 0
elsif ($varName =~ /\bweb_ui_title\b/i) { } 0 0 0
elsif ($varName =~ /\bworkingDir\b/i) { } 0 0 0
elsif ($varName =~ /\btcIdMin\b/i) { } 0 0 0
elsif ($varName =~ /\btcPropertyPatternPattern\b/i) { } 0 0 0
elsif ($varName =~ /\btcPropertyPatternName\b/i) { } 0 0 0
elsif ($varName =~ /\btcFilterFilter\b/i) { } 0 0 0
elsif ($varName =~ /\btcFilterName\b/i) { } 0 0 0
elsif ($varName =~ /\btppp\b/i) { } 0 0 0
elsif ($varName =~ /\btppn\b/i) { } 0 0 0
elsif ($varName =~ /\btppp1\b/i) { } 0 0 0
elsif ($varName =~ /\btppn1\b/i) { } 0 0 0
elsif ($varName =~ /\btppp2\b/i) { } 0 0 0
elsif ($varName =~ /\btppn2\b/i) { } 0 0 0
elsif ($varName =~ /\btppp2\b/i) { } 0 0 0
elsif ($varName =~ /\btppn2\b/i) { } 0 0 0
elsif ($varName =~ /\bkeyValue\b/i) { } 0 0 0
elsif ($varName =~ /\bkey\b/i) { } 0 0 0
elsif ($varName =~ /\btcFilters\b/i) { } 0 0 0
elsif ($varName =~ /\bps1_args\b/i) { } 0 0 0
elsif ($varName =~ /\bsleep4Display\b/i) { } 0 0 0
elsif ($varName =~ /\btcDelay\b/i) { } 0 0 0
elsif ($varName =~ /\bc\b/i) { } 0 0 0
elsif ($varName =~ /\b_TAF\b/i) { } 0 0 0
elsif ($varName =~ /\bExecution_24_7\b/i) { } 0 0 0
elsif ($varName =~ /\bNofExecution\b/i) { } 0 0 0
elsif ($varName =~ /\bExecutionLength\b/i) { } 0 0 0
elsif ($varName =~ /\bExecutionType\b/i) { } 0 0 0
elsif ($varName =~ /\bperformanceMode\b/i) { } 0 0 0
elsif ($varName =~ /\bpm\b/i) { } 0 0 0
elsif ($varName =~ /\bpropertyOp\b/i) { } 0 0 0
elsif ($varName =~ /\bpo\b/i) { } 0 0 0
elsif ($varName =~ /\btsFilter\b/i) { } 0 0 0
elsif ($varName =~ /\bSUTSymbol\b/i) { } 0 0 0
elsif ($varName =~ /\btsFilterDefault\b/i) { } 0 0 0
elsif ($varName =~ /\bnotUsegetTCName\b/i) { } 0 0 0
elsif ($varName =~ /\bTSHookName\b/i) { } 0 0 0
elsif ($varName =~ /\bTSHookNameGenerated\b/i) { } 0 0 0
elsif ($varName =~ /\btestcaseNode\b/i) { } 0 0 0
elsif ($varName =~ /\btestType\b/i) { } 0 0 0
elsif ($varName =~ /\btsFrom\b/i) { } 0 0 0
elsif ($varName =~ /\btsTo\b/i) { } 0 0 0
elsif ($varName =~ /\bmakeMark\b/i) { } 0 0 0
elsif ($varName =~ /\bexitTAFGracefullyString\b/i) { } 0 0 0
elsif ($varName =~ /\bAutomationtsName\b/i) { } 0 0 0
elsif ($varName =~ /\bresetTSFileName\b/i) { } 0 0 0
elsif ($varName =~ /\bexitTAFTCId\b/i) { } 0 0 0
elsif ($varName =~ /\btcComment1\b/i) { } 0 0 0
elsif ($varName =~ /\btcComment2\b/i) { } 0 0 0
elsif ($varName =~ /\bexternalLogName\b/i) { } 0 0 0
elsif ($varName =~ /\bexternalLogName\b/i) { } 0 0 0
elsif ($varName =~ /\boutputFormat\b/i) { } 0 0 0
elsif ($varName =~ /\bhtmlRefreshRate\b/i) { } 0 0 0
elsif ($varName =~ /\bhtmlRefreshRateWebUI\b/i) { } 0 0 0
elsif ($varName =~ /\bhtmlRefreshRateLogUI\b/i) { } 0 0 0
elsif ($varName =~ /\bip\b/i) { } 0 0 0
elsif ($varName =~ /\boverWriteTC\b/i) { } 0 0 0
elsif ($varName =~ /\bTSHookIsPerl\b/i) { } 0 0 0
elsif ($varName =~ /\bcreateOrAppendTS\b/i) { } 0 0 0
elsif ($varName =~ /\btitleStatus\b/i) { } 0 0 0
elsif ($varName =~ /\bwebUITreeViewLevel\b/i) { } 0 0 0
elsif ($varName =~ /\bNofPropertyExec\b/i) { } 0 0 0
elsif ($varName =~ /\bNofTCinTSTemplate\b/i) { } 0 0 0
elsif ($varName =~ /\btags\b/i) { } 0 0 0
3667 2 elsif ($varName =~ /SvrDrive/i) { $SvrDrive = $varValue; $foundMatch = 1;}
3668 2 elsif ($varName =~ /SvrProjName/i) { $SvrProjName = $varValue; $foundMatch = 1;}
3669 0 elsif ($varName =~ /SvrTCName\b/i) { $SvrTCName = $varValue; $foundMatch = 1;}
3670 0 elsif ($varName =~ /SvrTCNamePattern\b/i) { $SvrTCNamePattern = $varValue; $SvrTCNameExecPattern = $SvrTCNamePattern; $foundMatch = 1;}
3671 0 elsif ($varName =~ /SvrTCNameExecPattern/i) { $SvrTCNameExecPattern = $varValue; $foundMatch = 1;}
3672 0 elsif ($varName =~ /SvrPropNamePattern\b/i) { $SvrPropNamePattern= $varValue; $foundMatch = 1;}
3673 0 elsif ($varName =~ /SvrPropValuePattern/i) { $SvrPropValuePattern= $varValue; $foundMatch = 1;}
3674 0 elsif ($varName =~ /\bDrive\b/i) { $SvrDrive = $varValue; $foundMatch = 1;}
3675 0 elsif ($varName =~ /\bProjName\b/i) { $SvrProjName = $varValue; $foundMatch = 1;}
3676 0 elsif ($varName =~ /\bTCName\b/i) { $SvrTCName = $varValue; $foundMatch = 1;}
3677 0 elsif ($varName =~ /\bTCNamePattern\b/i) { $SvrTCNamePattern = $varValue; $foundMatch = 1;}
3678 0 elsif ($varName =~ /\bTCNameExecPattern/i) { $SvrTCNameExecPattern = $varValue; $foundMatch = 1;}
3679 0 elsif ($varName =~ /\btcOp\b/i) { $tcOp= $varValue; $foundMatch = 1;}
3680 0 elsif ($varName =~ /\bPropNamePattern\b/i) { $SvrPropNamePattern= $varValue; $foundMatch = 1;}
3681 0 elsif ($varName =~ /\bPropValuePattern\b/i) { $SvrPropValuePattern= $varValue; $foundMatch = 1;}
3682 0 elsif ($varName =~ /\bTestSuit\b/i) { $SvrProjName = $varValue; $foundMatch = 1; $SvrProjName =~ s/\\/\//g; $SvrProjName =~ s/$c\/$_TAF\///; }
3683 0 elsif ($varName =~ /\bTestSuite\b/i) { $SvrProjName = $varValue; $foundMatch = 1; $SvrProjName =~ s/\\/\//g; $SvrProjName =~ s/$c\/$_TAF\///;}
3684 0 elsif ($varName =~ /\bsubTestSuite\b/i) { $SvrProjNameSub = $varValue; $foundMatch = 1; $SvrProjNameSub =~ s/\\/\//g; $SvrProjNameSub =~ s/$c\/$_TAF\///;}
3685 0 elsif ($varName =~ /\bTestSuiteSub\b/i) { $SvrProjNameSub = $varValue; $foundMatch = 1; $SvrProjNameSub =~ s/\\/\//g; $SvrProjNameSub =~ s/$c\/$_TAF\///;}
3686 0 elsif ($varName =~ /\bTCNameFilter\b/i) { $SvrTCNamePattern = $varValue;$foundMatch = 1;}
3687 0 elsif ($varName =~ /\bTCNameExecFilter\b/i) { $SvrTCNameExecPattern = $varValue; $foundMatch = 1;}
3688 0 elsif ($varName =~ /\bTestCaseExec\b/i) { $SvrTCNameExecPattern = $varValue; $foundMatch = 1;}
3689 0 elsif ($varName =~ /\bTestCase\b/i) { $SvrTCNamePattern = $varValue; $foundMatch = 1;}
3690 0 elsif ($varName =~ /\bPropNameFilter\b/i) { $SvrPropNamePattern= $varValue; $foundMatch = 1;}
3691 0 elsif ($varName =~ /\bPropValueFilter\b/i) { $SvrPropValuePattern= $varValue; $foundMatch = 1;}
3692 0 elsif ($varName =~ /\btcPropertyName\b/i) { $tcPropertyName = $varValue; $foundMatch = 1;}
3693 0 elsif ($varName =~ /\btsuit\b/i) { $SvrProjName = $varValue; $foundMatch = 1;}
3694 0 elsif ($varName =~ /\btname\b/i) { $SvrTCNamePattern = $varValue; $foundMatch = 1;}
3695 0 elsif ($varName =~ /\bpname\b/i) { $SvrPropNamePattern= $varValue; $foundMatch = 1;}
3696 0 elsif ($varName =~ /\bpvalue\b/i) { $SvrPropValuePattern= $varValue; $foundMatch = 1;}
3697 0 elsif ($varName =~ /\btop\b/i) { $tcOp= $varValue; $foundMatch = 1;}
3698  
3699 0 elsif ($varName =~ /\bts\b/i) { $SvrProjName = $varValue; $foundMatch = 1;}
3700 0 elsif ($varName =~ /\btn\b/i) { $SvrTCNamePattern = $varValue; $foundMatch = 1;}
3701 0 elsif ($varName =~ /\btc\b/i) { $SvrTCNamePattern = $varValue; $foundMatch = 1;}
3702 0 elsif ($varName =~ /\btne\b/i) { $SvrTCNameExecPattern = $varValue; $foundMatch = 1;}
3703 0 elsif ($varName =~ /\bop\b/i) { $tcOp= $varValue; $foundMatch = 1;}
3704  
3705 2 elsif ($varName =~ /\bpr2Screen\b/i) { $pr2Screen= $varValue; $foundMatch = 1;}
3706 2 elsif ($varName =~ /\bnotUsegetTCName\b/i) { $notUsegetTCName = $varValue; $foundMatch = 1;}
3707 0 elsif ($varName =~ /\btc_pl\b/i) { $tc_pl= $varValue; $foundMatch = 1;}
3708 0 elsif ($varName =~ /\btcDriver\b/i) { $tc_pl= $varValue; $foundMatch = 1;}
3709 0 elsif ($varName =~ /\btsDriver\b/i) { $tsDriver = $varValue; $foundMatch = 1;}
3710 0 elsif ($varName =~ /\bweb_ui_title\b/i) { $web_ui_title= $varValue; $foundMatch = 1; $web_ui_title =~ s/___/ /g;}
3711 0 elsif ($varName =~ /\bworkingDir\b/i) { $workingDir= $varValue; $foundMatch = 1; $workingDir =~ s/\\/\//g;}
3712 0 elsif ($varName =~ /\btcIdMin\b/i) { $tcIdMin = $varValue; $foundMatch = 1;}
3713  
3714 0 elsif ($varName=~/\btcPropertyPatternPattern\b/i){ $tcPropertyPatternPattern= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3715 0 elsif ($varName =~ /\btcPropertyPatternName\b/i){ $tcPropertyPatternName= $varValue; $foundMatch = 1;}
3716  
3717 0 elsif ($varName=~/\btcFilterFilter\b/i) { $tcPropertyPatternPattern= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3718 0 elsif ($varName =~ /\btcFilterName\b/i) { $tcPropertyPatternName= $varValue; $foundMatch = 1;}
3719  
3720 0 elsif ($varName =~ /\btppp\b/i) { $tcPropertyPatternPattern= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3721 0 elsif ($varName =~ /\btppn\b/i) { $tcPropertyPatternName= $varValue; $foundMatch = 1;}
3722  
3723 0 elsif ($varName =~ /\btppp1\b/i) { $tcPropertyPatternPattern1= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3724 0 elsif ($varName =~ /\btppn1\b/i) { $tcPropertyPatternName1= $varValue; $foundMatch = 1;}
3725  
3726 0 elsif ($varName =~ /\btppp2\b/i) { $tcPropertyPatternPattern2= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3727 0 elsif ($varName =~ /\btppn2\b/i) { $tcPropertyPatternName2= $varValue; $foundMatch = 1;}
3728  
3729 0 elsif ($varName =~ /\btppp2\b/i) { $tcPropertyPatternPattern3= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3730 0 elsif ($varName =~ /\btppn2\b/i) { $tcPropertyPatternName3= $varValue; $foundMatch = 1;}
3731  
3732 0 elsif ($varName =~ /\bkeyValue\b/i) { $tcPropertyPatternPattern= $varValue; $foundMatch = 1; $tcPropertyPatternPattern =~ s/_pipe_/\|/gi;}
3733 0 elsif ($varName =~ /\bkey\b/i) { $tcPropertyPatternName= $varValue; $foundMatch = 1;}
3734  
3735 elsif ($varName =~ /\btcFilters\b/i) {
3736 0 $varValue =~ /(.+)_matches_(.+)/;
3737 0 $tcPropertyPatternName = $1;
3738 0 $tcPropertyPatternPattern = $2;
3739 0 $foundMatch = 1;
3740 }
3741  
3742 0 elsif ($varName =~ /\bps1_args\b/i) { $ps1_args = $varValue; $foundMatch = 1; $ps1_args =~ s/___/ /ig;}
3743 0 elsif ($varName =~ /\bsleep4Display\b/i) { $sleep4Display = $varValue; $foundMatch = 1;}
3744 0 elsif ($varName =~ /\btcDelay\b/i) { $sleep4Display = $varValue; $foundMatch = 1;}
3745 0 elsif ($varName =~ /\bc\b/i) { $c = $varValue; $foundMatch = 1;}
3746 0 elsif ($varName =~ /\b_TAF\b/i) { $_TAF = $varValue; $foundMatch = 1;}
3747 0 elsif ($varName =~ /\bExecution_24_7\b/i) { $Execution_24_7 = $varValue; $foundMatch = 1;}
3748 0 elsif ($varName =~ /\bNofExecution\b/i) { $NofExecution = $varValue; $foundMatch = 1;}
3749 0 elsif ($varName =~ /\bExecutionLength\b/i) { $ExecutionLength = $varValue; $foundMatch = 1;}
3750 0 elsif ($varName =~ /\bExecutionType\b/i) { $ExecutionType = $varValue; $foundMatch = 1;}
3751 0 elsif ($varName =~ /\bperformanceMode\b/i) { $performanceMode = $varValue; $foundMatch = 1;}
3752 0 elsif ($varName =~ /\bpm\b/i) { $performanceMode = $varValue; $foundMatch = 1;}
3753 0 elsif ($varName =~ /\bpropertyOp\b/i) { $propertyOp = $varValue; $foundMatch = 1; $propertyOp =~ s/_null_//ig;}
3754 0 elsif ($varName =~ /\bpo\b/i) { $propertyOp = $varValue; $foundMatch = 1; $propertyOp =~ s/_null_//ig;}
3755 0 elsif ($varName =~ /\btsFilter\b/i) { $tsFilter = $varValue; $foundMatch = 1;}
3756 0 elsif ($varName =~ /\bSUTSymbol\b/i) { $SUTSymbol = $varValue; $foundMatch = 1;}
3757 0 elsif ($varName =~ /\btsFilterDefault\b/i) { $tsFilterDefault = $varValue; $foundMatch = 1;}
3758 0 elsif ($varName =~ /\bnotUsegetTCName\b/i) { $notUsegetTCName = $varValue; $foundMatch = 1;}
3759 0 elsif ($varName =~ /\bTSHookName\b/i) { $TSHookName = $varValue; $foundMatch = 1;}
3760 0 elsif ($varName =~ /\bTSHookNameGenerated\b/i) { $TSHookNameGenerated = $varValue; $foundMatch = 1;}
3761 0 ▶ elsif ($varName =~ /\btestcaseNode\b/i) { $testcaseNode = $varValue; $foundMatch = 1; if ($testcaseNode =~ /_null_/) {$testcaseNode = "";}; }
Branch: 1 branch
BranchTrueFalseTotal
if ($testcaseNode =~ /_null_/) 0 0 0
3762 0 elsif ($varName =~ /\btestType\b/i) { $testType = $varValue; $foundMatch = 1;
3763 #if ($testcaseNode !~ /^\s*$/) {
3764 0 ▶ if ($testType =~ /tc/i) { $testcaseNode = ".*";}
Branch: 1 branch
BranchTrueFalseTotal
if ($testType =~ /tc/i) 0 0 0
3765 0 ▶ if ($testType =~ /ts/i) { $testcaseNode = "testcase";}
Branch: 1 branch
BranchTrueFalseTotal
if ($testType =~ /ts/i) 0 0 0
3766 #}
3767 }
3768 0 elsif ($varName =~ /\btsFrom\b/i) { $tsFrom = $varValue; $foundMatch = 1;}
3769 0 elsif ($varName =~ /\btsTo\b/i) { $tsTo = $varValue; $foundMatch = 1;}
3770 0 elsif ($varName =~ /\bmakeMark\b/i) { $makeMark = $varValue; $foundMatch = 1;}
3771 0 elsif ($varName =~ /\bexitTAFGracefullyString\b/i) { $exitTAFGracefullyString = $varValue; $foundMatch = 1;}
3772 0 elsif ($varName =~ /\bAutomationtsName\b/i) { $AutomationtsName= $varValue; $foundMatch = 1;}
3773 0 elsif ($varName =~ /\bresetTSFileName\b/i) { $resetTSFileName = $varValue; $foundMatch = 1;}
3774 0 elsif ($varName =~ /\bexitTAFTCId\b/i) { $exitTAFTCId = $varValue; $foundMatch = 1;}
3775 0 elsif ($varName =~ /\btcComment1\b/i) { $tcComment1 = $varValue; $foundMatch = 1;}
3776 0 elsif ($varName =~ /\btcComment2\b/i) { $tcComment2 = $varValue; $foundMatch = 1;}
3777 0 elsif ($varName =~ /\bexternalLogName\b/i) { $externalLogName= $varValue; $foundMatch = 1;}
3778 0 elsif ($varName =~ /\bexternalLogName\b/i) { $externalLogName= $varValue; $foundMatch = 1;}
3779 0 elsif ($varName =~ /\boutputFormat\b/i) { $outputFormat = $varValue; $foundMatch = 1;}
3780 0 elsif ($varName =~ /\bhtmlRefreshRate\b/i) { $htmlRefreshRate= $varValue; $foundMatch = 1;}
3781 0 elsif ($varName =~ /\bhtmlRefreshRateWebUI\b/i) { $htmlRefreshRateWebUI= $varValue; $foundMatch = 1;}
3782 0 elsif ($varName =~ /\bhtmlRefreshRateLogUI\b/i) { $htmlRefreshRateLogUI= $varValue; $foundMatch = 1;}
3783 0 elsif ($varName =~ /\bip\b/i) { $ip = $varValue; $foundMatch = 1;}
3784 0 elsif ($varName =~ /\boverWriteTC\b/i) { $overWriteTC = $varValue; $foundMatch = 1;}
3785 0 elsif ($varName =~ /\bTSHookIsPerl\b/i) { $TSHookIsPerl = $varValue; $foundMatch = 1;}
3786 0 elsif ($varName =~ /\bcreateOrAppendTS\b/i) { $createOrAppendTS=$varValue; $foundMatch = 1;}
3787 0 elsif ($varName =~ /\btitleStatus\b/i) { $titleStatus =$varValue; $foundMatch = 1;}
3788 0 elsif ($varName =~ /\bwebUITreeViewLevel\b/i) { $webUITreeViewLevel =$varValue; $foundMatch = 1;}
3789 0 elsif ($varName =~ /\bNofPropertyExec\b/i) { $NofPropertyExec =$varValue; $foundMatch = 1;}
3790 0 elsif ($varName =~ /\bNofTCinTSTemplate\b/i) { $NofTCinTSTemplate=$varValue; $foundMatch = 1;}
3791 0 elsif ($varName =~ /\btags\b/i) { $tags =$varValue; $foundMatch = 1;
3792 0 my $tmp = ""; foreach my $each (split (/_,_/, $tags)) { $tmp=$tmp."|".$each; } $tmp =~ s/\|_/_(/g; $tmp =~ s/_\s*$/)_/g; $tags = $tmp;
3793 }
3794 8 $url = 'file:///'.$SvrDrive; # will be updated in the sub-processTCs. Update derived Global Variable
3795 8 $urlHttp = 'http://'.$ip.$http_port; # will be updated in the sub-processTCs. Update derived Global Variable
3796 }
3797 # if (($SvrTCNamePattern =~ /\//) || ($SvrTCNamePattern =~ /\\/)) { print "Error: Testcase can't have directory structure\n"; exit; }
3798 6 $foundMatch;
3799 #### &printTAFGlobalVars(); todo Non-volatile GlobalVars
3800 #### Variable content verfication
3801 }
3802  
3803  
3804 sub runPowershell {
3805 0 ▶ my $cmd = shift; my $return; if ($cmd =~ /.ps1\s+/) { $cmd = "$cmd"; $return = `$cmd`;} else { $return = `$perl $cmd`; }
Subroutine runPowershell: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /.ps1\s+/) { } 0 0 0
3806 0 $return =~ s/&/&amp;/g; $return =~ s/\%/&#37;/g; $return =~ s/\$/&#36;/g;
3807 0 $return =~ s/\s+<\s+/ &lt; /g; $return =~ s/\s+>\s+/ &gt; /g; # improvement : handle < > in tcDesc
3808 0 $return =~ s/\s*\(\s*/ &#40;/g; $return =~ s/\s*\)\s*/ &#41;/g; # improvement : handle < > in tcDesc
3809 0 $return =~ s/\|/&#166;/g;
3810 0 ▶ if ($return =~ /^\s*$/) { $return = "Testsuite has no Testcase";} # bug fix on 2013/09/20
Branch: 1 branch
BranchTrueFalseTotal
if ($return =~ /^\s*$/) 0 0 0
3811 0 return $return;
3812 }
3813  
3814 sub generateIndex_pyAnvil_pl {
3815 0 ▶ my $cwd = $SvrProjName; my $cmd = $SvrProjName. "\/index.ps1";
Subroutine generateIndex_pyAnvil_pl: not called CC=1 SCAR=6.9
Pod undocumented
3816 0 open Fout, "> ".$cwd."/index_pyAnvil.pl";
3817 0 print Fout<<EOF_;
3818 ############################ index_pyAnvil.pl ###################################
3819 use strict;
3820 &execTC(\$ARGV[0]);
3821  
3822 sub execTC {
3823 my \$passFail='FAIL'; my \$logHtml; my \$logXml ;
3824 my \$pyAnvil= $c.'/pyAnvil/pyAnvil -s ' ;
3825 my \$tcDir = "$cwd\/" ;
3826 my \$testsuiteHook = "index.pl" ;
3827 my \$tcId = -1 ; \$tcId = shift if \@_;
3828 my \$tcDesc = "Testcase \$tcId Demo" ; \$tcDesc = shift if \@_;
3829 my \$tsDesc = "pyAnvil Testsuite Demo" ; \$tsDesc = shift if \@_;
3830  
3831 \$testsuiteHook = \$tcDir.\$testsuiteHook ;
3832 my \$tcScenario = "_tc.xml" ; \$tcScenario = \$tcDir."_tc.xml" ;
3833 my \$tcLog_pyAnvil = "_tcLogAppend_.txt" ; \$tcLog_pyAnvil = \$tcDir."\$tcLog_pyAnvil";
3834 if (\$tcId =~ /^\\s*\$/) { print `\$testsuiteHook`; return 0; }
3835 my \$str=<<EOF;
3836 <?xml version="1.0" encoding="utf-8"?>
3837 <XMLTestCollection>
3838 <TestList TestCases="\$tcDesc">
3839 <ToolCase>
3840 <Name>\$tcDesc</Name>
3841 <Executable>C:/strawberry/perl/bin/perl.exe</Executable>
3842 <Parameters>\$testsuiteHook \$tcId</Parameters>
3843 <StdoutContains>PASS</StdoutContains>
3844 </ToolCase>
3845 </TestList>
3846 </XMLTestCollection>
3847 EOF
3848 open Fout, ">\$tcScenario"; print Fout \$str; close Fout; my \$cmd = \$pyAnvil."\$tcScenario"; my \$rst = `\$cmd`;
3849 foreach my \$each (split /\n/, \$rst) {
3850 if ( \$each =~ /^\\s+PASS\\s+/) { \$passFail = "PASS";}
3851 elsif (\$each =~ /^\\s+FAIL\\s+/) { \$passFail = "FAIL";}
3852 elsif (\$each =~ /^\\s+XML:\\s+(.+)/) { \$logXml = \$1;}
3853 elsif (\$each =~ /^\\s+HTML:\\s+(.+)/){ \$logHtml = \$1;}
3854 }
3855 open Fout, "> \$tcLog_pyAnvil "; print Fout "\$rst\n"; close Fout; print "- > \$tcLog_pyAnvil\n";
3856 print "\$passFail\n";
3857 }
3858 ############################ index_pyAnvil.pl ###################################
3859 EOF_
3860 0 close Fout; print " -->".$cwd."/index_pyAnvil.pl\n";
3861  
3862 }
3863 sub generateExcelReport {
3864 0 ▶ my $key; my %listHistory; my %tcDesc; my @tcExecDateTime; my $tcExecDateTimeCtr=0; my $isPassFail = "n"; my $tsName= "MVSDK_OCSP"; my @columnWidth;
Subroutine generateExcelReport: not called CC=35 SCAR=71.4
Pod undocumented
3865 # bug: _tc_Desc.txt and _list_history_tcRunResult are not genreated - fixed by NofPropertyExecCtr = 0; !!!!!!
3866 0 my $rst = &processTCs ("","testsuite=$SvrProjName;AutomationtsName=$SvrProjName;pr2Screen=0;resetTSFileName=_list_history_tcRunResult.txt;resetTSFile;propertyOp=list_history_tcRunResult;pr2Screen=1");
3867 0 $NofPropertyExecCtr=0; $propertyOp="";
3868 0 $rst = &processTCs ("","testsuite=$SvrProjName;AutomationtsName=$SvrProjName;pr2Screen=0;resetTSFileName=_list_tcDesc.txt;resetTSFile;propertyOp=list_tcDesc;pr2Screen=1");
3869 0 $NofPropertyExecCtr=0; $propertyOp="";
3870 0 my $tcDescMax=40; my $tcIdMax=10;
3871 0 ▶ if ( -e "$SvrDrive/$SvrProjName/_list_tcDesc.txt") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$SvrDrive/$SvrProjName/_list_tcDesc.txt") { } 0 0 0
3872 ##### print " <- $SvrDrive/$SvrProjName/_list_tcDesc.txt\n";
3873 0 ▶ open Fin, "$SvrDrive/$SvrProjName/_list_tcDesc.txt" || die "Can't open file $!";
Condition0%0/2
"$SvrDrive/$SvrProjName/_list_tcDesc.txt" || die("Can't open file $!")
l!l
00
MC/DC0%0/1
"$SvrDrive/$SvrProjName/_list_tcDesc.txt" || die("Can't open file $!")
"$SvrDrive/$SvrProjName/_list_tcDesc.txt"
Truth table0%0/2
A
A= "$SvrDrive/$SvrProjName/_list_tcDesc.txt"
Aresult
11
00
3874 0 ▶ while( $_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
3875 0 chop;
3876 0 $_ =~ s/(list_)?tcDesc\s*=\s*(\d+\.)?//;
3877 0 ▶ if ($_ =~ /testcase\d+(_)?\s+/) { @_ = split (/\t/, $_);
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /testcase\d+(_)?\s+/) 0 0 0
3878 0 my $key = $_[0]; my $value = $_[1];
3879 0 ▶ if ($_ =~ /\/_/) {;} else { # exclude directory like /_
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ m[/_]) { } 0 0 0
3880 ## $value =~ s/_.+_//g; # remove property
3881 0 $value = &removeTags($value);
3882 }
3883 0 $tcDesc{$key} = $value;
3884 0 ▶ if (length($value) > $tcDescMax) { $tcDescMax = length ($value); }
Branch: 1 branch
BranchTrueFalseTotal
if (length $value > $tcDescMax) 0 0 0
3885 0 ▶ if (length($key) > $tcIdMax) { $tcIdMax = length ($key); }
Branch: 1 branch
BranchTrueFalseTotal
if (length $key > $tcIdMax) 0 0 0
3886 }
3887 }
3888 0 close Fin;
3889 0 } else { print "Info: $SvrDrive/$SvrProjName/_list_tcDesc.txt doesn't exist. Proceed ... (generateExcelReport won't work. Run -propertyOp=list_tcDesc)\n"; return 0 ;}
3890  
3891 0 $columnWidth[0]=$tcIdMax; $columnWidth[1]=$tcDescMax;
3892  
3893 0 ▶ if ( -e "$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt") { } 0 0 0
3894 #### print " <- $SvrDrive/$SvrProjName/_list_history_tcRunResult.txt\n";
3895 0 ▶ open Fin, "$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt" || die "Can't open file $!";
Condition0%0/2
"$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt" || die("Can't open file $!")
l!l
00
MC/DC0%0/1
"$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt" || die("Can't open file $!")
"$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt"
Truth table0%0/2
A
A= "$SvrDrive/$SvrProjName/_list_history_tcRunResult.txt"
Aresult
11
00
3896 0 ▶ while($_ = <Fin>) { chop; s/\s*=\s*/ /g;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
3897 0 ▶ if ($_ =~ /list_history_tcRunResult/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($_ =~ /list_history_tcRunResult/) { } 0 0 0
elsif ($_ =~ /tcRunResult/i) { } 0 0 0
3898 0 ▶ if ($_ =~ /list_history_tcRunResult/) { $tcExecDateTimeCtr ++ ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /list_history_tcRunResult/) 0 0 0
3899 0 @_ = split (/\s+/, $_);
3900 0 $_ =~ /(.+)\s+(.+)/;
3901 0 $key = $_[0]; my $value = $_[1];
3902 0 ▶ if ($_ =~ s/^.+list_history_tcRunResult//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ s/^.+list_history_tcRunResult//) 0 0 0
3903 0 my $passFail=""; my $date="";
3904 0 ▶ if ($_ =~ /tcRunResult\s*(\S+)\s+\@\s+(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d)/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcRunResult\s*(\S+)\s+\@\s+(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d)/) 0 0 0
3905 0 $passFail = $1; $date = $2; }
3906 0 ▶ if ($passFail =~ /pass|fail|\d+/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($passFail =~ /pass|fail|\d+/i) { } 0 0 0
3907 0 my $tmp = $listHistory{$key}; # remove the unreasable error - concat undefined variables
3908 0 ▶ if ($tmp) {;} else { $tmp="";}
Branch: 1 branch
BranchTrueFalseTotal
if ($tmp) { } 0 0 0
3909 0 $listHistory{$key} = $tmp."$passFail\t";
3910 0 $isPassFail = 'y';
3911 0 } else {$isPassFail = 'n'; }
3912 0 ▶ if (($isPassFail =~ /y/i) && ($tcExecDateTimeCtr == 1)) { push (@tcExecDateTime, $date) ;}
Branch: 1 branch
BranchTrueFalseTotal
if ($isPassFail =~ /y/i and $tcExecDateTimeCtr == 1) 0 0 0
Condition0%0/3
$isPassFail =~ /y/i and $tcExecDateTimeCtr == 1
!ll&&!rl&&r
000
MC/DC0%0/2
$isPassFail =~ /y/i and $tcExecDateTimeCtr == 1
$isPassFail =~ /y/i $tcExecDateTimeCtr == 1
Truth table0%0/3
A and B
A= $isPassFail =~ /y/iB= $tcExecDateTimeCtr == 1
ABresult
0X0
100
111
3913 ;
3914 }
3915 } elsif ($_ =~ /tcRunResult/i) {
3916 0 my $passFail = ""; my $date = "";
3917 #if ($_ =~ /tcRunResult\s*(\S+)\s+\@\s+(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d)/) {
3918 0 ▶ if ($_ =~ /tcRunResult\s*(\S+)\s+\@\s+(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d)/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /tcRunResult\s*(\S+)\s+\@\s+(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d:\d\d)/) 0 0 0
3919 0 $passFail = $1; $date = $2;
3920 }
3921 0 ▶ if ($passFail =~ /pass|fail|\d+/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($passFail =~ /pass|fail|\d+/i) { } 0 0 0
3922 0 my $tmp = $listHistory{$key}; # remove the unreasable error - concat undefined variables
3923 0 ▶ if ($tmp) {;} else { $tmp="";}
Branch: 1 branch
BranchTrueFalseTotal
if ($tmp) { } 0 0 0
3924 0 $listHistory{$key} = $tmp."$passFail\t";
3925 0 $isPassFail = 'y';
3926 0 } else {$isPassFail = 'n'; }
3927 0 ▶ if (($isPassFail =~ /y/i) && ($tcExecDateTimeCtr == 1)) { push (@tcExecDateTime, $date) ;
Branch: 1 branch
BranchTrueFalseTotal
if ($isPassFail =~ /y/i and $tcExecDateTimeCtr == 1) 0 0 0
Condition0%0/3
$isPassFail =~ /y/i and $tcExecDateTimeCtr == 1
!ll&&!rl&&r
000
MC/DC0%0/2
$isPassFail =~ /y/i and $tcExecDateTimeCtr == 1
$isPassFail =~ /y/i $tcExecDateTimeCtr == 1
Truth table0%0/3
A and B
A= $isPassFail =~ /y/iB= $tcExecDateTimeCtr == 1
ABresult
0X0
100
111
3928 }
3929 } else {
3930 ;
3931 }
3932 }
3933 0 close Fin;
3934 0 } else { print "Info: $SvrDrive/$SvrProjName/_list_history_tcRunResult.txt doesn't exist. Proceed ... (generateExcelReport won't work. Run propertyOp=list_history_tcRunResult)\n"; return 0 ;}
3935  
3936  
3937 0 open Fout, "> $SvrDrive/$SvrProjName/_generateExcelReport.txt";
3938 0 open Fout1, "> $SvrDrive/$SvrProjName/_generateExcelReport.html"; print Fout1 "<html><body><pre>\n";
3939 0 my $currentDate ="";
3940 0 ▶for (my $i = 0; $i <= $#tcExecDateTime; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#tcExecDateTime) 0 0 0
3941 0 $tcExecDateTime[$i] =~ /(\d\d\d\d-\d\d-\d\d)\s+(\d\d:\d\d:\d\d)/; my $date = $1; my $time = $2;
3942 0 ▶ if ($currentDate eq $date) {
Branch: 2 branches
BranchTrueFalseTotal
if ($currentDate eq $date) { } 0 0 0
elsif ($currentDate ne $date) { } 0 0 0
3943 0 $tcExecDateTime[$i] = $time; $columnWidth[$i+2] = length ($time); } elsif ($currentDate ne $date) { $currentDate = $date; $columnWidth[$i+2] = length ("$date $time"); }
3944 }
3945  
3946 0 printf Fout "Test Suite Name: $AutomationtsName\n";
3947 0 printf Fout1 "Test Suite Name: $AutomationtsName\n";
3948  
3949 0 ▶printf Fout "%-${tcIdMax}s\t%-${tcDescMax}s\t", "tcId", "Description"; for (my $i = 0; $i <= $#tcExecDateTime; $i++) { print Fout "($tcExecDateTime[$i])\t"; } print Fout "\n";
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#tcExecDateTime) 0 0 0
3950 0 ▶printf Fout1 "%-${tcIdMax}s %-${tcDescMax}s", "tcId", "Description"; for (my $i = 0; $i <= $#tcExecDateTime; $i++) { print Fout1 "($tcExecDateTime[$i])"; } print Fout1 "\n";
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#tcExecDateTime) 0 0 0
3951  
3952 0 foreach my $each (sort keys %listHistory) {
3953 0 my $each_ = $each;
3954 0 ▶ if ($tcDesc{$each}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcDesc{$each}) { } 0 0 0
3955 0 printf Fout "%-$columnWidth[0]s\t%-$columnWidth[1]s\t", $each_, $tcDesc{$each};
3956 0 printf Fout1 "%-$columnWidth[0]s %-$columnWidth[1]s ", $each_, $tcDesc{$each};
3957 } else { # for Test-AutomationFramework.t
3958 0 printf Fout "%-$columnWidth[0]s\t%-$columnWidth[1]s\t", $each_, "";
3959 0 printf Fout1 "%-$columnWidth[0]s %-$columnWidth[1]s ", $each_, "";
3960 }
3961  
3962 0 my @fields = split (/\t/, $listHistory{$each});
3963 0 ▶ for (my $i=0; $i <= $#fields; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#fields) 0 0 0
3964 0 my $tmp;
3965 0 ▶ if ($columnWidth[$i + 2]) {;} else { $columnWidth[$i+2] = 10;}
Branch: 1 branch
BranchTrueFalseTotal
if ($columnWidth[$i + 2]) { } 0 0 0
3966 0 $tmp = $columnWidth[$i + 2] + 1;
3967 0 ▶ if ($tmp) {;} else { $tmp = $excelReportColumnWidth;}
Branch: 1 branch
BranchTrueFalseTotal
if ($tmp) { } 0 0 0
3968 0 printf Fout "%-${tmp}s\t", $fields[$i];
3969 0 printf Fout1 "%-${tmp}s ", $fields[$i];
3970 }
3971 0 print Fout "\n";
3972 0 print Fout1 "\n";
3973 }
3974  
3975 0 close Fout;
3976 0 print Fout1 "</pre></body></html>\n";
3977 0 close Fout1;
3978 #### uncomment for debugging print " -> $SvrDrive/$SvrProjName/_generateExcelReport.html\n";
3979 0 1;
3980 }
3981  
3982 sub generateIndex_pl {
3983 0 ▶ my $cwd = $workingDir; $cwd = shift if @_;
Subroutine generateIndex_pl: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3984 0 open Fout, "> ".$cwd."/index.pl";
3985 0 my $ps1_args_ = $ps1_args;
3986 0 $ps1_args_ =~ s/\\/\//g;
3987  
3988 0 print Fout<<EOF_;
3989  
3990 ##################### index.pl for pyAnvil ############################
3991  
3992 my \$testsuiteHook = "powershell -executionpolicy unrestricted -file $cwd/index.ps1 ";
3993 my \$testsuiteHookPartB = " \$ps1_args_";
3994  
3995  
3996 if (\$ARGV[1]) { print &call_index(\$ARGV[0], "noExec") ; }
3997 elsif (\$ARGV[0]) { print &call_index(\$ARGV[0], "yesExec"); }
3998 else { print &call_index(); }
3999  
4000  
4001 sub call_index { my \$return ; my \$recordCtr=1;
4002 if (\@_) {;} else {; return `\$testsuiteHook \$testsuiteHookParkB`;}
4003 my \$indexCtr = 9999 ; \$indexCtr = shift if \@_;
4004 my \$execYN = 'noExec' ; \$execYN = shift if \@_;
4005 \@_ = (split /\\n/, `\$testsuiteHook`) ;
4006  
4007  
4008 foreach \$each (\@_) {
4009 if ((\$each) && (\$each =~ /^\\s*_/)) { \$return = \$return .\$each."\n";
4010 } elsif ((\$each) && (\$each !~ /^\\s*_/)) {
4011 \$return = \$return . sprintf "TC [%04s] %s\\n",\$recordCtr,\$each;
4012 if ((\$recordCtr == \$indexCtr ) && ( \$execYN =~ /noExec/i )) { return "TC [\$recordCtr] \$each"; }
4013 if ((\$recordCtr == \$indexCtr ) && ( \$execYN =~ /yesExec/i)) { return `\$testsuiteHook \$indexCtr \$testsuiteHookPartB` ; }
4014 \$recordCtr++;
4015 }
4016 }
4017 if (\$return =~ /pass/i) { return 0;}
4018 if (\$return =~ /fail/i) { return 1;}
4019 }
4020  
4021 ##################### index.pl for pyAnvil ############################
4022 EOF_
4023 0 close Fout; print " -->".$cwd."/index.pl\n";
4024  
4025  
4026 }
4027  
4028 sub generatePerl_pl_template {
4029 0 ▶ my $cmd = $SvrProjName;
Subroutine generatePerl_pl_template: not called CC=2 SCAR=17.9
Pod undocumented
4030 0 ▶ if (-e $cmd) {;} else { mkdir $cmd; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e $cmd) { } 0 0 0
4031 0 mkpath $cmd;
4032 0 open Fout, "> $cmd/index.pl";
4033 0 my $tsNameTmp = &getRoot($cmd);
4034 0 print Fout<<EOF_;
4035 #!$perl_
4036 \$tcName = "$tsNameTmp";
4037 if (\$^O =~ /win32/i) { \$_TAF = "$c"; } if (\$^O =~ /linux/i) { \$_TAF = "/tmp/var/www/cgi-bin"; }
4038 \$tcDir = "\$_TAF/\$tcName";
4039  
4040  
4041 if (\$ARGV[0]) {
4042 open Fout, ">\$tcDir/_tcLogAppend.txt";
4043 if (\$ARGV[0] == 1) { print "pass"; } # <<< plug in the test case 1 here e.g. print `index.pl 1` ; >>>
4044 if (\$ARGV[0] == 2) { print "pass"; } # <<< plug in the test case 2 here e.g. print `index.pl 2`>>>
4045 if (\$ARGV[0] == 3) { print "pass"; } # <<< plug in the test case 3 here e.g. print `index.pl 3`>>>
4046 if (\$ARGV[0] == 4) { print "pass"; } # <<< plug in the test case 4 here e.g. print `index.pl 4`>>>
4047 if (\$ARGV[0] == 5) { print "pass"; } # <<< plug in the test case 5 here e.g. print `index.pl 5`>>>
4048 if (\$ARGV[0] == 6) { print "pass"; } # <<< plug in the test case 6 here e.g. print `index.pl 6`>>>
4049 close Fout;
4050 } else {
4051 print \<\<EOF;
4052 1. Test case description 1 for | | < > \\\$ \\\% @ testing the function 1 --- Please modifyaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa _smoke_ _regression_
4053 2. Test case description 2 for testing _smoketest__regressiontest_the function 2 --- Please modifybbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb _smoke_
4054 3. Test case description 3 for testing _smoketest_the function 3 --- Please modifycddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd _regression_
4055 4. Test case description 4 for testing _regressiontest_the function 4 --- Please modify _smoke_
4056 5. Test case description 5 for testing _regressiontest_the function 5 --- Please modify
4057 6. Test case description 6 for testing the function 6 --- Please modify
4058 EOF
4059 ;
4060 }
4061  
4062 EOF_
4063 0 close Fout;
4064 0 print "\n[Warning] Creating Temporial testsuite hook --> [".$SvrProjName."/index.pl]\n"; ;
4065 }
4066  
4067 sub generatePowershell_ps1_template {
4068 0 ▶ my $cmd = $SvrProjName;
Subroutine generatePowershell_ps1_template: not called CC=1 SCAR=6.9
Pod undocumented
4069 0 open Fout, "> $cmd/index.ps1";
4070 0 my $tsNameTmp = &getRoot($cmd);
4071 0 my $tmpWorkingDir = $tsNameTmp; $tmpWorkingDir =~ s/\\/\//g;
4072 0 print Fout<<EOF_;
4073  
4074 ###########################
4075 param([INT]\$index = "-1", \$buildpath="")
4076  
4077 if(\$verbose -eq \$true) { cls }
4078  
4079 \$subHtml = "/auto_html/LBP_automation.html"
4080 \$index = \$index -1
4081 ######################################################################################
4082 # Dictionary for pre-canned test scenarios.
4083 ######################################################################################
4084 \$testDictionary = \@()
4085  
4086 \$testDictionary += \@( `
4087 \@{ "desc" = "Testcase1 description $SvrProjName";
4088 "result" = "PASS";
4089 } `
4090 )
4091 \$testDictionary += \@( `
4092 \@{ "desc" = "Testcase2 description $SvrProjName _smoketest_ _regression_ _regressiontest_";
4093 "result" = "FAIL";
4094 } `
4095 )
4096 \$testDictionary += \@( `
4097 \@{ "desc" = "Testcase3 Description $SvrProjName _smoketest_ _regression";
4098 "result" = "FAIL"; `
4099 } `
4100 )
4101 \$testDictionary += \@( `
4102 \@{ "desc" = "Testcase4 Description $SvrProjName _smoketest_"; `
4103 "result" = "PASS"; `
4104 } `
4105 )
4106  
4107  
4108 ################################################################################################
4109  
4110 \$idx = [Int32]::Parse(\$index)
4111 \$testDictionaryCount = \$testDictionary.length - 1
4112 \$count = 1
4113 if((\$idx -lt 0) -or (\$idx -gt \$testDictionaryCount))
4114 {
4115 foreach(\$dictionaryDesc in \$testDictionary)
4116 {
4117 Write-Host "\$count :"\$dictionaryDesc.desc
4118 \$count++
4119 }
4120 exit
4121 }
4122  
4123 write-host \$testDictionary[\$idx].result;
4124  
4125  
4126  
4127 ###########################
4128  
4129 EOF_
4130 0 close Fout;
4131 0 print "\n[Warning] Creating Temporial testsuite hook --> [".$SvrProjName."/index.ps1]\n"; ;
4132 }
4133  
4134 0 ▶sub eraseTAFTestsuite {goto &deleteTAFTestsuite}
Subroutine eraseTAFTestsuite: not called CC=1 SCAR=6.9
Pod undocumented
4135  
4136  
4137 sub deleteTAFTestsuite {
4138 0 ▶ my $c_ = $c; my $_TAF_ = $_TAF; my $SvrProjName_ = $SvrProjName;
Subroutine deleteTAFTestsuite: not called CC=5 SCAR=34.0
Pod undocumented
4139 0 ▶ if (($SvrProjName_ =~ /^$c_/ ) || ($^O =~ /linux/i)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($SvrProjName_ =~ /^$c_/ or $^O =~ /linux/i) { } 0 0 0
Condition0%0/3
$SvrProjName_ =~ /^$c_/ or $^O =~ /linux/i
l!l&&r!l&&!r
000
MC/DC0%0/2
$SvrProjName_ =~ /^$c_/ or $^O =~ /linux/i
$SvrProjName_ =~ /^$c_/ $^O =~ /linux/i
Truth table0%0/3
A or B
A= $SvrProjName_ =~ /^$c_/B= $^O =~ /linux/i
ABresult
1X1
011
000
4140 0 ▶ if ($^O =~ /win/i) { $SvrProjName_ =~ s/^$c//;}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win/i) 0 0 0
4141 0 my $TSDir = "$c/$_TAF/$SvrProjName_"; $TSDir =~ s/\/\//\//g;
4142 0 ▶ if ( -e $TSDir ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $TSDir) { } 0 0 0
4143 0 unlink glob "$TSDir/index*.*";
4144 0 unlink glob "$TSDir/_*";
4145 # rmtree $TSDir;
4146 0 print "Delete TAF Testsuite $TSDir\n";
4147 0 &generateRootIndex();
4148 # &refreshHost();
4149 } else {
4150 0 print "Warning: TAF Testsuite $c_/${_TAF}$SvrProjName_ doesn't exist!\n";
4151 }
4152 } else {
4153 0 print "\nWarning: $SvrProjName_ is NOT a TAF testsuite. \n($SvrProjName_ !~ $c_)\n\n";
4154 }
4155 }
4156  
4157 ########### index2index
4158  
4159 sub index2index { #### Generate subIndex from TAF-generate-index.pl # input $tcDir, $matchStr
4160 0 ▶ my $tcDir = $SvrProjName;
Subroutine index2index: not called CC=14 SCAR=53.5
Pod undocumented
4161 0 ▶ my $matchStr = "2013.09.13"; $matchStr = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
4162 0 my @tcExec_; my @tcDesc_; my $is_tcDesc="n"; my %tcDesc_; my %tcExec_;
4163 0 ▶ if (-e "$tcDir/index.pl") {;} else {print "Warning: There is no $tcDir/index.pl. taf.pl exits\n"; exit; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcDir/index.pl") { } 0 0 0
4164 0 open Fin, "$tcDir/index.pl"; my @index = <Fin>; close Fin;
4165 0 foreach my $each (@index) {
4166 0 ▶ if ($each =~ /ARGV\[0\]\s*==/) { push (@tcExec_, $each); }
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /ARGV\[0\]\s*==/) 0 0 0
4167 0 ▶ if ($each =~ /print\s*<<EOF;/) { $is_tcDesc = 'y'; }
Branch: 3 branches
BranchTrueFalseTotal
if ($each =~ /print\s*<<EOF;/) { } 0 0 0
elsif ($each =~ /^EOF\b/) { } 0 0 0
elsif ($is_tcDesc =~ /y/i) { } 0 0 0
4168 0 elsif ($each =~ /^EOF\b/) { $is_tcDesc = 'n'; }
4169 0 elsif ($is_tcDesc =~ /y/i) { chop $each;
4170 0 push (@tcDesc_, $each);}
4171 }
4172  
4173 0 my $ctrctr=1;
4174 0 print " -> $tcDir/_tcMap.txt\n";
4175 0 ▶ if ( -e "$tcDir/_tcMap.txt" ) { open Foutmap, ">> $tcDir/_tcMap.txt"; } else { open Foutmap, "> $tcDir/_tcMap.txt"; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcDir/_tcMap.txt") { } 0 0 0
4176 #for (my $i = 1; $i <= $#tcDesc_+1; $i++ ) {
4177 0 ▶ for (my $i = 0; $i <= $#tcDesc_; $i++ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#tcDesc_) 0 0 0
4178 # print "pa:b $i, $tcDesc_[$i], $matchStr\n";
4179 0 ▶ if ($tcDesc_[$i] =~ /$matchStr/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tcDesc_[$i] =~ /$matchStr/i) { } 0 0 0
4180 0 my $tmp = $tcDir;
4181 # $tmp =~ s/$c/$c\/$_TAF/;
4182 0 printf Foutmap "$tmp/testcase%04d => $tmp/$matchStr/testcase%04d\n", $i+1, $ctrctr; $ctrctr++;
4183 0 $tcDesc_{$i} = $tcDesc_[$i];
4184 0 $tcExec_{$i} = $tcExec_[$i];
4185 } else {
4186 0 my $tmp = $tcDir;
4187 #$tmp =~ s/$c/$c\/$_TAF/;
4188 0 printf Foutmap "$tmp/testcase%04d => $tmp/testcase%04d\n", $i+1, $i+1;
4189  
4190 }
4191 }
4192 0 close Foutmap;
4193  
4194 0 ▶if (-e "$tcDir/$matchStr") {;} else { mkpath ("$tcDir/$matchStr"); print " -dir-> $tcDir/$matchStr\n";} #### create new TS dir
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$tcDir/$matchStr") { } 0 0 0
4195  
4196 0 open INDEX , ">$tcDir/$matchStr/index.pl";
4197 0 print INDEX <<EOF;
4198 #!/usr/bin/perl.exe
4199 \$tcName = "subTestsuit";
4200 if (\$^O =~ /win32/i) { \$_TAF = "c:"; } if (\$^O =~ /linux/i) { \$_TAF = "/tmp/var/www/cgi-bin"; }
4201 \$tcDir = "\$_TAF/\$tcName";
4202  
4203 if (\$ARGV[0]) {
4204 open Fout, ">\$tcDir/$matchStr/_tcLogAppend.txt";
4205 EOF
4206 0 my $ctr = 1;
4207 0 foreach my $each ( sort keys %tcExec_) {
4208 0 my $tmp = $tcExec_{$each};
4209 0 $tmp =~ s/==\s*(\d+)\s*\)/== $ctr )/; $ctr++;
4210 0 print INDEX $tmp;
4211 # print INDEX $tcExec_{$each};
4212 }
4213 0 print INDEX <<EOF;
4214 close Fout;
4215 } else {
4216 EOF
4217 0 print INDEX "\nprint<<EOF;\n";
4218 0 $ctr = 1;
4219 0 foreach my $each (sort keys %tcDesc_) { print INDEX $ctr++.". $tcDesc_{$each}\n"; }
4220  
4221 0 print INDEX "EOF\n}\n";
4222  
4223 0 close INDEX;
4224 0 print " -> $tcDir/$matchStr/index.pl\n";
4225 }
4226  
4227 ########### index2index
4228  
4229  
4230 0 ▶sub generateTAFTestsuite {goto &generateTestsuite}
Subroutine generateTAFTestsuite: not called CC=1 SCAR=6.9
Pod undocumented
4231 sub generateTestsuite { # Generating 1. index.pl 2. index.pl + index_pyAnvil.pl
4232 0 ▶ $performanceMode = "fast4cmd"; # fast4cmd
Subroutine generateTestsuite: not called CC=52 SCAR=79.2
Pod undocumented
4233 0 ▶ my $cmd = $SvrProjName ; $cmd = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
4234 #if ($cmd !~ /:/) { $cmd = $c.'/'.$_TAF.'/'.$cmd; } linux
4235 # This is a logic for window system (c:) if testsuite !~ c:\, it is a TAF TS under c:\_TAF\....
4236  
4237 0 ▶ if ($SvrProjNameSub !~ /^\s*$/) { &index2index($SvrProjNameSub); exit;}
Branch: 1 branch
BranchTrueFalseTotal
unless ($SvrProjNameSub =~ /^\s*$/) 0 0 0
4238
4239  
4240 0 ▶ if ( $^O =~ /win32/i ) { # window only logic
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 0 0
4241 0 ▶ if ($cmd !~ /$c\//i) { $cmd = $c.'/'.$_TAF.'/'.$cmd; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($cmd =~ m[$c/]i) 0 0 0
4242 }
4243  
4244 0 $cmd =~ s/\/\//\//g; # Fix the // problem in the linux coding
4245  
4246 0 my $cwd = $cmd;
4247  
4248 0 ▶ if ( -e $cwd) {;} else { mkpath $cwd; #### bug fix
Branch: 1 branch
BranchTrueFalseTotal
if (-e $cwd) { } 0 0 0
4249 0 ▶ if ($tsDriver =~ /null/i) { $tsDriver = "$cmd\/index.pl"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tsDriver =~ /null/i) 0 0 0
4250 0 &generatePerl_pl_template();
4251 }
4252 0 ▶ if (-e "$cmd\/index.ps1") { $cmd = $cmd . "\/index.ps1"; #### pre-existing testsuiteHook is index.ps1
Branch: 2 branches
BranchTrueFalseTotal
if (-e "$cmd/index.ps1") { } 0 0 0
elsif (-e "$cmd/index.pl") { } 0 0 0
4253 0 &generateIndex_pl ($cwd) ; # --> generate index.pl
4254 0 $cmd =~ s/index.ps1/index.pl/;
4255 }
4256 elsif (-e "$cmd\/index.pl") {
4257 0 $cmd = $cmd . "\/index.pl";} #### pre-existing testsuiteHook is index.pl
4258 else { #### No pre-existing index.pl
4259 0 ▶ if ($tsDriver =~ /null/i) { $tsDriver = "$cmd\/index.pl"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tsDriver =~ /null/i) 0 0 0
4260 0 &generatePerl_pl_template();
4261 }
4262 ############################################## subroutine Main ###########################################
4263 0 ▶ $cmd = shift if @_; my $testsuiteName="_default_testsuiteblas_"; my $testsuitePropertyFName='tsProperty.txt'; my $testDriverName = $cmd;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
4264 0 my $tsPropertyStr = "web_ui_title: "; my $tcCtr=1; my $TAF= $SvrDrive ;
4265 0 $testsuiteName = &getRoot_4($cwd); ############ $testsuiteName = &getRoot(&getcwd());
4266 0 ▶if ($^O =~ /win32/i) { $testsuiteName =~ s/^\s*$_TAF//g; }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 0 0
4267 0 ▶ if (($TSHookIsPerl =~ /y/i) && ($cmd =~ /index\.ps1\s*$/)) { $cmd =~ s/index\.ps1\s*$/index\.pl /g;}
Branch: 1 branch
BranchTrueFalseTotal
if ($TSHookIsPerl =~ /y/i and $cmd =~ /index\.ps1\s*$/) 0 0 0
Condition0%0/3
$TSHookIsPerl =~ /y/i and $cmd =~ /index\.ps1\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
$TSHookIsPerl =~ /y/i and $cmd =~ /index\.ps1\s*$/
$TSHookIsPerl =~ /y/i $cmd =~ /index\.ps1\s*$/
Truth table0%0/3
A and B
A= $TSHookIsPerl =~ /y/iB= $cmd =~ /index\.ps1\s*$/
ABresult
0X0
100
111
4268  
4269 ############ Generate Property file for webUI tc description
4270 0 ▶ if ($ps1_args =~ /^\s*$/) { $ps1_args = "-ps1_args powershell_args";}
Branch: 1 branch
BranchTrueFalseTotal
if ($ps1_args =~ /^\s*$/) 0 0 0
4271 0 ▶ if ($cmd =~ /\.ps1\s*$/) { $cmd = "powershell -executionpolicy unrestricted -file ". $cmd. " $ps1_args"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /\.ps1\s*$/) 0 0 0
4272  
4273 0 foreach my $each (split "\n", &runPowershell($cmd)) { # get testsuiteName _testsuitename_: (\w+)and _testdrivername_: (\w+)
4274 0 ▶ if ($each =~ /_testsuitename_/i) { $each =~ /_testsuitename_\s*:\s*(.+)\s*$/i; $testsuiteName = $1; if ($testsuiteName =~ /\s/) { print "white space in testsuitename\n";exit; }}
Branch: 3 branches
BranchTrueFalseTotal
if ($each =~ /_testsuitename_/i) { } 0 0 0
elsif ($each =~ /_testdrivername_/i) { } 0 0 0
if ($testsuiteName =~ /\s/) 0 0 0
4275 0 elsif ($each =~ /_testdrivername_/i) { $each =~ /_testdrivername_\s*:\s*(.+)\s*$/i; $testDriverName = $1; }
4276 else { ; }
4277 }
4278 #### <--$cmd _testsuitename_ : [$testsuiteName]
4279 #### <--$cmd _testdrivername_: [$testDriverName]
4280 0 $testsuiteName =~ s/^\///g; # linux
4281 0 print<<EOF;
4282 <--$cmd
4283 --> $c/$_TAF/$testsuiteName ...... (Can take several minutes)
4284 EOF
4285  
4286 0 ▶ if ($web_ui_title =~ /Test Automation Framework/) {$tcCtr=1; $tsPropertyStr = $tsPropertyStr . " $testsuiteName : web_ui_title\n";} # overwrite web_ui_title
Branch: 1 branch
BranchTrueFalseTotal
if ($web_ui_title =~ /Test Automation Framework/) { } 0 0 0
4287 0 else {$tcCtr=1; $tsPropertyStr = $tsPropertyStr . " $web_ui_title: web_ui_title\n";}
4288  
4289 0 foreach my $each (split "\n", &runPowershell($cmd)) { # get testsuitePropertyString
4290 0 ▶ if ($each =~ /_testsuitename_/i) { $each =~ /testsuitename_\s*:\s*(.+)\s*$/i; $testsuiteName = $1; }
Branch: 4 branches
BranchTrueFalseTotal
if ($each =~ /_testsuitename_/i) { } 0 0 0
elsif ($each =~ /_testdrivername_/i) { } 0 0 0
elsif ($each =~ /^\s*\n/i) { } 0 0 0
elsif ($each =~ /^\s*$/i) { } 0 0 0
4291 0 elsif ($each =~ /_testdrivername_/i) { $each =~ /testdrivername_\s*:\s*(.+)\s*$/i; $testDriverName = $1; }
4292 elsif ($each =~ /^\s*\n/i) { ; }
4293 elsif ($each =~ /^\s*$/i) { ; }
4294 else {
4295 0 ▶ if ($each =~ /^\s*\d/) { #### Fix duplicated serial # problem - double serial # problem
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /^\s*\d/) { } 0 0 0
4296 0 $tsPropertyStr = $tsPropertyStr . sprintf "$c/$_TAF\/$testsuiteName\/testcase%04d\|%s\n", $tcCtr, $each; $tcCtr++;
4297 } else {
4298 0 $tsPropertyStr = $tsPropertyStr . sprintf "$c/$_TAF\/$testsuiteName\/testcase%04d\|%4d %s\n", $tcCtr, $tcCtr, $each; $tcCtr++;
4299 }
4300 }
4301 }
4302 ############ Generate Property file for webUI tc description
4303  
4304 ############ add tcDesc Property #############
4305  
4306 0 my $tcCtr_ = 0;
4307 0 foreach my $each (split "\n", &runPowershell($cmd)) { # get testsuitePropertyString
4308 0 ▶ if ($each =~ /_testsuitename_/i) { $each =~ /testsuitename_\s*:\s*(.+)\s*$/i; $testsuiteName = $1; }
Branch: 4 branches
BranchTrueFalseTotal
if ($each =~ /_testsuitename_/i) { } 0 0 0
elsif ($each =~ /_testdrivername_/i) { } 0 0 0
elsif ($each =~ /^\s*\n/i) { } 0 0 0
elsif ($each =~ /^\s*$/i) { } 0 0 0
4309 0 elsif ($each =~ /_testdrivername_/i) { $each =~ /testdrivername_\s*:\s*(.+)\s*$/i; $testDriverName = $1; }
4310 elsif ($each =~ /^\s*\n/i) { ; }
4311 elsif ($each =~ /^\s*$/i) { ; }
4312 else {
4313 0 $each =~ s/\s/_space_/g;
4314 0 $each =~ s/:/_column_/g;
4315 0 $each =~ s/=/_eq_/g;
4316 0 $tcDesc[$tcCtr_] = $each ; $tcCtr_ ++;
4317 0 $propertyOp = "tcDescAuto";
4318 }
4319 }
4320 ############ add tcDesc Property #############
4321 ############ Generate Tags Property ################
4322  
4323 0 my @tcDescPropertyList; my $ctr=0; my $maxPropertyNameLength=1; my %propertyList;
4324  
4325 0 foreach my $each (split "\n", &runPowershell($cmd)) { # get testsuitePropertyString
4326 0 $each =~ s/__/_ _/g; @_ = ($each =~ /_\w+_/gi ) ;
4327 0 ▶ for (my $i=0; $i <= $#_;$i++) { $propertyList{$_[$i]}=$_[$i];
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#_) 0 0 0
4328 0 ▶ if ($maxPropertyNameLength < length($propertyList{$_[$i]})) { $maxPropertyNameLength = length($propertyList{$_[$i]}); }
Branch: 1 branch
BranchTrueFalseTotal
if ($maxPropertyNameLength < length $propertyList{$_[$i]}) 0 0 0
4329 }
4330 }
4331 ############ Generate Tags Property ################
4332  
4333 ############ Create Testsuite/Testcase
4334 0 $tcCtr=1;
4335 0 foreach my $each (split "\n", &runPowershell($cmd)) { # get testsuitePropertyString
4336 0 ▶ if ($each =~ /_testsuitename_/i) { $each =~ /testsuitename_\s*:\s*(.+)\s*$/i; $testsuiteName = $1; }
Branch: 4 branches
BranchTrueFalseTotal
if ($each =~ /_testsuitename_/i) { } 0 0 0
elsif ($each =~ /_testdrivername_/i) { } 0 0 0
elsif ($each =~ /^\s*\n/i) { } 0 0 0
elsif ($each =~ /^\s*$/i) { } 0 0 0
4337 0 elsif ($each =~ /_testdrivername_/i) { $each =~ /testdrivername_\s*:\s*(.+)\s*$/i; $testDriverName = $1; }
4338 elsif ($each =~ /^\s*\n/i) { ; }
4339 elsif ($each =~ /^\s*$/i) { ; }
4340 else {
4341 0 ▶ if ($tsDriver !~ /null/) { $testDriverName = $tsDriver; } # tsDriver overwrite testDriverName
Branch: 1 branch
BranchTrueFalseTotal
unless ($tsDriver =~ /null/) 0 0 0
4342 #### todo: need to decide to generate pl or ps1
4343
4344 0 my $ps1_args_; my $cmd_;
4345 0 ▶ if ( $cmd =~ /index\.ps1\s*$/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($cmd =~ /index\.ps1\s*$/) { } 0 0 0
elsif ($cmd =~ /index\.pl\s*$/) { } 0 0 0
4346 0 $ps1_args_ = $ps1_args; $ps1_args_ =~ s/ /___/g; $ps1_args_ =~ s/\\/\//g; # ps1_args
4347 0 $cmd_ = sprintf "ps1_args=$ps1_args_;testsuite=$testsuiteName;create=testcase%04d/customTC:${testDriverName}_space_${tcCtr}:customTC\n", $tcCtr ;
4348 } elsif ( $cmd =~ /index\.pl\s*$/) {
4349 0 $cmd_ = sprintf "testsuite=$testsuiteName;create=testcase%04d/customTC:${testDriverName}_space_${tcCtr}:customTC\n", $tcCtr ;
4350 }
4351  
4352 0 &processTCs("",$cmd_);
4353 0 my $tcnameTmp = sprintf "$c/$_TAF/$testsuiteName/testcase%04d", $tcCtr++;
4354 0 my $propertyTmp = $each;
4355 0 $propertyTmp =~ s/ /_space_/g;
4356 0 $propertyTmp =~ s/:/_column_/g;
4357 0 $propertyTmp =~ s/=/_eq_/g;
4358 0 $propertyTmp =~ s/ /__/g;
4359 0 &processProperty("",$tcnameTmp, "set_tcDesc_as_$propertyTmp");
4360 0 ▶ foreach $each (split (",", $tags)) { if ($propertyTmp =~ /$each/i) { &processProperty("",$tcnameTmp, "_add_${each}_as_y"); } }
Branch: 1 branch
BranchTrueFalseTotal
if ($propertyTmp =~ /$each/i) 0 0 0
4361  
4362 0 $propertyTmp=""; #### reuse the variable
4363 0 foreach my $propertyName (sort keys %propertyList) {
4364 0 ▶ if ($each=~ /\b$propertyName\b/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($each =~ /\b$propertyName\b/i) { } 0 0 0
4365 0 $propertyTmp = sprintf "$propertyTmp%-${maxPropertyNameLength}s",$propertyName;
4366 } else {
4367 0 $propertyTmp = sprintf "$propertyTmp%-${maxPropertyNameLength}s","_null_";
4368 }
4369 }
4370 0 $propertyTmp =~ s/ /_space_/g;
4371 0 $propertyTmp =~ s/:/_column_/g;
4372 0 $propertyTmp =~ s/=/_eq_/g;
4373 0 $propertyTmp =~ s/ /__/g;
4374 0 &processProperty("",$tcnameTmp, "set_tcTags_as_$propertyTmp");
4375 }
4376 }
4377  
4378 0 $tcCtr = 1;
4379 ############ Create Testsuite/Testcase
4380 0 ▶ open Fout, ">>$c/$_TAF/$testsuiteName/$testsuitePropertyFName" || die "Can't create file\n"; print Fout $tsPropertyStr; close Fout;
Condition0%0/2
">>$c/$_TAF/$testsuiteName/$testsuitePropertyFName" || die("Can't create file\n")
l!l
00
MC/DC0%0/1
">>$c/$_TAF/$testsuiteName/$testsuitePropertyFName" || die("Can't create file\n")
">>$c/$_TAF/$testsuiteName/$testsuitePropertyFName"
Truth table0%0/2
A
A= ">>$c/$_TAF/$testsuiteName/$testsuitePropertyFName"
Aresult
11
00
4381 0 print " -->$c/$_TAF/$testsuiteName/$testsuitePropertyFName\n";
4382 # &generateGenerateTestsuite();
4383 #### print " -->$c/$_TAF/$testsuiteName/generateTestsuite.pl\n";
4384  
4385 0 ▶ if ( -e "$c/$testsuiteName/_tcMap.txt" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$testsuiteName/_tcMap.txt") 0 0 0
4386 0 open Fin2, "$c/$testsuiteName/_tcMap.txt" ;
4387 0 open Fout2, ">$c/$_TAF/$testsuiteName/_tcMap.txt";
4388 0 ▶ while ($_=<Fin2>) { $_ =~ s/$c/$c\/$_TAF/ig; print Fout2 $_; }
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin2)) 0 0 0
4389 0 close Fout2;
4390 0 close Fin2;
4391 0 print " -->$c/$_TAF/$testsuiteName/_tcMap.txt\n";
4392 }
4393 0 $testsuiteName = $testsuiteName;
4394 0 ▶ if ($testcaseNode =~ /^\s*$/) { $testcaseNode = "_null_"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($testcaseNode =~ /^\s*$/) 0 0 0
4395 #$cmd = sprintf "$c/$_TAF/taf.pl tcDelay=0;performanceMode=fast;testcaseNode=$testcaseNode;testsuite=$testsuiteName;list";
4396 #print "\nlist: todo> $cmd\n". `$cmd`;
4397 #### !!!!!!!!!! the processTCs works !!!!!!!!!!!!!!!
4398 #### updateTS in stead of recreate TS $cmd = sprintf "tcDelay=0;testcaseNode=$testcaseNode;testsuite=$testsuiteName;list"; &processTCs("",$cmd); # todo
4399 0 $cmd = sprintf "tcDelay=0;testcaseNode=$testcaseNode;testsuite=$testsuiteName;mark"; &processTCs("",$cmd); # todo
4400 0 &generateRootIndex();
4401 0 ▶ if ($interact =~ /\by\b/) {system ("C:/Program Files/Internet Explorer/iexplore.exe", "$c/$_TAF/$testsuiteName/index.htm");}
Branch: 1 branch
BranchTrueFalseTotal
if ($interact =~ /\by\b/) 0 0 0
4402  
4403 0 print "\n";
4404 0 1;
4405 }
4406  
4407  
4408 sub generateTAFChildTestsuites { # Generating 1. index.pl 2. index.pl + index_pyAnvil.pl
4409 0 ▶ my $cmd = $SvrProjName ; $cmd = shift if @_;
Subroutine generateTAFChildTestsuites: not called CC=12 SCAR=50.5
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
4410 0 ▶ if ($cmd !~ /:/) { $cmd = $c.'/'.$_TAF.'/'.$cmd; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($cmd =~ /:/) 0 0 0
4411 0 my $cwd = $cmd; my $testsuiteName = &getRoot_4($cwd); ############ $testsuiteName = &getRoot(&getcwd());
4412 0 ▶ if (-e "$cmd\/index.ps1") { $cmd = $cmd . "\/index.ps1"; #### pre-existing testsuiteHook is index.ps1
Branch: 2 branches
BranchTrueFalseTotal
if (-e "$cmd/index.ps1") { } 0 0 0
elsif (-e "$cmd/index.pl") { } 0 0 0
4413 }
4414 elsif (-e "$cmd\/index.pl") {
4415 0 $cmd = $cmd . "\/index.pl";} #### pre-existing testsuiteHook is index.pl
4416 else { #### No pre-existing index.pl
4417 0 print "generateChildTestsuites: The parentTestsuite doesn't exist! \n"; exit;
4418 }
4419  
4420 0 open FOUT, ">$c/$_TAF/_generateChildTestsuite.bat";
4421  
4422 0 ▶ if ($cmd =~ /\.ps1\s*$/) { $cmd = "powershell -executionpolicy unrestricted -file ". $cmd. " $ps1_args"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($cmd =~ /\.ps1\s*$/) 0 0 0
4423 0 foreach my $each (split "\n", &runPowershell($cmd)) { # get testsuiteName _testsuitename_: (\w+)and _testdrivername_: (\w+)
4424 0 $each = " _full_ ".$each;
4425 0 @_ = $each =~ /_(\w+)_/g;
4426 0 ▶ if ($#_ > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($#_ > 0) 0 0 0
4427 0 foreach my $each1 (@_) {
4428 0 ▶ if ($recordTags{$each1}) { $recordTags{$each1} = $recordTags{$each1} + 1; } else { $recordTags{$each1} = 1;}
Branch: 1 branch
BranchTrueFalseTotal
if ($recordTags{$each1}) { } 0 0 0
4429 }
4430 }
4431 }
4432  
4433 #$cmd = "$c/$_TAF/$taf testsuite=$SvrProjName;tcPropertyName=_full_;generateTestsuiteByDesc\n"; $cmd =~ s/\//\\/g; print FOUT "$cmd"; # todo \\
4434 #$cmd = "$c/$_TAF/$taf testsuite=$SvrProjName/_full_;generateTestsuite\n"; $cmd =~ s/\//\\/g; print FOUT "$cmd"; # todo \\
4435 0 $cmd = "$c/$_TAF/$taf testsuite=$SvrProjName;tcPropertyName=_full_;generateTestsuiteByDesc\n"; print FOUT "$cmd"; # todo5 \\
4436 0 $cmd = "$c/$_TAF/$taf testsuite=$SvrProjName/_full_;generateTestsuite\n"; print FOUT "$cmd"; # todo6 \\
4437
4438 0 foreach my $key (sort hashValueDescendingNum (keys(%recordTags))) {
4439 0 ▶ if ($key !~ /\bfull\b/i) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($key =~ /\bfull\b/i) 0 0 0
4440 #$cmd = "$c/$_TAF/$taf testsuite=$SvrProjName;tcPropertyName=_${key}_;generateTestsuiteByDesc\n"; $cmd =~ s/\//\\/g; print FOUT "$cmd"; # todo \\
4441 #$cmd = "$c/$_TAF/$taf testsuite=$SvrProjName/_${key}_;generateTestsuite\n"; $cmd =~ s/\//\\/g; print FOUT "$cmd"; # todo \\
4442 0 $cmd = "$c/$_TAF/$taf testsuite=$SvrProjName;tcPropertyName=_${key}_;generateTestsuiteByDesc\n"; print FOUT "$cmd"; # todo7 \\
4443 0 $cmd = "$c/$_TAF/$taf testsuite=$SvrProjName/_${key}_;generateTestsuite\n"; print FOUT "$cmd"; # todo8 \\
4444 }
4445
4446 }
4447 0 close FOUT;
4448 0 print " -> $c/$_TAF/_generateChildTestsuite.bat\n --.....-> Running $c/$_TAF/_generateChildTestsuite.bat to generate _smoke_, _regression_ sub Testsuite\n";
4449
4450 ##############################################################################################
4451  
4452 0 1;
4453 }
4454 0 ▶sub hashValueDescendingNum { $recordTags{$a} <=> $recordTags{$b}; }
Subroutine hashValueDescendingNum: not called CC=1 SCAR=6.9
Pod undocumented
4455  
4456  
4457 sub help4install {
4458 0 ▶ &genDriver_taf_pl ();
Subroutine help4install: not called CC=1 SCAR=6.9
Pod undocumented
4459 0 &genDriver_taf_cgi ();
4460  
4461 0 my $help=<<EOF;
4462 -----------------------------------------------------------------------------------------------------------------------
4463 Test::AutomationFramework - Test Automation Framework (TAF) version: $VERSION
4464  
4465 TAF manages automated test cases regarding test setup, test query, test execution and
4466 test reportings with *ONE* mouse-click. No programming and no manual Reading.
4467  
4468 ---------------------------------------------------------------------------------------------------------------
4469 $c/$_TAF/index.htm WebAccess TAF-Testbed
4470 $c/$_TAF/taf.pl -help4intro TAF Introduction
4471 $c/$_TAF/taf.pl -help4install Command_line usages
4472 $c/$_TAF/taf.pl -help4cmd Command_line usages
4473 $c/$_TAF/taf.pl -help4developer Historical and under-development Functions
4474 ---------------------------------------------------------------------------------------------------------------
4475  
4476 TAF Test Case integration - $c/$_TAF/[test_suite]/[test_case]/tc.pl
4477
4478 * $c/$_TAF/[test_suite]/[test_case]/tc.pl : print Pass|fail|number to STDOUT
4479 * $c/$_TAF/[test_suite]/[test_case]/tc.pl : geneate TC Log as cwd()/_appendLog.txt
4480  
4481 TAF Test Suite integration - $c/$_TAF/[test_suite]/index.pl or index.ps1
4482  
4483 * $c/$_TAF/index.[pl|ps1] : print one TC Description per line
4484 * $c/$_TAF/index.[pl|ps1] Index : exec Index-th TC
4485  
4486 [Web Access: http://$c/$_TAF/index.htm]
4487 1. Install StrawberryPerl
4488 2. Install TAF from CPAN (Perl -MCPAN -e "install Test::AutomationFramework)
4489 3. Install TAF Testbed (Perl -MTest::AutomationFramework -e "help"
4490 4. *One* mouse click to execute and view test results in the Test Bed
4491  
4492 [Web examples]
4493 5. Add test suite by modifying $c/$_TAF/taf.bat
4494 6. Add test case by modifying $c/$_TAF/[test_suite]/[test_case]/tc.pl
4495 7. Run $c/$_TAF/taf.bat to create user's test suite structure and start its webUI
4496
4497 webUI TAF usages scenarios:
4498 List Test cases:
4499 * list test pass|fail (click Pass|Fail)
4500 cmd>taf.pl testsuite=_testsuit2_;list
4501 * list Passed test cases (click title's Pass)
4502 cmd>taf.pl testsuite=_testsuit2_;tcFilters=tcRunResult_matches_pass
4503 * list Failed test cases (click title's Failed)
4504 cmd>taf.pl testsuite=_testsuit2_;tcFilters=tcRunResult_matches_fail
4505 * list non-Pass|Failed test cases (click \| between Pass and Fail)
4506 cmd>taf.pl testsuite=_testsuit2_;tcFilters=tcRunResult_matches_null
4507 Exec Test cases:
4508 * Exec test cases (click pass|fail counters)
4509 cmd>taf.pl testsuite=_testsuit2_;testcase=testcase0001;exec
4510 cmd>taf.pl testsuite=_testsuit2_;testcase=testcase000[1,2,3,4];exec
4511 cmd>taf.pl testsuite=_testsuit2_;testcase=testcase000[1-9];exec
4512 * Exec test suite (click title pass|fail counters)
4513 cmd>taf.pl testsuite=_testsuit2_;exec
4514 View Test Results
4515 * View historical pass/fail (click Pass|Fail)
4516 * View historical logs (click Test Desc)
4517 * View historical pass/fail in graphics (click title Result)
4518 -----------------------------------------------------------------------------------------------------------------------
4519 EOF
4520 0 print $help;
4521 0 &genDriver_testbed();
4522 0 1;
4523 }
4524  
4525 sub help {
4526 2 ▶ &genDriver_taf_pl ();
Subroutine help: called CC=4 SCAR=14.0
Pod undocumented
4527 2 &genDriver_taf_cgi ();
4528 2 &genDriver_taf_svr ();
4529  
4530 2 my $help=<<EOF;
4531 -----------------------------------------------------------------------------------------------------------------------
4532 Test::AutomationFramework - Test Automation Framework (TAF) version: $VERSION
4533 TAF manages automated test cases regarding test setup, test query, test execution and
4534 test reportings with *ONE* mouse-click. No programming and no manual Reading.
4535 -----------------------------------------------------------------------------------------------------------------------
4536  
4537 $c/$_TAF/taf.pl helpmore TAF Usage Samples
4538 $c/$_TAF/taf.pl testsuite=_testsuit3_ Frequently Used Command line
4539  
4540  
4541 $c/$_TAF/index.htm WebAccess TAF-Testbed
4542 $c/$_TAF/taf.pl help4intro TAF Introduction
4543 $c/$_TAF/taf.pl help4install Command_line usages
4544 $c/$_TAF/taf.pl help4cmd Command_line usages
4545 $c/$_TAF/taf.pl help4dev Historical and under-development Functions
4546  
4547 -----------------------------------------------------------------------------------------------------------------------
4548 EOF
4549 2 print $help;
4550 2 &genDriver_testbed();
4551 2 sleep $outputPause;
4552  
4553 2 ▶ if (-e "$SvrDrive/$reportHtml") { ; } else { # if this is the 1st time install, testbed script is started
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$SvrDrive/$reportHtml") { } 0 2 2
4554 2 print "Start ***testbed*** ($c/$_TAF/taf.[bat|sh] for ininital installation. Remove testbed script ($c/$_TAF/taf_delete.[bat|sh])\n";
4555 2 ▶ system "$c/$_TAF/taf.bat" if ($^O =~ /win32/i);
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /win32/i 0 2 2
4556 2 ▶ system "$c/$_TAF/taf.sh " if ($^O =~ /linux/i);
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /linux/i 2 0 2
4557 2 print "Finish ***testbed*** ($c/$_TAF/taf.[bat|sh] for ininital installation. Remove testbed script ($c/$_TAF/taf_delete.[bat|sh])\n";
4558 }
4559 2 1;
4560 }
4561  
4562 sub installTestbed {
4563 0 ▶ print "Start ***testbed*** ($c/$_TAF/taf.[bat|sh] for ininital installation. Remove testbed script ($c/$_TAF/taf_delete.[bat|sh])\n";
Subroutine installTestbed: not called CC=3 SCAR=24.8
Pod undocumented
4564 0 ▶ system "$c/$_TAF/taf.bat" if ($^O =~ /win32/i);
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /win32/i 0 0 0
4565 0 ▶ system "$c/$_TAF/taf.sh " if ($^O =~ /linux/i);
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /linux/i 0 0 0
4566 0 print "Finish ***testbed*** ($c/$_TAF/taf.[bat|sh] for ininital installation. Remove testbed script ($c/$_TAF/taf_delete.[bat|sh])\n";
4567 }
4568  
4569 sub deleteTestbed {
4570 0 ▶ print "Start ***delete testbed*** ($c/$_TAF/taf_delete.[bat|sh]. Install testbed script ($c/$_TAF/taf.[bat|sh])\n";
Subroutine deleteTestbed: not called CC=3 SCAR=24.8
Pod undocumented
4571 0 ▶ system "$c/$_TAF/taf_delete.bat" if ($^O =~ /win32/i);
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /win32/i 0 0 0
4572 0 ▶ system "$c/$_TAF/taf_delete.sh " if ($^O =~ /linux/i);
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /linux/i 0 0 0
4573 0 print "Finish ***delete testbed*** ($c/$_TAF/taf_delete.[bat|sh]. Install testbed script ($c/$_TAF/taf.[bat|sh])\n";
4574 }
4575  
4576  
4577  
4578 sub help4intro {
4579 0 ▶if ( $^O =~ /MSWin32/ ) {; } else { print "TAF supports Win32 ONLY currently.\n"; exit; }
Subroutine help4intro: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /MSWin32/) { } 0 0 0
4580 0 &genDriver_taf_pl ();
4581 0 &genDriver_taf_cgi ();
4582  
4583 0 my $help=<<EOF;
4584 -----------------------------------------------------------------------------------------------------------------------
4585 Test::AutomationFramework - Test Automation Framework (TAF) version: $VERSION
4586  
4587 TAF manages automated test cases regarding test setup, test query, test execution and
4588 test reportings with *ONE* mouse-click. No programming and no manual Reading.
4589  
4590 TAF Test Case integration - $c/$_TAF/[test_suite]/[test_case]/tc.pl
4591
4592 * $c/$_TAF/[test_suite]/[test_case]/tc.pl : print Pass|fail|number to STDOUT
4593 * $c/$_TAF/[test_suite]/[test_case]/tc.pl : geneate TC Log as cwd()/_appendLog.txt
4594  
4595 TAF Test Suite integration - $c/$_TAF/[test_suite]/index.pl or index.ps1
4596  
4597 * $c/$_TAF/index.[pl|ps1] : print one TC Description per line
4598 * $c/$_TAF/index.[pl|ps1] Index : exec Index-th TC
4599  
4600 [Web Access: http://$c/$_TAF/index.htm]
4601 1. Install StrawberryPerl
4602 2. Install TAF from CPAN (Perl -MCPAN -e "install Test::AutomationFramework)
4603 3. Install TAF Testbed (Perl -MTest::AutomationFramework -e "help"
4604 4. *One* mouse click to execute and view test results in the Test Bed
4605  
4606 [Web examples]
4607 5. Add test suite by modifying $c/$_TAF/taf.bat
4608 6. Add test case by modifying $c/$_TAF/[test_suite]/[test_case]/tc.pl
4609 7. Run $c/$_TAF/taf.bat to create user's test suite structure and start its webUI
4610
4611 webUI TAF usages scenarios:
4612 List Test cases:
4613 * list test pass|fail (click Pass|Fail)
4614 cmd>taf.pl testsuite=_testsuit2_;list
4615 * list Passed test cases (click title's Pass)
4616 cmd>taf.pl testsuite=_testsuit2_;tcFilters=tcRunResult_matches_pass
4617 * list Failed test cases (click title's Failed)
4618 cmd>taf.pl testsuite=_testsuit2_;tcFilters=tcRunResult_matches_fail
4619 * list non-Pass|Failed test cases (click \| between Pass and Fail)
4620 cmd>taf.pl testsuite=_testsuit2_;tcFilters=tcRunResult_matches_null
4621 Exec Test cases:
4622 * Exec test cases (click pass|fail counters)
4623 cmd>taf.pl testsuite=_testsuit2_;testcase=testcase0001;exec
4624 cmd>taf.pl testsuite=_testsuit2_;testcase=testcase000[1,2,3,4];exec
4625 cmd>taf.pl testsuite=_testsuit2_;testcase=testcase000[1-9];exec
4626 * Exec test suite (click title pass|fail counters)
4627 cmd>taf.pl testsuite=_testsuit2_;exec
4628 View Test Results
4629 * View historical pass/fail (click Pass|Fail)
4630 * View historical logs (click Test Desc)
4631 * View historical pass/fail in graphics (click title Result)
4632 -----------------------------------------------------------------------------------------------------------------------
4633 EOF
4634 0 print $help;
4635 0 &genDriver_testbed();
4636 }
4637  
4638 sub helpmore {
4639 0 ▶if ( $^O =~ /MSWin32/ ) {; } else { print "TAF supports Win32 ONLY currently.\n"; exit; }
Subroutine helpmore: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /MSWin32/) { } 0 0 0
4640 0 &genDriver_taf_pl ();
4641 0 &genDriver_taf_cgi ();
4642  
4643 0 my $help=<<EOF;
4644 -----------------------------------------------------------------------------------------------------------------------
4645 Test::AutomationFramework - Test Automation Framework (TAF) version: $VERSION
4646  
4647 [TAF Execution Controls]
4648 $c\\$_TAF\\taf.pl -help
4649 $c\\$_TAF\\taf.pl tcPropertyPatternPattern=\\d+_pipe_null;tcPropertyPatternName=tcRunResult;testsuite=_testsuite3_ rem list tcRunResult =~ /performance|null/
4650 $c\\$_TAF\\taf.pl -processTSs [create|delete|add]=$c/_testsuite1/_testsuite2
4651 $c\\$_TAF\\taf.pl Execution_24_7=y;NofExecution=5;Execution=24hour;testsuite=_MV_SDK_OCSP;[list|exec]
4652 $c\\$_TAF\\taf.pl testsuit=CPD_QA_Tests/BATtests/MVTests/Bat/MV_2-0-1-0057/_MV_SDK_OCSP;list
4653 $c\\$_TAF\\taf.pl exitTAF
4654 $c\\$_TAF\\taf.pl ExecutionType=[runTC|runTS]
4655 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;performanceMode=fast;list
4656 $c\\$_TAF\\taf.pl [SUTSymbol|tsFilterDefault]=_;tsFilter="2.2.0.217[_doit_];scanTestsuites
4657 $c\\$_TAF\\taf.pl generateRootIndex
4658 $c\\$_TAF\\taf.pl -processTCs create=tc1/fail,overwrite
4659 $c\\$_TAF\\taf.pl -processTCS tsDriver=index_pyAnvil.pl;printVars;testsuite=_testsuite3_;list
4660
4661 ##################### Powershell Testsuite Exmaples ##################################
4662 $c\\$_TAF\\taf.pl -processTSs create=c:/_CRB_/AppBuildpath/_automated_testsuites_/_testsuite_ps1__powershell_
4663 $c\\$_TAF\\generatePyAnvilTestsuite.pl -buildpath c:/_CRB_/AppBuildpath -genTAF y
4664  
4665 ##################### get/set tc [Property|Filter] ##################################
4666 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=set_property1_[as|eq]_propVal1[_doit_]
4667 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=_get_property1[_doit_]
4668 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=_get__all_[_doit]
4669  
4670 ##################### TC [list|exec] based on TC Filters ##################################
4671 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;listTcfilters
4672 taf.pl testsuite=_testsuite2_;pm=fast;tcOp=listtcfilters
4673 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;tcFilters=testproperty_matches_tsetProperValue1;[list|exec]
4674 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;tppp1=;tppn1=;tppp2=;tppn2=....
4675  
4676 $c\\$_TAF\\taf.pl tcPropertyName=smoke;tsFilterDefault=c:\\_CRB_\\AppBuildpath;generateTestsuiteByDesc
4677 e.g.
4678 1. taf.pl testsuite=_testsuite2_;[list|print]Tcfilters
4679 2. taf.pl testsuite=_testsuite2_;propertyOP=_set_property1_[as|eq]_propVal1_doit_
4680 3. taf.pl testsuite=_testsuite2_;propertyOP=_get_property1
4681 4. taf.pl testsuite=_testsuite2_;tcFilters=property1_matches_PropertyValue1;[list|exec]
4682 -----------------------------------------------------------------------------------------------------------------------
4683 EOF
4684 0 print $help;
4685 0 &genDriver_testbed();
4686 0 1;
4687 }
4688  
4689 sub help4cmd{
4690 0 ▶if ( $^O =~ /MSWin32/ ) {; } else { print "TAF supports Win32 ONLY now.\n"; exit; }
Subroutine help4cmd: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /MSWin32/) { } 0 0 0
4691 0 &genDriver_taf_pl ();
4692 0 &genDriver_taf_cgi ();
4693  
4694 0 my $help=<<EOF;
4695 -----------------------------------------------------------------------------------------------------------------------
4696 Test::AutomationFramework - Test Automation Framework (TAF) version: $VERSION
4697  
4698 TAF manages automated test cases regarding test setup, test query, test execution and
4699 test reportings with *ONE* mouse-click. No programming and no manual Reading.
4700  
4701 [Programmer's Usage: from command line. see TAF commands cmd> and taf cmds in $c/$_TAF/taf.bat>]
4702  
4703 Create Testcases
4704 * c:\\_TAF\\taf.pl -processTSs create=c:/_TAF/_testsuiteTestBed/_testsuite4_
4705 Create Testsuites
4706 * c:\\_TAF\\taf.pl testsuit=_testsuite3_;create=_testcase2_/overwrite,perf,sleep=3
4707 * c:\\_TAF\\taf.pl testsuit=_testsuite2_;create=_testcase1_/overwrite,sleep=20
4708 * c:\\_TAF\\taf.pl testsuit=_testsuite3_;create=_testcase6_/overwrite,genLog,sleep=10
4709 * c:\\_TAF\\taf.pl testsuit=_testsuite3_;create=_testcase9_/overwrite,expectedFail,genLog,sleep=1
4710 Copy Testsuite
4711 taf.pl tsFrom=e.txt;tsTo=ee.txt;copyTS
4712 TS/TC Management by _tcGlobal.txt
4713 taf.pl testsuite=_testsuite2;printTAFTSVars
4714 taf.pl testsuite=_testsuite2;testcase=testcase0002;printTAFTCVars
4715
4716 TC Execution controls
4717
4718 * tcIdMin : start TC Id for Testsuite Execution (default = 0)
4719 * printVars : Print Global Variables
4720 * printTCFilters : print TC Filters
4721 * setTCFilter : set_property1_as_value1[_doit_]
4722 * getTCFilter : get_property
4723 * tcFilters : =property_match_propertyvalue
4724 * tsDriver : Testsuite Driver|hook
4725 * web_ui_title : set webUI title
4726 * Execution_24_7 : Continuous execution [y|n]
4727 * NofExecution : Number of Executions
4728 * ExecutionDuration : Execution Longivity
4729 * exitTAF : exitTAF gracefully
4730 * executionType : TC|TS
4731 * performanceMode : 'slow' for webUI & 1st time execution. 'fast' for command line exec
4732  
4733 -----------------------------------------------------------------------------------------------------------------------
4734  
4735 [Examples]
4736 $c\\$_TAF\\taf.pl -help
4737 $c\\$_TAF\\taf.pl genDriver_testbed
4738 $c\\$_TAF\\taf.pl generateIndex_pl | generateIndex_pyAnvil_pl
4739 $c\\$_TAF\\taf.pl generateTestsuite
4740 $c\\$_TAF\\taf.pl generateRootIndex
4741 taf.pl testsuite=_testsuite1_;resetTSFileName=_list_history_tcRunResult.txt;resetTSFile;resetTSFile
4742  
4743  
4744 ##################### TS/TC Management (Create/List/Exec) ##################################
4745
4746 $c\\$_TAF\\taf.pl -processTCs create=tc1/fail,overwrite
4747 $c\\$_TAF\\taf.pl testsuite=c:/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl;createOrAppendTS=create;generateTAFTestsuite
4748 $c\\$_TAF\\taf.pl -processTSs [create|delete|add]=$c/_testsuite1/_testsuite2
4749 $c\\$_TAF\\taf.pl [SUTSymbol|tsFilterDefault]=_;tsFilter="2.2.0.217[_doit_];scanTestsuites
4750 $c\\$_TAF\\taf.pl tsDriver=$c/TAF_pyAnvil/index_pyAnvil.pl;web_ui_title=Test___Automation___Framework;printVars;generateTestsuite Generate pyAnvil Testsuite
4751  
4752 $c\\$_TAF\\taf.pl tcIdMin=5;printVars;testsuite=_testsuite3_;list
4753 $c\\$_TAF\\taf.pl testsuit=CPD_QA_Tests/BATtests/MVTests/Bat/MV_2-0-1-0057/_MV_SDK_OCSP;list
4754 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;performanceMode=fast;list
4755 $c\\$_TAF\\taf.pl -processTCS tsDriver=index_pyAnvil.pl;printVars;testsuite=_testsuite3_;list
4756 $c\\$_TAF\\taf.pl tcPropertyPatternPattern=\\d+_pipe_null;tcPropertyPatternName=tcRunResult;testsuite=_testsuite3_ rem list tcRunResult =~ /performance|null/
4757 $c\\$_TAF\\taf.pl tcPropertyPatternPattern=fail;tcPropertyPatternName=tcRunResult;testsuite=_testsuite3_
4758  
4759 $c\\$_TAF\\taf.pl tcIdMin=5;printVars;testsuite=_testsuite3_;exec
4760 $c\\$_TAF\\taf.pl ExecutionType=[runTC|runTS]
4761 $c\\$_TAF\\taf.pl exitTAF
4762 $c\\$_TAF\\taf.pl Execution_24_7=y;NofExecution=5;Execution=24hour;testsuite=_MV_SDK_OCSP;[list|exec]
4763  
4764 ##################### Powershell Testsuite Exmaples ##################################
4765 $c\\$_TAF\\taf.pl -processTSs create=c:/_CRB_/AppBuildpath/_automated_testsuites_/_testsuite_ps1__powershell_
4766 $c\\$_TAF\\generatePyAnvilTestsuite.pl -buildpath c:/_CRB_/AppBuildpath -genTAF y
4767  
4768 ##################### get/set/list/list_history tc [Property|Filter] ##################################
4769 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=set_property1_[as|eq]_propVal1[_doit_]
4770 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=_get_property1[_doit_]
4771 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=_get__all_[_doit]
4772  
4773 $c\\$_TAF\\taf.pl testsuite=Autobat\\Bat\\QA_Tests\\BATtests\\MVTests\\BAT\\AutomationtsNameSUT\\_full_;AutomationtsName=AutomationtsNameSUT;propertyOp=list_tcDesc
4774 $c\\$_TAF\\taf.pl testsuite=Autobat\\Bat\\QA_Tests\\BATtests\\MVTests\\BAT\\AutomationtsNameSUT\\_full_;AutomationtsName=AutomationtsNameSUT;propertyOp=list_history_tcRunResult
4775 $c\\$_TAF\\taf.pl testsuite=Autobat\\Bat\\QA_Tests\\BATtests\\MVTests\\BAT\\AutomationtsNameSUT\\_full_;AutomationtsName=AutomationtsNameSUT;generateExcelReport
4776  
4777 ##################### TC [list|exec] based on TC Filters ##################################
4778 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;listTcfilters
4779 taf.pl testsuite=_testsuite2_;pm=fast;tcOp=listtcfilters
4780 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;tcFilters=testproperty_matches_tsetProperValue1;[list|exec]
4781 $c\\$_TAF\\taf.pl testsuite=_testsuite2_;pm=fast;tppp1=;tppn1=;tppp2=;tppn2=....
4782  
4783 e.g.
4784 1. taf.pl testsuite=_testsuite2_;[list|print]Tcfilters
4785 2. taf.pl testsuite=_testsuite2_;propertyOP=_set_property1_[as|eq]_propVal1_doit_
4786 3. taf.pl testsuite=_testsuite2_;propertyOP=_get_property1
4787 4. taf.pl testsuite=_testsuite2_;tcFilters=property1_matches_PropertyValue1;[list|exec]
4788
4789 ##################### MISC Maintenance info ###########################
4790 1. ......titleStatus=(UnderMaint);list
4791 -----------------------------------------------------------------------------------------------------------------------
4792 EOF
4793 0 print $help;
4794 0 &genDriver_testbed();
4795 0 1;
4796 }
4797  
4798  
4799 sub help4dev{
4800 0 ▶my $help=<<EOF;
Subroutine help4dev: not called CC=1 SCAR=6.9
Pod undocumented
4801 -----------------------------------------------------------------------------------------------------------------------
4802  
4803 ---------------- This help is for historical and under-development functions -----------------
4804 taf.pl testsuit=_ts1_;list
4805 taf.pl testsuit=_ts1_;testcase=_tc1_;list
4806 taf.pl testsuite=Autobat\\Bat\\QA_Tests\\BATtests\\MVTests\\BAT\\Automation_MVSDK\\_full_;propertyOp=list_tcDesc
4807 taf.pl testsuite=Autobat\\Bat\\QA_Tests\\BATtests\\MVTests\\BAT\\Automation_MVSDK\\_full_;listHistory
4808 taf.pl testsuite=generateReport
4809  
4810 taf.pl -processTC or -tc arg=[tcName;cmd] create=tc1|list|get|exec=tc1|detect|delete|log|getLogName|printResult;all
4811  
4812 # e.g. taf.pl -tc create=tc1;fail,overwrite
4813 taf.pl -tc create=tc1;fail,genLog;pr2Screen
4814 taf.pl -tc create=tc1;performanceTC,genLog;pr2Screen
4815 taf.pl -tc delete=tc1;pr2Screen
4816  
4817 -processTCs or -s arg=[TCOP=list;...] # e.g. taf.pl -s TCNamePattern=tc.*
4818 # taf.pl -s list
4819 Drive=c:; # c: d: e: ...
4820 TestSuite=_testSuit_; # directory
4821 TCOp=list; # List test cases that matches the TCNameFilter and PropertyFilter
4822 TCName=_testCase_; # test case name
4823 TCNamePattern=*; # Test Case Name Filter
4824 TCNameFilter=*; # Test Case Name Filter
4825 PropNameFilter=.*; # Property_Name Filter
4826 PropValueFilter.=.*; # Property_Value Filter
4827 pr2Screen; # Results will be displayed on screen
4828 getVars|listVars|printVars # get or print TAF settings
4829  
4830 -processTSs [create|delete|add]=c:/...
4831 -processProperty or -prop arg=[add=prop1:val1] add|delete|list|get|modify|match|filter
4832  
4833 # e.g taf.pl -prop list=tc;pr2Screen
4834 taf.pl -prop add=prop1:val1;pr2Screen
4835 taf.pl -prop match=.*:.*;pr2Screen
4836 taf.pl -prop match=propNameFilter:propValFilter
4837  
4838 To create driver (taf.pl): perl.pl -MTest::AutomationFramework -e "help"
4839  
4840 taf.pl -processTCs create=tc1/fail,overwrite
4841 taf.pl -processTCS tsDriver=index_pyAnvil.pl;printVars;testsuite=_testsuite3_;list
4842 $c\\$_TAF\\taf.pl tsDriver=index_pyAnvil.pl;printVars;generateTestsuite
4843 $c\\$_TAF\\taf.pl web_ui_title=testtitle;printVars;generateTestsuite
4844 cwd/taf.pl generateTestsuite
4845 taf.pl generateRootIndex
4846 $c\\$_TAF\\taf.pl workingDir=c:/_MahoBby_/CPD_QA_Tests/BATtests/MVTests/Bat/MV_2-0-1-0062/_MV_SDK_OCSP;web_ui_title=c:/_MahoBby_/CPD_QA_Tests/BATtests/MVTests/Bat/MV_2-0-1-0062/_MV_SDK_OCSP;ps1_args=-buildpath___c:/_MahoBay_/CPD_QA_Tests/BATTests/MVTests/Bat/;generateTestsuite
4847 $c\\$_TAF\\taf.pl -scanTestsuites Tests/BATtests/MVtests/Bat/2.2.0.217_doit_
4848 $c\\$_TAF\\taf.pl testsuite=_testsuite1_;resetTSFileName=_list_history_tcRunResult.txt;resetTSFile;resetTSFile
4849  
4850 ########################## Property add/get ##################################
4851 taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=set_property1_[as|eq]_propVal1_doit_
4852 taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=_get_property1_doit_
4853 taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=_get__all__doit
4854  
4855 taf.pl testsuite=_testsuite3_;testcase=testcase1;propertyOp=add_eq_prop1_column_val1[_doit_]
4856 taf.pl testsuite=_testsuite3_;testcase=testcase1;propertyOp=add_eq_tcDesc_column_TCDescription___Test[_doit_]
4857 taf.pl testsuite=_testsuite2_;pm=fast;propertyOp=get_eq_prop1_doit_
4858 taf.pl testsuite=_testsuite2_;pm=fast;propertyOp=get_eq_tcDesc_doit_
4859 taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=get_eq_.*_all__doit_
4860 taf.pl testsuite=_testsuite2_;pm=fast;propertyOP=get_eq_tcOwner_doit_
4861  
4862 ##################### TC Property Filter for TC Execution ##################################
4863 taf.pl testsuite=_testsuite2_;pm=fast;listTcfilters
4864 taf.pl testsuite=_testsuite2_;pm=fast;tcOp=listtcfilters
4865 taf.pl testsuite=_testsuite2_;pm=fast;tcFilters=testproperty_matches_tsetProperValue1;[list|exec]
4866 taf.pl testsuite=_testsuite2_;pm=fast;tcPropertyPatternName=prop1;tcPropertyPatternPattern=val1;list
4867 taf.pl testsuite=_testsuite2_;pm=fast;tppn=prop1;tppp=val1;list
4868 taf.pl testsuite=_testsuite2_;pm=fast;key=prop1;keyValue=val1;list
4869  
4870 e.g.
4871 1. taf.pl testsuite=_testsuite2_;listTcfilters
4872 2. taf.pl testsuite=_testsuite2_;propertyOP=_set_property1_[as|eq]_propVal1_doit_
4873 3. taf.pl testsuite=_testsuite2_;propertyOP=_get_property1
4874 4. taf.pl testsuite=_testsuite2_;tcFilters=property1_matches_PropertyValue1;[list|exec]
4875  
4876  
4877 taf.pl install (obsoleted)
4878  
4879  
4880 -----------------------------------------------------------------------------------------------------------------------
4881 EOF
4882 0 print $help;
4883 0 1;
4884 }
4885 sub genDriver_taf_pl {
4886 7 ▶ if (-e "$c/$_TAF/taf.pl") {;} else { mkpath "$c/$_TAF"; open Fout, ">$c/$_TAF/taf.pl"; print Fout &prDriver(1); close Fout; print " --> $c/$_TAF/taf.pl\n"; }
Subroutine genDriver_taf_pl: called CC=2 SCAR=6.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.pl") { } 6 1 7
4887 7 1;
4888 }
4889 sub genDriver_taf_cgi {
4890 7 ▶ if (-e "$c/$_TAF/taf.cgi") {;} else { mkpath "$c/$_TAF"; open Fout, ">$c/$_TAF/taf.cgi"; print Fout &prDriverCGI(1); close Fout; print " --> $c/$_TAF/taf.cgi\n"; }
Subroutine genDriver_taf_cgi: called CC=2 SCAR=6.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.cgi") { } 6 1 7
4891 7 1;
4892 }
4893 sub genDriver_taf_svr {
4894 2 ▶ if (-e "$c/$_TAF/taf.svr") {;} else { mkpath "$c/$_TAF"; open Fout, ">$c/$_TAF/taf.svr"; print Fout &prDriverSvr(1); close Fout; print " --> $c/$_TAF/taf.svr\n"; }
Subroutine genDriver_taf_svr: called CC=2 SCAR=6.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.svr") { } 1 1 2
4895 2 1;
4896 }
4897  
4898  
4899 sub genDriver_testbed {
4900 0 ▶ if ($^O =~ /win32/i) { &genDriver_testbed_Window(); &delDriver_testbed_Window();}
Subroutine genDriver_testbed: called CC=3 SCAR=12.7
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 2 2
4901 2 ▶ if ($^O =~ /linux/i) { &genDriver_testbed_Linux(); &delDriver_testbed_Linux();}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 2 0 2
4902 }
4903 sub genDriver_testbed_Window { # Testbed/testbed
4904 0 ▶ mkpath "$c/$_TAF";
Subroutine genDriver_testbed_Window: not called CC=5 SCAR=34.0
Pod undocumented
4905 0 ▶ if (-e "$c/$_TAF/taf.pl") { ;} else { open Fout, ">$c/$_TAF/taf.pl"; print Fout &prDriver(1); close Fout; print " --> $c/$_TAF/taf.pl\n"; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.pl") { } 0 0 0
4906 0 ▶ if (-e "$c/$_TAF/taf.bat") {;} else {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.bat") { } 0 0 0
4907  
4908 0 &generateAutoItTS();
4909  
4910 0 my $testbed4Window =<<EOF;
4911  
4912 REM ------------- Create TC/TS under $c/$_TAF -----------------------------------
4913 REM * Create Functional test case, which returns Pass with different execution time.
4914 REM * Create Functional test case, which returns Fail with different execution time.
4915 REM * Create Performance test case, which returns number of seconds
4916 REM * Create Functional test case, with logs and links in the logs (_tcLogAppend.txt)
4917 REM * Create Functional test case, with expected failure (expF)
4918 REM * Create Functional test case, with expected failure (bugF)
4919 REM * Test case execution testcase=string ~ (testType=tc or ts~ what does it mean?)
4920 REM * Test case execution testcase=regExp ~ (testType=tc or ts~ what does it mean?)
4921 REM * Test suite execution testsuite=string ~ (testType=tc or ts~ what does it mean?)
4922 REM * Test suite execution testsuite=regExp ~ (testType=tc or ts~ what does it mean?)
4923 REM * Test case status ~ moving ">"
4924 REM * Test case 24/7 execution
4925 REM * Test suite 24/7 execution
4926 REM * Test case "stop"
4927 REM * Test suite "stop"
4928 REM * Test suite title tsProperty.txt
4929 REM * Test case title tcProperty.txt
4930 REM create test_suite (_test_suite?_)/_test_case?_ under $c/$_TAF
4931 REM * Modify
4932 REM * Delete TC/TS
4933 REM * Update TS/TC Status
4934 REM * deleteTS $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}deleteTS
4935  
4936  
4937 rem debug: C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl testsuite=_testsuite1_;deleteTS
4938 rem debug: C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl testsuite=_testsuite1_;create=testcase0001/overwrite,sleep=1
4939 rem debug: C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl testsuite=_testsuite1_;list
4940  
4941 rem debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_testsuite5_non_TAF_~deleteTS
4942 rem debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_TAF/tmp~deleteTS
4943 rem debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl generateRootIndex
4944 rem debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1~createTS
4945  
4946  
4947 REM ------------- Create TC/TS in directory $c/$_TAF...... -----------------------------------
4948  
4949 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0001/overwrite,sleep=1
4950 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0002/overwrite,sleep=1
4951 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0003/overwrite,sleep=1
4952 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0004/overwrite,sleep=1
4953 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0005/overwrite,sleep=1
4954 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0006/overwrite,sleep=1
4955 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0001/overwrite,sleep=20
4956 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0002/overwrite,sleep=20
4957 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0003/overwrite,sleep=40
4958 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0004/overwrite,sleep=30
4959 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0005/overwrite,sleep=20
4960 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0006/overwrite,sleep=20
4961 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0001/overwrite,sleep=2
4962 REM create performance test
4963 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0002/overwrite,perf,sleep=3
4964 REM create Failed Functional test
4965 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0003/overwrite,fail,sleep=1
4966 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0004/overwrite,sleep=2
4967 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0005/overwrite,fail,sleep=4
4968 REM create functional test /w log
4969 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0006/overwrite,genLog,sleep=10
4970 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0007/overwrite,fail,genLog,sleep=1
4971 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0008/overwrite,pass,genLog,sleep=1
4972 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0009/overwrite,expectedFail,genLog,sleep=1
4973 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0010/overwrite,expF,genLog,sleep=1
4974 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0011/overwrite,bugF,genLog,sleep=1
4975  
4976 REM create customrized TAF test cases for property operation test (TC contents are hardcoded in TAF)
4977 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0001/overwrite,sleep=1,customTC:taftestcase1:customTC
4978 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0002/overwrite,sleep=1,customTC:taftestcase2:customTC
4979 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0003/overwrite,sleep=1,customTC:taftestcase3:customTC
4980 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0004/overwrite,sleep=1,customTC:taftestcase4:customTC
4981 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}exec
4982  
4983 REM $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}printTAFTSVars
4984 REM $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testcase=testcase0003${deli}printTAFTCVars
4985  
4986 REM _TAF/_testsuite/TAFTSVars.txt that overwrite _TAF/TAFGlobalVARS.txt
4987 REM updateTAFTSVars set Execution_local_only=y
4988 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}printTAFTSVars
4989 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}updateTAFTSVars
4990 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}updateTAFTCVars
4991  
4992  
4993  
4994 REM ************ Make _testsuite1_/testcase0001 Execution_local_only (no remote exectuion)
4995 REM _TAF/_testsuite/TAFTSVars.txt that overwrite _TAF/TAFGlobalVARS.txt
4996 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}printTAFTSVars
4997 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}updateTAFTSVars
4998  
4999 REM ************ Make _testsuite2_/testcase0002 Execution_local_only (no remote exectuion)
5000 rem $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}clearTAFTCVars
5001 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}printTAFTCVars
5002 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}updateTAFTCVars
5003 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}list
5004  
5005  
5006  
5007 REM exec all test_suite (testsuite~= Regexp~ testcase=RegExp)
5008  
5009 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testType=tc${deli}exec
5010 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testType=tc${deli}testcase=.*${deli}exec
5011 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testType=tc${deli}testcase=testcase.1*${deli}exec
5012  
5013 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testType=tc${deli}exec
5014 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testType=tc${deli}exec
5015  
5016 REM test execution status (1. moving symbol = test-in-prog 2. Current execution status = getWeb_ 3. delete TS
5017 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite1_${deli}testType=tc${deli}list
5018 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite2_${deli}testType=tc${deli}list
5019 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}list
5020 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}testType=tc${deli}list
5021 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=_testcase1_/2
5022 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=_testcase2_/1
5023 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=_testcase3_/3
5024 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}getWeb_=_testcase1_
5025 $perl_ $c/$_TAF/taf.pl testType=tc${deli}delete=$c/$_TAF/_test_suit1_
5026  
5027 REM TS Property update
5028 REM *Verification* _test_suit1_ is removed from disk and webUI
5029 EM
5030
5031  
5032 REM ------------- Create TC/TS in $c/_testsuite5_/...... ------
5033 REM generate test suite from TS Hook (index.pl)
5034 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}createTS
5035 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}createTS
5036 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}createTS
5037 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}createTS
5038  
5039 REM ------------- generate TAF testsuite ($c/_testsuite5_/... -> $c/_TAF/_testsuite5_/...)
5040 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}generateTAFTestsuite
5041 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}generateTAFTestsuite
5042 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}generateTAFTestsuite
5043 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}generateTAFTestsuite
5044  
5045 REM *Verification* TC_TAF $c/$_TAF/_TAF/_testsuiteTestBed/_testsuite?_ should be created and executable
5046 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}exec
5047 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}exec
5048 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}exec
5049 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}exec
5050  
5051  
5052  
5053 REM ------------- Generate Perl testsuite with different tags (_smoketest_, _regression_ ) -----------------------------------
5054  
5055 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}createTS
5056 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}createTS
5057 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}createTS
5058 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}createTS
5059  
5060 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generateTAFTestsuite
5061 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generateTAFTestsuite
5062 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generateTAFTestsuite
5063 rem $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generateTAFTestsuite
5064  
5065 REM ------------- Generate sub-Testsuites (_smoketest_, _regression_ ) -----------------------------------
5066 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generatePropertyTestsuite
5067 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generatePropertyTestsuite
5068 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generatePropertyTestsuite
5069  
5070 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generatePropertyTestsuite
5071 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generatePropertyTestsuite
5072 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generatePropertyTestsuite
5073  
5074 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generatePropertyTestsuite
5075 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generatePropertyTestsuite
5076 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generatePropertyTestsuite
5077  
5078 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generatePropertyTestsuite
5079 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generatePropertyTestsuite
5080 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generatePropertyTestsuite
5081  
5082 REM ------------- Generate sub-Testsuies' TAF testsuite ---------------------------------------------------
5083 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5084 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5085 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5086  
5087 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5088 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5089 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5090  
5091 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5092 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5093 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5094  
5095 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5096 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5097 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5098  
5099 REM ------------- Generate Summary of Original Testsuite and its TAG Testsuites by testcaseNode=_null_ ---------------------------------------------------
5100  
5101 $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generateTAFTestsuite
5102 $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generateTAFTestsuite
5103  
5104 REM ------------- Create Perl-Testsuite Hook and its Test suites /w Tag-based sub-Testsuites (_smoketest_, _regression_ )
5105 REM (make sure the ts ends with _powershell_, which indicate a powershell testsuite)
5106  
5107  
5108 REM ------------- Create Powershell-Testsuite Hook and its Test suites - Generate Tag-based sub-Testsuites -------------
5109 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1__powershell_${deli}createTS
5110  
5111 REM ------------- Generate sub-Testsuites (_smoketest_, _regression_ ) -----------------------------------
5112 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}generatePropertyTestsuite
5113 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}generatePropertyTestsuite
5114 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}generatePropertyTestsuite
5115  
5116  
5117 $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}generateTAFTestsuite
5118 rem For powershell only ${deli} use index.pl over index.ps1
5119 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_full_${deli}generateTAFTestsuite
5120 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_smoketest_${deli}generateTAFTestsuite
5121 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_regressiontest_${deli}generateTAFTestsuite
5122 $perl_ $c/$_TAF/taf.pl testcaseNode=_null_${deli}TSHookIsPerl=y${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}generateTAFTestsuite
5123 rem combine all the property testsuites
5124 REM ------------- Create Powershell-Testsuite Hook and its Test suites - Generate Tag-based sub-Testsuites -------------
5125  
5126 REM Demo for generating daily excel report
5127  
5128 REM ------------- Scabiality Test${deli} multi-testsuites and testing scanTestsuite --------------------------
5129 REM
5130 REM HelloWorld-testbed powershell-Hook (property = _full_, _smoketest_, _regressiontest_) Note: _powershell_ indicate the testsuite hook is index.ps1, in stead of index.pl
5131 $perl_ $c/$_TAF/taf.pl testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1__powershell_${deli}createTS
5132 $perl_ $c/$_TAF/taf.pl testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2__powershell_${deli}createTS
5133 $perl_ $c/$_TAF/taf.pl testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3__powershell_${deli}createTS
5134 $perl_ $c/$_TAF/taf.pl testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4__powershell_${deli}createTS
5135  
5136 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}generatePropertyTestsuite
5137 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}generatePropertyTestsuite
5138 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}generatePropertyTestsuite
5139  
5140 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_${deli}generatePropertyTestsuite
5141 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_${deli}generatePropertyTestsuite
5142 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_${deli}generatePropertyTestsuite
5143  
5144 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}generatePropertyTestsuite
5145 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}generatePropertyTestsuite
5146 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}generatePropertyTestsuite
5147  
5148 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}generatePropertyTestsuite
5149 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}generatePropertyTestsuite
5150 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}generatePropertyTestsuite
5151  
5152  
5153 REM Generate index.ps1 -> index.pl for the original TC (_doit_ is deleted)
5154
5155 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}generateTAFTestsuite
5156 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}generateTAFTestsuite
5157 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}generateTAFTestsuite
5158 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}generateTAFTestsuite
5159  
5160 REM scanTestsuites from testsuite directory - generate root index.html
5161  
5162 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_full_${deli}generateTAFTestsuite
5163 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_smoketest_${deli}generateTAFTestsuite
5164 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_regressiontest_${deli}generateTAFTestsuite
5165  
5166 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_full_${deli}generateTAFTestsuite
5167 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_smoketest_${deli}generateTAFTestsuite
5168 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_regressiontest_${deli}generateTAFTestsuite
5169  
5170  
5171 $perl_ $c/_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_full_${deli}generateTAFTestsuite
5172 $perl_ $c/_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_smoketest_${deli}generateTAFTestsuite
5173 $perl_ $c/_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_regressiontest_${deli}generateTAFTestsuite
5174  
5175  
5176 REM The above scripts should be replace by the scanTestsuites below
5177 rem $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1__doit_${deli}scanTestsuites
5178 rem $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2__doit_${deli}scanTestsuites
5179 rem $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3__doit_${deli}scanTestsuites
5180 rem $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4__doit_${deli}scanTestsuites
5181  
5182 REM ------------- Scabiality Test: multi-testsuites and testing scanTestsuite --------------------------
5183  
5184  
5185 REM ------------- Update testbed' s _thProperties.txt[s] by generateRootIndex
5186  
5187 $perl_ $c/$_TAF/taf.pl printTestBedProperties${deli}generateRootIndex
5188  
5189 REM ------------- TS execution
5190 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite1_${deli}testType=tc${deli}list
5191 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite2_${deli}testType=tc${deli}list
5192 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}list
5193 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}testType=tc${deli}list
5194 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=testcase0001/2
5195 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=testcase0002/1
5196 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=testcase0003/3
5197  
5198 $perl_ $c/$_TAF/taf.pl testsuit=_testsuite2_${deli}testType=tc${deli}updateWeb_=testcase0001/2
5199  
5200 $perl_ $c/$_TAF/taf.pl generateRootIndex
5201  
5202  
5203 rem Mark TS with comments
5204 rem taf.pl testsuite=_testsuite1_${deli}tcComment2=abcd${deli}mark
5205 \@start "" /b "C:/Program Files/Internet Explorer/iexplore.exe" "$c/$_TAF/_testsuite3_/index.htm"
5206  
5207 rem mark3
5208 rem todo: --------------------- property operation and property filter
5209 rem add/set, createTemplate, del, modify, match/filter, get/list (values,_all_, history, latest, last, value, filters),
5210 REM Property Operation: add a property
5211 REM Property Operation: set/modify a property
5212 REM Property Operation: get/list a property
5213 REM Property Operation: print TC properties
5214 REM Property Operation: propertyFilter
5215 REM
5216 REM copy testsuites taf.pl tsFrom=e.txt${deli}tsTo=ee.txt${deli}copyTS
5217  
5218 REM Test the tcFilter functions
5219 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1a_doit_
5220 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1b_doit_
5221 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1c_doit_
5222 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1d_doit_
5223 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1e_doit_
5224 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1f_doit_
5225  
5226 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1a_doit_
5227 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1b_doit_
5228 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1c_doit_
5229 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1d_doit_
5230 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1e_doit_
5231 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1f_doit_
5232  
5233 REM get TC properties
5234 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_property1
5235 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_history_property1
5236 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_last_property1
5237 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_latest_property1
5238  
5239 REM del TC properties (remove all the property-values)
5240 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property2_eq_value2a_doit_
5241 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=del_property2_doit_
5242  
5243 REM Modify TC properties (same as add properties - append to thProperty.txt)
5244 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=modify_property3_eq_value3f_doit_
5245  
5246 REM print TS/TC tcFilters
5247 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}printTCFilters
5248 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}printTCFilters
5249  
5250 REM property match (might need regExp in the future)
5251  
5252 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=match_property2_as_value1h_doit_
5253 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=match_property1_as_value1h_doit_
5254  
5255 $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}printTCFilters
5256  
5257 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite6_${deli}NofTCinTSTemplate${deli}createTS ##### createTS with different number of TC
5258  
5259 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOp=set_propverty1_as_value1_doit_
5260 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase2${deli}propertyOp=set_property1_as_value2_doit_
5261 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase2${deli}printTCFilters
5262  
5263 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}printTcFilters
5264 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOp=get_property1
5265 rem *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase2 propertyOp=get_property1
5266  
5267 REM Old memories
5268 rem taf.pl 'testsuit=_test_suit1_${deli}create=_testcase1_/overwrite,customTC${deli}$c/tmp/purge.pl_space_1${deli}customTC'
5269 rem taf.pl 'testsuit=_test_suit1_${deli}create=_testcase1_/overwrite,pyAnvil,customTC:$c/tmp/indexPyAnvil.pl_space_1:customTC'
5270  
5271 REM reminder
5272 REM _noShow_ tag the TS/TC will not be displayed on webUI
5273 REM TS can't be executed from remotly over http
5274 REM UnderExecution message
5275 REM \$cmd = "c${deli}/_TAF/taf.pl testsuite=\$tsGenerated${deli}tsTags"; Get Testsuite tags
5276 REM taf.pl webUITreeViewLevel=3${deli}generateRootIndex
5277  
5278 EOF
5279  
5280 0 open Fout, ">$c/$_TAF/taf.txt"; print Fout $testbed4Window; close Fout; print " --> $c/$_TAF/taf.txt\n"; my $cmd = "$c/$_TAF/taf.txt";
5281 0 open Fout, ">$c/$_TAF/taf.bat"; print Fout $testbed4Window; close Fout; print " --> $c/$_TAF/taf.bat\n"; $cmd = "$c/$_TAF/taf.bat";
5282 0 ▶ if ($^O =~ /win32/i) { print " Please exec $cmd to setup testbed\n";}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 0 0
5283 0 ▶ if ($^O =~ /linux/i) { print " Please exec $cmd to setup testbed\n";} }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 0 0 0
5284 0 1;
5285 }
5286  
5287  
5288  
5289 sub genDriver_testbed_Linux { # Testbed/testbed
5290 2 ▶ mkpath "$c/$_TAF";
Subroutine genDriver_testbed_Linux: called CC=6 SCAR=18.6
Pod undocumented
5291 2 ▶ if ($^O =~ /linux/i) { `sudo /bin/chmod -R ugo+rwx $c`;}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 2 0 2
5292 0 ▶ if (-e "$c/$_TAF/taf.pl") { ;} else { open Fout, ">$c/$_TAF/taf.pl"; print Fout &prDriver(1); close Fout; print " --> $c/$_TAF/taf.pl\n"; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.pl") { } 2 0 2
5293 2 ▶ if (-e "$c/$_TAF/taf.sh") {;} else {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.sh") { } 1 1 2
5294  
5295 1 my $testbed4Linux=<<EOF;
5296  
5297 # ------------- Create TC/TS under $c/$_TAF -----------------------------------
5298 # * Create Functional test case, which returns Pass with different execution time.
5299 # * Create Functional test case, which returns Fail with different execution time.
5300 # * Create Performance test case, which returns number of seconds
5301 # * Create Functional test case, with logs and links in the logs (_tcLogAppend.txt)
5302 # * Create Functional test case, with expected failure (expF)
5303 # * Create Functional test case, with expected failure (bugF)
5304 # * Test case execution testcase=string ~ (testType=tc or ts~ what does it mean?)
5305 # * Test case execution testcase=regExp ~ (testType=tc or ts~ what does it mean?)
5306 # * Test suite execution testsuite=string ~ (testType=tc or ts~ what does it mean?)
5307 # * Test suite execution testsuite=regExp ~ (testType=tc or ts~ what does it mean?)
5308 # * Test case status ~ moving ">"
5309 # * Test case 24/7 execution
5310 # * Test suite 24/7 execution
5311 # * Test case "stop"
5312 # * Test suite "stop"
5313 # * Test suite title tsProperty.txt
5314 # * Test case title tcProperty.txt
5315 # create test_suite (_test_suite?_)/_test_case?_ under $c/$_TAF
5316 # * Modify
5317 # * Delete TC/TS
5318 # * Update TS/TC Status
5319 # * deleteTS /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}deleteTS
5320 # ------------- Create TC/TS in directory $c/$_TAF...... -----------------------------------
5321  
5322 # debug: C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl testsuite=_testsuite1_;deleteTS
5323 # debug: C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl testsuite=_testsuite1_;create=testcase0001/overwrite,sleep=1
5324 # debug: C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl testsuite=_testsuite1_;list
5325  
5326  
5327  
5328 # debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_testsuite5_non_TAF_~deleteTS
5329 # debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_TAF/tmp~deleteTS
5330 # debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl generateRootIndex
5331 # debug /usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl testsuite=/tmp/var/www/cgi-bin/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1~createTS
5332  
5333  
5334 /usr/bin/sudo chmod -R ugo+rwx $c
5335 /usr/bin/sudo chmod -R go-wx $c
5336  
5337 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0001/overwrite,sleep=1
5338 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0002/overwrite,sleep=1
5339 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0003/overwrite,sleep=1
5340 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0004/overwrite,sleep=1
5341 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0005/overwrite,sleep=1
5342 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}create=testcase0006/overwrite,sleep=1
5343 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0001/overwrite,sleep=20
5344 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0002/overwrite,sleep=20
5345 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0003/overwrite,sleep=40
5346 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0004/overwrite,sleep=30
5347 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0005/overwrite,sleep=20
5348 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}create=testcase0006/overwrite,sleep=20
5349 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0001/overwrite,sleep=2
5350 # create performance test
5351 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0002/overwrite,perf,sleep=3
5352 # create Failed Functional test
5353 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0003/overwrite,fail,sleep=1
5354 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0004/overwrite,sleep=2
5355 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0005/overwrite,fail,sleep=4
5356 # create functional test /w log
5357 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0006/overwrite,genLog,sleep=10
5358 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0007/overwrite,fail,genLog,sleep=1
5359 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0008/overwrite,pass,genLog,sleep=1
5360 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0009/overwrite,expectedFail,genLog,sleep=1
5361 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0010/overwrite,expF,genLog,sleep=1
5362 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}create=testcase0011/overwrite,bugF,genLog,sleep=1
5363  
5364 # create customrized TAF test cases for property operation test (TC contents are hardcoded in TAF)
5365 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0001/overwrite,sleep=1,customTC:taftestcase1:customTC
5366 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0002/overwrite,sleep=1,customTC:taftestcase2:customTC
5367 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0003/overwrite,sleep=1,customTC:taftestcase3:customTC
5368 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}create=testcase0004/overwrite,sleep=1,customTC:taftestcase4:customTC
5369  
5370 /usr/bin/sudo chmod -R ugo+rwx $c
5371 /usr/bin/sudo chmod -R go-wx $c
5372  
5373 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}exec
5374  
5375 # $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}printTAFTSVars
5376 # $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testcase=testcase0003${deli}printTAFTCVars
5377  
5378 # _TAF/_testsuite/TAFTSVars.txt that overwrite _TAF/TAFGlobalVARS.txt
5379 # updateTAFTSVars set Execution_local_only=y
5380 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}printTAFTSVars
5381 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}updateTAFTSVars
5382 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}updateTAFTCVars
5383  
5384 # ************ Make _testsuite1_/testcase0001 Execution_local_only (no remote exectuion)
5385 # _TAF/_testsuite/TAFTSVars.txt that overwrite _TAF/TAFGlobalVARS.txt
5386 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}printTAFTSVars
5387 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}updateTAFTSVars
5388  
5389 # ************ Make _testsuite2_/testcase0002 Execution_local_only (no remote exectuion)
5390 # $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}clearTAFTCVars
5391 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}printTAFTCVars
5392 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testcase=testcase0002${deli}updateTAFTCVars
5393 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}list
5394  
5395 # exec all test_suite (testsuite~= Regexp~ testcase=RegExp)
5396  
5397 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testType=tc${deli}exec
5398 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testType=tc${deli}testcase=.*${deli}exec
5399 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite1_${deli}testType=tc${deli}testcase=testcase.1*${deli}exec
5400  
5401 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite2_${deli}testType=tc${deli}exec
5402 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testType=tc${deli}exec
5403  
5404 # test execution status (1. moving symbol = test-in-prog 2. Current execution status = getWeb_ 3. delete TS
5405 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite1_${deli}testType=tc${deli}list
5406 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite2_${deli}testType=tc${deli}list
5407 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}list
5408 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}testType=tc${deli}list
5409 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=_testcase1_/2
5410 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=_testcase2_/1
5411 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=_testcase3_/3
5412 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}getWeb_=_testcase1_
5413 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testType=tc${deli}delete=$c/$_TAF/_test_suit1_
5414  
5415 # TS Property update
5416 # *Verification* _test_suit1_ is removed from disk and webUI
5417  
5418 # ------------- Create TC/TS in $c/_testsuite5_/...... ------
5419 # generate test suite from TS Hook (index.pl)
5420 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}createTS
5421 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}createTS
5422 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}createTS
5423 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}createTS
5424  
5425 /usr/bin/sudo chmod -R ugo+rwx $c
5426 /usr/bin/sudo chmod -R go-wx $c
5427  
5428 # ------------- generate TAF testsuite ($c/_testsuite5_/... -> $c/_TAF/_testsuite5_/...)
5429 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}generateTAFTestsuite
5430 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}generateTAFTestsuite
5431 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}generateTAFTestsuite
5432 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}generateTAFTestsuite
5433  
5434 /usr/bin/sudo chmod -R ugo+rwx $c
5435 /usr/bin/sudo chmod -R go-wx $c
5436  
5437 # *Verification* TC_TAF $c/$_TAF/_TAF/_testsuiteTestBed/_testsuite?_ should be created and executable
5438 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}exec
5439 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}exec
5440 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}exec
5441 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}exec
5442  
5443 /usr/bin/sudo chmod -R ugo+rwx $c
5444 /usr/bin/sudo chmod -R go-wx $c
5445  
5446 # ------------- Generate Perl testsuite with different tags (_smoketest_, _regression_ ) -----------------------------------
5447  
5448 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}createTS
5449 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}createTS
5450 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}createTS
5451 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}createTS
5452  
5453 /usr/bin/sudo chmod -R ugo+rwx $c
5454 /usr/bin/sudo chmod -R go-wx $c
5455 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generateTAFTestsuite
5456 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generateTAFTestsuite
5457 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generateTAFTestsuite
5458 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generateTAFTestsuite
5459  
5460 /usr/bin/sudo chmod -R ugo+rwx $c
5461 /usr/bin/sudo chmod -R go-wx $c
5462  
5463 # ------------- Generate sub-Testsuites (_smoketest_, _regression_ ) -----------------------------------
5464 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generatePropertyTestsuite
5465 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generatePropertyTestsuite
5466 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generatePropertyTestsuite
5467  
5468  
5469 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generatePropertyTestsuite
5470 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generatePropertyTestsuite
5471 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generatePropertyTestsuite
5472  
5473 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generatePropertyTestsuite
5474 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generatePropertyTestsuite
5475 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}generatePropertyTestsuite
5476  
5477 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generatePropertyTestsuite
5478 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generatePropertyTestsuite
5479 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}generatePropertyTestsuite
5480  
5481 /usr/bin/sudo chmod -R ugo+rwx $c
5482 /usr/bin/sudo chmod -R go-wx $c
5483  
5484 # ------------- Generate sub-Testsuies' TAF testsuite ---------------------------------------------------
5485 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5486 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5487 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5488  
5489 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5490 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5491 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5492  
5493 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5494 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5495 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5496  
5497 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_full_${deli}generateTAFTestsuite
5498 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_smoketest_${deli}generateTAFTestsuite
5499 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_regressiontest_${deli}generateTAFTestsuite
5500  
5501 /usr/bin/sudo chmod -R ugo+rwx $c
5502 /usr/bin/sudo chmod -R go-wx $c
5503  
5504 # ------------- Generate Summary of Original Testsuite and its TAG Testsuites by testcaseNode=_null_ ---------------------------------------------------
5505  
5506 /usr/bin/sudo $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}generateTAFTestsuite
5507 /usr/bin/sudo $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}generateTAFTestsuite
5508  
5509 /usr/bin/sudo chmod -R ugo+rwx $c
5510 /usr/bin/sudo chmod -R go-wx $c
5511  
5512 # ------------- Create Perl-Testsuite Hook and its Test suites /w Tag-based sub-Testsuites (_smoketest_, _regression_ )
5513 # (make sure the ts ends with _powershell_, which indicate a powershell testsuite)
5514  
5515  
5516 # Demo for generating daily excel report
5517  
5518 # ------------- Scabiality Test${deli} multi-testsuites and testing scanTestsuite --------------------------
5519 #
5520 # ------------- Update testbed' s _thProperties.txt[s] by generateRootIndex
5521  
5522 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl printTestBedProperties${deli}generateRootIndex
5523 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl printTAFGlobalVars
5524  
5525 # ------------- TS execution
5526 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite1_${deli}testType=tc${deli}list
5527 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite2_${deli}testType=tc${deli}list
5528 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}list
5529 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite4_${deli}testType=tc${deli}list
5530 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=testcase0001/2
5531 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=testcase0002/1
5532 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite3_${deli}testType=tc${deli}updateWeb_=testcase0003/3
5533  
5534 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuit=_testsuite2_${deli}testType=tc${deli}updateWeb_=testcase0001/2
5535  
5536 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl generateRootIndex
5537  
5538  
5539 # \@start "" /b "C:/Program Files/Internet Explorer/iexplore.exe" "$c/$_TAF/_testsuite3_/index.htm"
5540  
5541 # mark3
5542 # todo: --------------------- property operation and property filter
5543 # add/set, createTemplate, del, modify, match/filter, get/list (values,_all_, history, latest, last, value, filters),
5544 # Property Operation: add a property
5545 # Property Operation: set/modify a property
5546 # Property Operation: get/list a property
5547 # Property Operation: print TC properties
5548 # Property Operation: propertyFilter
5549 #
5550 # copy testsuites taf.pl tsFrom=e.txt${deli}tsTo=ee.txt${deli}copyTS
5551  
5552 # Test the tcFilter functions
5553 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1a_doit_
5554 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1b_doit_
5555 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1c_doit_
5556 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1d_doit_
5557 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1e_doit_
5558 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property1_eq_value1f_doit_
5559  
5560 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1a_doit_
5561 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1b_doit_
5562 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1c_doit_
5563 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1d_doit_
5564 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1e_doit_
5565 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0002${deli}propertyOp=set_property1_eq_value1f_doit_
5566  
5567 # get TC properties
5568 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_property1
5569 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_history_property1
5570 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_last_property1
5571 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=get_latest_property1
5572  
5573 # del TC properties (remove all the property-values)
5574 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=set_property2_eq_value2a_doit_
5575 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=del_property2_doit_
5576  
5577 # Modify TC properties (same as add properties - append to thProperty.txt)
5578 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=modify_property3_eq_value3f_doit_
5579  
5580 # print TS/TC tcFilters
5581 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}printTCFilters
5582 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}printTCFilters
5583  
5584 # property match (might need regExp in the future)
5585  
5586 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=match_property2_as_value1h_doit_
5587 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase0001${deli}propertyOp=match_property1_as_value1h_doit_
5588  
5589 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}printTCFilters
5590  
5591 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite6_${deli}NofTCinTSTemplate${deli}createTS ##### createTS with different number of TC
5592  
5593 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOp=set_propverty1_as_value1_doit_
5594 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase2${deli}propertyOp=set_property1_as_value2_doit_
5595 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase2${deli}printTCFilters
5596  
5597 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}printTcFilters
5598 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}propertyOp=get_property1
5599 # *Technology Reserve* $c/$_TAF/taf.pl testsuite=_testsuite3_${deli}testcase=testcase2 propertyOp=get_property1
5600  
5601 # Old memories
5602 # taf.pl 'testsuit=_test_suit1_${deli}create=_testcase1_/overwrite,customTC${deli}$c/tmp/purge.pl_space_1${deli}customTC'
5603 # taf.pl 'testsuit=_test_suit1_${deli}create=_testcase1_/overwrite,pyAnvil,customTC:$c/tmp/indexPyAnvil.pl_space_1:customTC'
5604  
5605 # reminder
5606 # _noShow_ tag the TS/TC will not be displayed on webUI
5607 # TS can't be executed from remotly over http
5608 # UnderExecution message
5609 # Test result merge by _thProperty_link.txt
5610 # printGlobalVars for TAF/TS/TC ... printTAFGlobalVars , printTAFTSVars , printTAFTCVars
5611 # \$cmd = "c${deli}/_TAF/taf.pl testsuite=\$tsGenerated${deli}tsTags"; Get Testsuite tags
5612 # taf.pl webUITreeViewLevel=3${deli}generateRootIndex
5613 # Configuration: 1. disable selinux 2. disable firewall (iptable)
5614 # !!!!!!!!!!!!! Run sudo chmod -R ugo+rwx /tmp/var !!!!!!!!!!!!!!!
5615  
5616 EOF
5617  
5618 1 open Fout, ">$c/$_TAF/taf.txt"; print Fout $testbed4Linux; close Fout; print " --> $c/$_TAF/taf.txt\n"; my $cmd = "$c/$_TAF/taf.txt";
5619 1 open Fout, ">$c/$_TAF/taf.sh" ; print Fout $testbed4Linux; close Fout; print " --> $c/$_TAF/taf.sh\n"; $cmd = "$c/$_TAF/taf.sh";
5620  
5621 1 ▶ if ($^O =~ /linux/i) { `/usr/bin/sudo /bin/chmod -R ugo+rwx $c`;}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 1 0 1
5622 1 ▶ if ($^O =~ /linux/i) { print "Please exec $cmd manually\n";} }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 1 0 1
5623  
5624  
5625 2 1;
5626 }
5627  
5628 ##############
5629  
5630  
5631 sub generateAutoItTS {
5632  
5633 0 ▶ if (-e "c:/AutoItTestsuite") {;} else { mkpath "c:/AutoItTestsuite";}
Subroutine generateAutoItTS: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e 'c:/AutoItTestsuite') { } 0 0 0
5634  
5635 0 my $calcTestsuite=<<'EOF'
5636  
5637 ;
5638 ; AutoIt Version: 3.0
5639 ; Language: English
5640 ; Platform: Win9x/NT
5641 ;
5642 ; Script Function:
5643 ; Plays with the calculator.
5644 ;
5645 ; ##################################################
5646 ; Setup step: read var1 and var2 from command line arguments
5647 ; : generate the test log as _tcLogAppend.txt
5648 ; ##################################################
5649 dim $var1
5650 dim $var2
5651 $var1 = $CmdLine[1]
5652 $var2 = $CmdLine[2]
5653  
5654 Local $file = FileOpen("c:/autoItTestsuite/_tcLogAppend.txt", 1)
5655  
5656 If $file = -1 Then
5657 MsgBox(0, "Error", "Unable to open file.")
5658 Exit
5659 EndIf
5660  
5661 ; ##################################################
5662 ; Execution step: start calc and type $var1 and $var2
5663 ; ##################################################
5664 Run("calc.exe")
5665  
5666 WinWaitActive("Calculator")
5667  
5668 AutoItSetOption("SendKeyDelay", 400)
5669 Send($var1&"*"&$var2&"=")
5670  
5671 ; Log what is typed for debugging
5672 FileWrite($file, "Input :"& $var1 &"*"& $var2 & @CRLF)
5673 ; ##################################################
5674 ; Execution step: capture output from the calculator
5675 ; ##################################################
5676 Local $output = WinGetText("[CLASS:CalcFrame]", "")
5677 Sleep(1000)
5678 FileWrite($file, "output:"&$output & @CRLF)
5679  
5680 WinClose("Calculator")
5681 WinWaitClose("Calculator")
5682 FileClose($file)
5683  
5684 ; ##################################################
5685 ; Verification step: $var1 * $var2 = $output
5686 ; ##################################################
5687 ;Verification if $output = 1024 then print Pass
5688 if $output = ($var1 * $var2) then
5689 ConsoleWrite("pass")
5690 else
5691 ConsoleWrite("fail")
5692 endif
5693  
5694 EOF
5695 ;
5696  
5697 0 my $index_pl=<<'EOF1'
5698 #!C:/strawberry/perl/bin/perl.exe
5699 $tcName = "AutoItTestsuite";
5700 if ($^O =~ /win32/i) { $_TAF = "c:"; } if ($^O =~ /linux/i) { $_TAF = "/tmp/var/www/cgi-bin"; }
5701 $tcDir = "$_TAF/$tcName";
5702  
5703  
5704 if ($ARGV[0]) {
5705 open Fout, ">$tcDir/_tcLogAppend.txt";
5706 if ($ARGV[0] == 1) { print &testcase(5 , 6 );}
5707 if ($ARGV[0] == 2) { print &testcase(5.5, 6 );}
5708 if ($ARGV[0] == 3) { print &testcase(5.5, 6.5);}
5709 if ($ARGV[0] == 4) { print &testcase(5.5, 0 );}
5710 close Fout;
5711 } else {
5712 print <<EOF;
5713 1. Test case 1: inteter * integer ( 5 * 6 )
5714 2. Test case 2: float * integer ( 5.5 * 6 )
5715 3. Test case 3: float * float ( 5.5 * 6.5)
5716 4. Test case 4: float * zero ( 5.5 * 0 )
5717 EOF
5718 ;
5719 }
5720  
5721 sub testcase { my $cmd = "\"C:/Program Files (x86)/AutoIt3/AutoIt3\" c:/AutoItTestsuite/calc.au3 $_[0] $_[1]"; return `$cmd`; }
5722 EOF1
5723 ;
5724  
5725 0 open Fout, ">c:/AutoItTestsuite/calc.au3"; print Fout $calcTestsuite; close Fout;
5726 0 open Fout, ">c:/AutoItTestsuite/index.pl"; print Fout $index_pl; close Fout;
5727 }
5728  
5729 sub delDriver_testbed_Window { # Testbed/testbed
5730 #here if ($workingDir =~ /\w+:[\/|\\]\s*$/) { print 'Please do *NOT* run perl -MTest::AutomationFramework -e "install" from rootDir. Run it from non-root directory.'; exit}
5731 0 ▶ if (-e "$c/$_TAF") {;} else { mkpath "$c/$_TAF"; }
Subroutine delDriver_testbed_Window: not called CC=6 SCAR=37.4
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF") { } 0 0 0
5732 0 ▶ if (-e "$c/$_TAF/taf.pl") { ;} else { open Fout, ">$c/$_TAF/taf.pl"; print Fout &prDriver(1); close Fout; print " --> $c/$_TAF/taf.pl\n"; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.pl") { } 0 0 0
5733 0 ▶ if (-e "$c/$_TAF/taf_delete.bat") {;} else {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf_delete.bat") { } 0 0 0
5734  
5735 0 my $testbed4Window =<<EOF;
5736  
5737 REM ------------- Create TC/TS in directory $c/$_TAF...... -----------------------------------
5738  
5739 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite1_${deli}deleteTAFTestsuite
5740 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite2_${deli}deleteTAFTestsuite
5741 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite3_${deli}deleteTAFTestsuite
5742 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite4_${deli}deleteTAFTestsuite
5743  
5744  
5745  
5746 REM ------------- Create TC/TS in $c/_testsuite5_/...... ------
5747 REM generate test suite from TS Hook (index.pl)
5748 $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_${deli}deleteTAFTestsuite
5749 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5750  
5751 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5752 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5753 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5754 $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5755  
5756 REM ------------- Generate sub-Testsuites (_smoketest_, _regression_ ) -----------------------------------
5757 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5758 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5759 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5760  
5761 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5762 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5763 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5764  
5765 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5766 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5767 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5768  
5769 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5770 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5771 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5772  
5773 REM ------------- Generate sub-Testsuies' TAF testsuite ---------------------------------------------------
5774 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5775 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5776 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5777  
5778 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5779 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5780 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5781  
5782 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5783 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5784 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5785  
5786 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5787 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5788 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5789  
5790 REM ------------- Generate Summary of Original Testsuite and its TAG Testsuites by testcaseNode=_null_ ---------------------------------------------------
5791  
5792 $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5793 $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5794  
5795  
5796 REM ------------- Generate sub-Testsuites (_smoketest_, _regression_ ) -----------------------------------
5797 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}deleteTAFTestsuite
5798 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}deleteTAFTestsuite
5799 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}deleteTAFTestsuite
5800  
5801  
5802 $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}deleteTAFTestsuite
5803  
5804 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_full_${deli}deleteTAFTestsuite
5805 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_smoketest_${deli}deleteTAFTestsuite
5806 $perl_ $c/$_TAF/taf.pl testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_regressiontest_${deli}deleteTAFTestsuite
5807 $perl_ $c/$_TAF/taf.pl testcaseNode=_null_${deli}TSHookIsPerl=y${deli}testsuite=$c/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_${deli}deleteTAFTestsuite
5808  
5809  
5810 REM ------------- Scabiality Test${deli} multi-testsuites and testing scanTestsuite --------------------------
5811 REM
5812 REM HelloWorld-testbed powershell-Hook (property = _full_, _smoketest_, _regressiontest_) Note: _powershell_ indicate the testsuite hook is index.ps1, in stead of index.pl
5813  
5814 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}deleteTAFTestsuite
5815 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}deleteTAFTestsuite
5816 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}deleteTAFTestsuite
5817  
5818 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_${deli}deleteTAFTestsuite
5819 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_${deli}deleteTAFTestsuite
5820 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_${deli}deleteTAFTestsuite
5821  
5822 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}deleteTAFTestsuite
5823 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}deleteTAFTestsuite
5824 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}deleteTAFTestsuite
5825  
5826 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}deleteTAFTestsuite
5827 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}deleteTAFTestsuite
5828 $perl_ $c/$_TAF/taf.pl TSHookName=index.ps1${deli}TSHookNameGenerated=index.pl${deli}tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}deleteTAFTestsuite
5829  
5830  
5831 REM Generate index.ps1 -> index.pl for the original TC (_doit_ is deleted)
5832
5833 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}deleteTAFTestsuite
5834 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_${deli}deleteTAFTestsuite
5835 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_${deli}deleteTAFTestsuite
5836 rem $perl_ $c/$_TAF/taf.pl TSHookIsPerl=y${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_${deli}deleteTAFTestsuite
5837  
5838 REM scanTestsuites from testsuite directory - generate root index.html
5839  
5840 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_full_${deli}deleteTAFTestsuite
5841 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_smoketest_${deli}deleteTAFTestsuite
5842 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_regressiontest_${deli}deleteTAFTestsuite
5843  
5844 $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_full_${deli}deleteTAFTestsuite
5845 $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_smoketest_${deli}deleteTAFTestsuite
5846 $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_regressiontest_${deli}deleteTAFTestsuite
5847  
5848  
5849 $perl_ $c/_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_full_${deli}deleteTAFTestsuite
5850 $perl_ $c/_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_smoketest_${deli}deleteTAFTestsuite
5851 $perl_ $c/_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_regressiontest_${deli}deleteTAFTestsuite
5852  
5853  
5854 REM ------------- Scabiality Test: multi-testsuites and testing scanTestsuite --------------------------
5855  
5856  
5857 REM ------------- Update testbed' s _thProperties.txt[s] by generateRootIndex
5858  
5859 $perl_ $c/$_TAF/taf.pl printTestBedProperties${deli}generateRootIndex
5860  
5861 $perl_ $c/$_TAF/taf.pl generateRootIndex
5862  
5863 taf.pl refreshHost
5864 taf.pl testsuite=c:/_testsuite10_;refreshHost
5865  
5866 EOF
5867  
5868 0 open Fout, ">$c/$_TAF/taf_delete.txt"; print Fout $testbed4Window; close Fout; print " --> $c/$_TAF/taf_delete.txt\n"; my $cmd = "$c/$_TAF/taf_delete.txt";
5869 0 open Fout, ">$c/$_TAF/taf_delete.bat"; print Fout $testbed4Window; close Fout; print " --> $c/$_TAF/taf_delete.bat\n"; $cmd = "$c/$_TAF/taf_delete.bat";
5870 # if ($^O =~ /win32/i) {if ( &enterY("Execute $c/$_TAF/taf_delete.bat (y/n)? ") =~ /y/) {system $cmd;} }
5871  
5872  
5873 0 ▶ if ($^O =~ /win32/i) { print " Please exec $cmd to teardown testbed\n";}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 0 0
5874 0 ▶ if ($^O =~ /linux/i) { print " Please exec $cmd to teardown testbed\n";}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 0 0 0
5875  
5876 }
5877  
5878 0 1;
5879 }
5880  
5881  
5882  
5883 sub delDriver_testbed_Linux { # Testbed/testbed
5884 0 ▶ if ( -e "$c/$_TAF") {;} else { mkpath "$c/$_TAF"; }
Subroutine delDriver_testbed_Linux: called CC=7 SCAR=20.7
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF") { } 2 0 2
5885 2 ▶ if ($^O =~ /linux/i) {`/usr/bin/sudo /bin/chmod -R ugo+rwx $c`;}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 2 0 2
5886 0 ▶ if (-e "$c/$_TAF/taf.pl") {;} else { open Fout, ">$c/$_TAF/taf.pl"; print Fout &prDriver(1); close Fout; print " --> $c/$_TAF/taf.pl\n"; }
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf.pl") { } 2 0 2
5887 2 ▶ if (-e "$c/$_TAF/taf_delete.sh") {;} else {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$c/$_TAF/taf_delete.sh") { } 1 1 2
5888  
5889 1 my $testbed4Linux=<<EOF;
5890  
5891  
5892 /usr/bin/sudo chmod -R ugo+rwx $c
5893 /usr/bin/sudo chmod -R go-wx $c
5894  
5895 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite1_${deli}deleteTAFTestsuite
5896 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite2_${deli}deleteTAFTestsuite
5897 rem /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite3_${deli}deleteTAFTestsuite
5898 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite4_${deli}deleteTAFTestsuite
5899  
5900 /usr/bin/sudo chmod -R ugo+rwx $c
5901 /usr/bin/sudo chmod -R go-wx $c
5902  
5903 # ------------- Create TC/TS in $c/_testsuite5_/...... ------
5904 # generate test suite from TS Hook (index.pl)
5905 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}deleteTAFTestsuite
5906 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}deleteTAFTestsuite
5907 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}deleteTAFTestsuite
5908 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}deleteTAFTestsuite
5909  
5910 /usr/bin/sudo chmod -R ugo+rwx $c
5911 /usr/bin/sudo chmod -R go-wx $c
5912  
5913 # ------------- generate TAF testsuite ($c/_testsuite5_/... -> $c/_TAF/_testsuite5_/...)
5914 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1${deli}deleteTAFTestsuite
5915 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1${deli}deleteTAFTestsuite
5916 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1${deli}deleteTAFTestsuite
5917 #/usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1${deli}deleteTAFTestsuite
5918  
5919 # ------------- Generate Perl testsuite with different tags (_smoketest_, _regression_ ) -----------------------------------
5920  
5921 /usr/bin/sudo chmod -R ugo+rwx $c
5922 /usr/bin/sudo chmod -R go-wx $c
5923 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5924 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5925 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5926 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5927  
5928 /usr/bin/sudo chmod -R ugo+rwx $c
5929 /usr/bin/sudo chmod -R go-wx $c
5930  
5931 # ------------- Generate sub-Testsuites (_smoketest_, _regression_ ) -----------------------------------
5932 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5933 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5934 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5935  
5936  
5937 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5938 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5939 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5940  
5941 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5942 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5943 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl${deli}deleteTAFTestsuite
5944  
5945 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5946 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5947 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl${deli}deleteTAFTestsuite
5948  
5949 /usr/bin/sudo chmod -R ugo+rwx $c
5950 /usr/bin/sudo chmod -R go-wx $c
5951  
5952 # ------------- Generate sub-Testsuies' TAF testsuite ---------------------------------------------------
5953 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5954 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5955 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5956  
5957 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5958 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5959 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5960  
5961 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5962 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5963 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5964  
5965 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_full_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_full_${deli}deleteTAFTestsuite
5966 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_smoketest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_smoketest_${deli}deleteTAFTestsuite
5967 /usr/bin/sudo $perl_ $c/$_TAF/taf.pl tcPropertyName=_regressiontest_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_regressiontest_${deli}deleteTAFTestsuite
5968  
5969 /usr/bin/sudo chmod -R ugo+rwx $c
5970 /usr/bin/sudo chmod -R go-wx $c
5971  
5972 # ------------- Generate Summary of Original Testsuite and its TAG Testsuites by testcaseNode=_null_ ---------------------------------------------------
5973  
5974 /usr/bin/sudo $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl${deli}deleteTAFTestsuite
5975 /usr/bin/sudo $perl_ $c/_TAF/taf.pl testcaseNode=_null_${deli}testsuite=$c/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl${deli}deleteTAFTestsuite
5976  
5977 /usr/bin/sudo chmod -R ugo+rwx $c
5978 /usr/bin/sudo chmod -R go-wx $c
5979  
5980 taf.pl refreshHost
5981 taf.pl testsuite=c:/_testsuite10_;refreshHost
5982  
5983 EOF
5984  
5985 1 open Fout, ">$c/$_TAF/taf_delete.txt"; print Fout $testbed4Linux; close Fout; print " --> $c/$_TAF/taf_delete.txt\n"; my $cmd = "$c/$_TAF/taf_delete.txt";
5986 1 open Fout, ">$c/$_TAF/taf_delete.sh" ; print Fout $testbed4Linux; close Fout; print " --> $c/$_TAF/taf_delete.sh\n"; $cmd = "$c/$_TAF/taf_delete.sh";
5987  
5988 1 ▶ if ($^O =~ /linux/i) { `/usr/bin/sudo /bin/chmod -R ugo+rwx $c`;}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 1 0 1
5989 1 ▶ if ($^O =~ /linux/i) { print "Please exec $cmd manually\n";} }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 1 0 1
5990  
5991  
5992 2 1;
5993 }
5994  
5995 ##############
5996  
5997  
5998 #sub enterY { print shift ; $_ = &getYorN(); if (($_ =~ /n/i) || ($_ =~ /^\s*$/)) { return "n"; } if ($_ =~ /y/i) { return "y"; } }
5999  
6000 #sub timed_input {
6001 # my $end_time = time + shift;
6002 # my $default = "timed_input_default"; $default = shift if (@_);
6003 # my $string ;
6004 # do {
6005 # my $key = ReadKey(1);
6006 # print $key if defined $key;
6007 # $string .= $key if defined $key;
6008 # } while (time < $end_time);
6009 # return $string;
6010 #};
6011  
6012 # sub getYorN { my $input = &timed_input(6); if ($input) { return $input ; } else { return "n";} }
6013  
6014 0 ▶sub install { &genDriver(); 1; } #### install is replaced by genDriver () . it is kept for backwards compatible
Subroutine install: not called CC=1 SCAR=6.9
Pod documented
6015  
6016  
6017 sub printTestBedProperties {
6018 ############ Generate taf Property file for _testsuite1_
6019 0 ▶ mkpath "$c/$_TAF/_testsuite1_";
Subroutine printTestBedProperties: not called CC=1 SCAR=6.9
Pod undocumented
6020 0 open Fout, ">$c/$_TAF/_testsuite1_/tsProperty.txt";
6021 0 my $str = <<EOF;
6022 There is no $c/$_TAF/_testsuite1_/tsProperty.txt for c:/_TAF/_testsuite1_. This is as designed.
6023 EOF
6024 0 print Fout $str;
6025 0 close Fout;
6026 ############ Generate taf Property file for _testsuite1_
6027  
6028 ############ Generate taf Property file for _testsuite2_
6029 0 mkpath "$c/$_TAF/_testsuite2_";
6030 0 open Fout, ">$c/$_TAF/_testsuite2_/tsProperty.txt";
6031 0 $str = <<EOF;
6032 There is no $c/$_TAF/_testsuite2_/tsProperty.txt for $c/$_TAF/_testsuite2_. This is as designed.
6033 EOF
6034 0 print Fout $str;
6035 0 close Fout;
6036 ############ Generate taf Property file for _testsuite2_
6037  
6038  
6039  
6040 ############ Generate taf Property file for _testsuite3_
6041 0 mkpath "$c/$_TAF";
6042 0 open Fout, ">$c/$_TAF/_blabla.html";
6043 0 $str=<<EOF;
6044 <html><body><pre>
6045 This is a demo for URL link in log
6046 </pre></body></html>
6047 EOF
6048 0 print Fout $str;
6049 0 close Fout;
6050  
6051 0 open Fout, ">$c/$_TAF/_testLog.txt";
6052 0 $str=<<EOF;
6053 This is a demo for Log in Log (Recursive Log)
6054 EOF
6055 0 print Fout $str;
6056 0 close Fout;
6057  
6058 0 open Fout, ">$c/$_TAF/_testLog.htm";
6059 0 $str=<<EOF;
6060 <html><bod><pre>
6061 This is a demo for *.htm in Log (Recursive Log)
6062 </pre></body></html>
6063 EOF
6064 0 print Fout $str;
6065 0 close Fout;
6066  
6067  
6068  
6069 0 mkpath "$c/$_TAF/_testsuite3_";
6070 0 open Fout, ">$c/$_TAF/_testsuite3_/tsProperty.txt";
6071 0 $str = <<EOF;
6072 web_ui_title: Test Automation Framework : web_ui_title
6073 $c/$_TAF/_testsuite3_/testcase0001| 1 Test case 1 description Manual edit please
6074 $c/$_TAF/_testsuite3_/testcase0002| 2 Test case 2 Perform TC for tsProperty.txt Manual edit please
6075 $c/$_TAF/_testsuite3_/testcase0003| 3 Test case 3 Fail TC for .. tsProperty.txt Manual edit please
6076 $c/$_TAF/_testsuite3_/testcase0004| 4 Test case 4 Pass TC for ... tsProperty.txt Manual edit please
6077 $c/$_TAF/_testsuite3_/testcase0005| 5 Test case 5 Fail TC for .... tsProperty.txt Manual edit please
6078 $c/$_TAF/_testsuite3_/testcase0006| 6 Test case 6 TC /w Log for ..... tsProperty.txt Manual edit please
6079 $c/$_TAF/_testsuite3_/testcase0007| 7 Test case 7 _Expected_Fail_ for ... tsProperty.txt Manual edit please
6080 $c/$_TAF/_testsuite3_/testcase0008| 8 Test case 8 _Expected_Fail_ for ... tsProperty.txt Manual edit please
6081 $c/$_TAF/_testsuite3_/testcase0009| 9 Test case return Expected_f_a_i_l for ... tsPro Manual edit please
6082 $c/$_TAF/_testsuite3_/testcase0010| 10 Test case return expF for ... tsPro Manual edit please
6083 $c/$_TAF/_testsuite3_/testcase0011| 11 Test case return bugF for ... tsPro Manual edit please
6084 EOF
6085 0 print Fout $str;
6086 0 close Fout;
6087  
6088 ############ Generate taf Property file for _testsuite3_
6089
6090 0 mkpath "$c/$_TAF/_testsuite4_";
6091 0 open Fout, ">$c/$_TAF/_testsuite4_/tsProperty.txt";
6092 0 $str = <<EOF;
6093 web_ui_title: Testcase/Testsuite Property Operation Test Suite : web_ui_title
6094 $c/$_TAF/_testsuite4_/testcase0001| 1 Test case 1 add testcase Property1 = propertyValue1
6095 $c/$_TAF/_testsuite4_/testcase0002| 2 Test case 2 get testcase Property1 = propertyValue1A
6096 $c/$_TAF/_testsuite4_/testcase0003| 3 Test case 3 add testsuite Property
6097 $c/$_TAF/_testsuite4_/testcase0004| 4 Test case 4 get testsutie Property
6098 EOF
6099 0 print Fout $str;
6100 0 close Fout;
6101  
6102 ############ Generate taf Property file for webUI tc description
6103 0 mkpath "$c/$_TAF";
6104 0 open Fout, ">$c/$_TAF/tsProperty.txt";
6105 0 print Fout<<EOF;
6106 web_ui_title: Test Automation Framework : web_ui_title
6107 $c/$_TAF/_testsuite1_|0001 TAF Testbed 1 : Test Case Management: TC list, TC execution, TC Reporting /o TC Description
6108 $c/$_TAF/_testsuite2_|0002 TAF Testbed 2 : Test Case Management: TC list, TC execution, TC Reporting /o TC Description
6109 $c/$_TAF/_testsuite3_|0003 TAF Testbed 3 : Test Case Management: Concurrency, Performance TCs, TC Logging, TC Description
6110 $c/$_TAF/_testsuite4_|0004 TAF Testbed 4 : Test Case Management: Property operations : add/get properties
6111  
6112 $c/$_TAF/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite1_/_TS1|0007 TAF Testbed 7 : Test Suite Management: Multiple test suite coexistence (testsuite1)
6113 $c/$_TAF/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite2_/_TS1|0008 TAF Testbed 8 : Test Suite Management: Multiple test suite coexistence (testsuite2)
6114 $c/$_TAF/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite3_/_TS1|0009 TAF Testbed 9 : Test Suite Management: Multiple test suite coexistence (testsuite3)
6115 $c/$_TAF/_testsuite5_non_TAF_/_testsuiteTestBed/_testsuite4_/_TS1|0010 TAF Testbed 10: Test Suite Management: Multiple test suite coexistence (testsuite4)
6116  
6117 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl|0011 TAF Testbed 11: ts1: perl testsuite hook /o tags _smoketest_, _regressiontest_
6118 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl|0012 TAF Testbed 12: ts2: perl testsuite hook /o tags _smoketest_, _regressiontest_
6119 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl|0013 TAF Testbed 13: ts3: perl testsuite hook /o tags _smoketest_, _regressiontest_
6120 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl|0014 TAF Testbed 14: ts4: perl testsuite hook /o tags _smoketest_, _regressiontest_
6121  
6122 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl|0015 TAF Testbed 15: Test Suite Management: Perl Script Automation Test Suite 1 (_full_, _smoketest_, _regressiontest_)
6123 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_full_|0016 TAF Testbed 16: Test Suite Management: sub Test Suite (_full_)
6124 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_regressiontest_|0017 TAF Testbed 17: Test Suite Management: sub Test Suite (_regressiontest_)
6125 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl/_smoketest_|0018 TAF Testbed 18: Test Suite Management: sub Test Suite (_smoketest_)
6126  
6127  
6128 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl|0019 TAF Testbed 19: Test Suite Management: Perl Script Automation Test Suite 2 (_full_, _smoketest_, _regressiontest_)
6129 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_full_|0020 TAF Testbed 20: Test Suite Management: sub Test Suite (_full_)
6130 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_regressiontest_|0021 TAF Testbed 21: Test Suite Management: sub Test Suite (_regressiontest_)
6131 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites2_/_testsuite_pl/_smoketest_|0022 TAF Testbed 22: Test Suite Management: sub Test Suite (_smoketest_)
6132  
6133  
6134 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl|0023 TAF Testbed 23: Test Suite Management: Perl Script Automation Test Suite 3 (_full_, _smoketest_, _regressiontest_)
6135 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_full_|0024 TAF Testbed 24: Test Suite Management: sub Test Suite (_full_)
6136 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_regressiontest_|0025 TAF Testbed 25: Test Suite Management: sub Test Suite (_regressiontest_)
6137 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites3_/_testsuite_pl/_smoketest_|0026 TAF Testbed 26: Test Suite Management: sub Test Suite (_smoketest_)
6138  
6139  
6140 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl|0027 TAF Testbed 27: Test Suite Management: Perl Script Automation Test Suite 4 (_full_, _smoketest_, _regressiontest_)
6141 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_full_|0028 TAF Testbed 28: Test Suite Management: sub Test Suite (_full_)
6142 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_regressiontest_|0029 TAF Testbed 29: Test Suite Management: sub Test Suite (_regressiontest_)
6143 $c/$_TAF/_perlTestsuite_/AppBuildpath/_automated_testsuites4_/_testsuite_pl/_smoketest_|0030 TAF Testbed 30: Test Suite Management: sub Test Suite (_smoketest_)
6144  
6145  
6146 $c/$_TAF/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_|0031 TAF Testbed 31: Test Suite Management: Powershell Script Automation Test Suite(_full_, _smoketest_, _regressiontest_)
6147 $c/$_TAF/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_full_|0032 TAF Testbed 32: Test Suite Management: (_full_)
6148 $c/$_TAF/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_smoketest_|0033 TAF Testbed 33: Test Suite Management: (_smoketest_)
6149 $c/$_TAF/_powershellTestsuite_/AppBuildpath/_automated_testsuites_/_testsuite_ps1_/_regressiontest_|0034 TAF Testbed 34: Test Suite Management: (_regressiontest_)
6150  
6151 REM testsuite Desc (tsDesc) example
6152 $c/$_TAF/Autobat/Bat|Testsuite : Test suite of Tree structure and Test suite Node functon
6153 $c/$_TAF/Autobat/Bat/QA_Tests|TAF Testsuite : Test suite Tree structure and Test suite Node function
6154 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests|TAF Testsuite : Test suite Tree structure and Test suite Node function
6155  
6156  
6157 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_|0035 TAF Testbed 35: Test suite Tree structure: Test suite Node (in develop) of testsuite1
6158 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_full_|0036 TAF Testbed 36: Test Suite Management: Test Suite Hook (testsuite1/index.ps1) (_full_, _smoketest_, _regressiontest_)
6159 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_regressiontest_|0037 TAF Testbed 37: Test Suite Management: (_regression tests_)
6160 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite1_/_smoketest_|0038 TAF Testbed 38: Test Suite Management: (_smoketest_)
6161  
6162 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_|0039 TAF Testbed 39: Test suite Tree structure: Test suite Node (in develop) of testsuite1
6163 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_full_|0040 TAF Testbed 40: Test Suite Management: Test Suite Hook (testsuite2/index.ps1) (_full_, _smoketest_, _regressiontest_)
6164 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_regressiontest_|0041 TAF Testbed 41: Test Suite Management: (_regression tests_)
6165 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite2_/_smoketest_|0042 TAF Testbed 42: Test Suite Management: (_smoketest_)
6166  
6167 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_|0043 TAF Testbed 43: Test suite Tree structure: Test suite Node (in develop) of testsuite1
6168 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_full_|0044 TAF Testbed 44: Test Suite Management: Test Suite Hook (testsuite3/index.ps1) (_full_, _smoketest_, _regressiontest_)
6169 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_regressiontest_|0045 TAF Testbed 45: Test Suite Management: (_regression tests_)
6170 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite3_/_smoketest_|0046 TAF Testbed 46: Test Suite Management: (_smoketest_)
6171  
6172 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_|0047 TAF Testbed 47: Test suite Tree structure: Test suite Node (in develop) of testsuite1
6173 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_/_full_|0048 TAF Testbed 48: Test Suite Management: Test Suite Hook (testsuite4/index.ps1) (_full_, _smoketest_, _regressiontest_)
6174 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_/_regressiontest_|0049 TAF Testbed 49: Test Suite Management: (_regression tests_)
6175 $c/$_TAF/Autobat/Bat/QA_Tests/BATtests/BAT/Automation_testsuite4_/_smoketest_|0050 TAF Testbed 50: Test Suite Management: (_smoketest_)
6176  
6177  
6178 EOF
6179 0 close Fout;
6180 0 1;
6181 }
6182  
6183 ###########
6184  
6185 sub prDriverSvr {
6186 1 ▶my $driver=<<'EOF';
Subroutine prDriverSvr: called CC=2 SCAR=7.2
Pod undocumented
6187 #!/usr/bin/perl
6188 {
6189 package MyWebServer;
6190
6191 use HTTP::Server::Simple::CGI;
6192 use base qw(HTTP::Server::Simple::CGI);
6193 my %dispatch = (
6194 '/hello' => \&resp_hello,
6195 );
6196 my $root = "c:/_TAF"; if ($^O =~ /win32/i ) { ;} elsif ($^O =~ /linux/i) { $root="/tmp/var/www/cgi-bin/_TAF";}
6197
6198 sub handle_request {
6199 my $self = shift;
6200 my $cgi = shift;
6201
6202 my $path = $cgi->path_info();
6203 my $handler = $dispatch{$path};
6204
6205 if (ref($handler) eq "CODE") {
6206 print "HTTP/1.0 200 OK\r\n"; $handler->($cgi);
6207 } elsif (-e "${root}${path}") {
6208 print "HTTP/1.0 200 OK\r\n";
6209 if (${path} !~ /taf\.cgi/i) { #### display html file
6210 print $cgi->header , $cgi->start_html("$root$path");
6211 open Fin, "$root$path"; @_ = <Fin>; close Fin; my $content = "@_"; print $cgi->body($content);
6212 print $cgi->end_html;
6213 } else { #### process taf.cgi
6214 ######################## sub taf_cgi {
6215  
6216 my $tafArgs = "help";
6217 $tafArgs = $cgi->param("tafArgs");
6218 if (($tafArgs =~ /exitTAFGracefullyString/i) && ($tafArgs !~ /;exitTAF/i)) { $tafArgs = $tafArgs.";exitTAF";}
6219 if ($^O =~ /win32/i ) { $tafArgs =~ s/_semi_/;/g; } if ($^O =~ /linux/i ) { $tafArgs =~ s/_semi_/\~/g; }
6220 $tafArgs =~ s/exitTAF=_null_/exitTAF/g;
6221 my $tafRedirectory = $cgi->param("tafRedirectory");
6222 my $refreshRate = 5;
6223 print $cgi->header, $cgi->start_html("$root$path");
6224 print "<pre>";
6225 if (($tafArgs =~ /Execution_local_only=y/i) && ($tafArgs =~ /Execution_from_cgi=y/i)) {
6226 print "This test can NOT be executed over the network. Pleae execute the test from host w-PC/192.168.0.140. To Turn ON Remote Execution, email the administrator. \n" ;
6227 } else {
6228 my $cmd = "start c:/_TAF/taf.pl $tafArgs";
6229 if ($^O =~ /win32/i) { ; } elsif ( $^O =~ /linux/i) { $cmd = "/usr/bin/perl /tmp/var/www/cgi-bin/_TAF/taf.pl $tafArgs"; }
6230 print "Running at _host_/_ip_: $cmd\n";
6231 print "Waiting ......\n";
6232 system $cmd;
6233 }
6234  
6235 print<<EOF1;
6236 </pre>
6237 <meta http-equiv="refresh" content="$refreshRate; url=$tafRedirectory">
6238 EOF1
6239 print $cgi->end_html ;
6240 ####################### }
6241 }
6242 } else {
6243 print "HTTP/1.0 404 Not found\r\n";
6244 print $cgi->header, $cgi->start_html('Not found'), $cgi->body("${root}$path is Not found");
6245 if (-e "${root}${path}") {
6246 open Fin, "$root$path";
6247 @_ = <Fin>; close Fin;
6248 my $content = "@_";
6249 print $cgi->body("$content");
6250 }
6251 print $cgi->end_html;
6252 }
6253 }
6254  
6255
6256  
6257 sub resp_hello {
6258 my $cgi = shift; # CGI.pm object
6259 return if !ref $cgi;
6260
6261 my $who = $cgi->param('name');
6262 my $dir = `C:/strawberry/perl/bin/perl.exe c:/_TAF/taf.pl -help`;
6263 open Fin, "c:/_TAF/_blabla.html";
6264 @_ = <Fin>; $file = "@_"; $file ="@_";
6265 close Fin;
6266 my $pathinfo = $cgi->path_info();
6267 my $fullpath = $cgi->url(-full=>1);
6268 print $cgi->header, $cgi->start_html("Hello"),
6269 $cgi->body("$file, $pathinfo, $fullpath"),
6270 $cgi->end_html;
6271 }
6272  
6273
6274 }
6275
6276 # start the server on port 8080
6277 my $httpport = 8080;
6278 if ($^O =~ /win32/i) {;} elsif ($^O =~ /linux/i) { $httpport = "1234"; }
6279 my $pid = MyWebServer->new($httpport)->background();
6280 print "Use 'kill $pid' to stop server.\n";
6281  
6282 EOF
6283  
6284 1 $driver =~ s/_host_/$hostname/ig;
6285 1 $driver =~ s/_ip_/$ip/ig;
6286 ;
6287 # $c = "c:"; $_TAF = "_TAF";
6288 # open Fout, ">$c/$_TAF/taf.svr"; print Fout $driver ; close Fout; print " ->$c/$_TAF/taf.svr";
6289 0 ▶if (@_) { return $driver;} else { print $driver;}
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 1 0 1
6290 }
6291 ###########
6292 sub prDriver {
6293 1 ▶ my $driver=<<EOF;
Subroutine prDriver: called CC=2 SCAR=7.6
Pod undocumented
6294 #!/usr/bin/perl
6295 use Test::AutomationFramework;
6296 use Getopt::Long;
6297 GetOptions(
6298 'processTSs=s' => \\\$processTSs,
6299 'processTCs|settings|s=s' => \\\$processTCs,
6300 'processTC|tc=s' => \\\$processTC,
6301 'processProperty|property=s' => \\\$processProperty,
6302 'help' => \\\$help,
6303 );
6304 \$TAF = new Test::AutomationFramework;
6305 if (\$help) {\$TAF->help();}
6306 if (\$prDriver) {\$TAF->prDriver();}
6307 if (\$processTSs) { \$TAF->processTSs(\$processTSs);}
6308 if (\$processTCs) { \$TAF->processTCs(\$processTCs);}
6309 if (\$processProperty) { \$TAF->processProperty(\$processProperty);}
6310 if (\$processTC) { \$TAF->processTC(\$processTC);}
6311 if (\$scanTestsuites) { \$TAF->scanTestsuites();}
6312 \$cmdLine = \$TAF->getTAFArgsFromFile();
6313 if (\$cmdLine) {;} else {foreach \$each (\@ARGV) {\$cmdLine =\$cmdLine.\$each.';'; } }
6314 \$cmdLine =~ s/\\\~/;/g; # Linux porting
6315  
6316 # Single Uer mode
6317 # Mult-user mode: can be done by modifying taf.pl
6318  
6319 \$TAF->processTCs(\$cmdLine);
6320 # print "debug: taf: done. Please uncomment this from taf.pl\\n";
6321  
6322 exit;
6323  
6324 if (\$cmdLine =~ /releaseLock/i) { \$TAF->Queue("releaseLock"); exit;}
6325 if (\$cmdLine =~ /exitTAF/i) { \$TAF->processTCs(\$cmdLine); \$TAF->Queue("releaseLock"); } else { if (\$cmdLine) {\$TAF->Queue("push",\$cmdLine);} }
6326 if (\$TAF->Queue("checkLock") > 0) { print "The task is in queue. The lock (\$c/\$_TAF/taf.lock) exist!\\n"; exit;}
6327 \$TAF->Queue("setLock");
6328 while (\$TAF->Queue("queueSize") > 0 ) { \$cmdLine = \$TAF->Queue("pop"); \$TAF->processTCs(\$cmdLine); }
6329 \$TAF->Queue("updateQueue");
6330 \$TAF->Queue("releaseLock");
6331 # \$TAF->generateRootIndex();
6332 # \$TAF->Queue("releaseLock");
6333  
6334 # if (\$TAF->Queue("checkLock") > 0) { print "The task is in queue. (c:/_TAF/taf.lock exist!\\n"; exit;}
6335 # \$TAF->Queue("setLock"); while (\$TAF->Queue("queueSize") > 0 ) { \$cmdLine = \$TAF->Queue("pop"); \$TAF->processTCs(\$cmdLine); \$TAF->Queue("releaseLock"); }
6336 # \$TAF->generateRootIndex();
6337 ## \$TAF->Queue("releaseLock");
6338 EOF
6339 0 ▶if (@_) { return $driver;} else { print $driver;}
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 1 0 1
6340 }
6341  
6342  
6343 sub prDriverCGI {
6344  
6345  
6346 1 ▶my $perl_loc ;
Subroutine prDriverCGI: called CC=6 SCAR=19.9
Pod undocumented
6347 0 ▶if ($^O =~ /win32/i) { $perl_loc = "#!c:/strawberry/perl/bin/perl.exe";}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 1 1
6348 1 ▶if ($^O =~ /linux/i) { $perl_loc = "#!/usr/bin/perl";}
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 1 0 1
6349  
6350 1 my $cmdFormat ;
6351 0 ▶if ($^O =~ /win32/i) { $cmdFormat = "my \$cmd = \"start c:/_TAF/taf.pl \$tafArgs\""; }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win32/i) 0 1 1
6352 1 ▶if ($^O =~ /linux/i) { $cmdFormat = "my \$cmd = \"/usr/bin/perl $c/$_TAF/taf.pl \$tafArgs\""; }
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 1 0 1
6353  
6354  
6355 1 my $driver=<<EOF;
6356 $perl_loc
6357 use strict;
6358 use warnings;
6359 use CGI ":all";
6360 my \$q = new CGI;
6361 my \$tafArgs = "help";
6362 \$tafArgs = \$q->param("tafArgs");
6363 if ((\$tafArgs =~ /exitTAFGracefullyString/i) && (\$tafArgs !~ /;exitTAF/i)) { \$tafArgs = \$tafArgs.";exitTAF";}
6364 if (\$^O =~ /win32/i ) { \$tafArgs =~ s/_semi_/;/g; }
6365 if (\$^O =~ /linux/i ) { \$tafArgs =~ s/_semi_/\\~/g; }
6366  
6367 \$tafArgs =~ s/exitTAF=_null_/exitTAF/g;
6368  
6369 my \$tafRedirectory = \$q->param("tafRedirectory");
6370 my \$refreshRate = 5;
6371  
6372 print \$q->header(); print \$q->start_html(); print "<pre>";
6373  
6374 # ################## add Remove_or_local_execution variable here and in TAF
6375 if ((\$tafArgs =~ /Execution_local_only=y/i) && (\$tafArgs =~ /Execution_from_cgi=y/i)) {
6376 print "This test can NOT be executed over the network. Pleae execute the test from host $hostname/$ip. To Turn ON Remote Execution, email the administrator. \\n" ;
6377 } else {
6378 #if (\$tafArgs =~ /Again/) { \$refreshRate = 50000000; }
6379 # my \$cmd = "start c:/_TAF/taf.pl \$tafArgs"; # todo
6380 $cmdFormat;
6381 #print \$q->param("tafArgs"); print "\\n-----------\\n";
6382 #print \$q->param("tafRedirectory"); print "\\n-----------\\n";
6383 print "Running at $hostname/$ip: \$cmd\\n";
6384 system \$cmd;
6385 }
6386  
6387 print<<EOF1;
6388 </pre>
6389 <meta http-equiv="refresh" content="\$refreshRate; url=\$tafRedirectory">
6390 EOF1
6391 print \$q->end_html ;
6392  
6393 EOF
6394  
6395  
6396 0 ▶if (@_) { return $driver;} else { print $driver;}
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 1 0 1
6397 }
6398  
6399 ################################################################################
6400 # Subroutine Name : getDate
6401 # Function: get current Datetime
6402 # Input Parameters:
6403 # Output/Returns : currentDate in the format of 2010-10-02 12:11:22
6404 ################################################################################
6405 sub getDate ( ) { # TH:Generic Functions: get current Time (TH:Generic Functions)
6406 43 ▶ my ( $y, $m, $d, $hh, $mm, $ss ) = (localtime)[ 5, 4, 3, 2, 1, 0 ];
Subroutine getDate: called CC=1 SCAR=0.0
Pod undocumented
6407 43 $y += 1900;
6408 43 $m++;
6409 43 my $iso_sale_time =
6410 sprintf( "%d-%02d-%02d %02d:%02d:%02d", $y, $m, $d, $hh, $mm, $ss );
6411 43 $iso_sale_time;
6412 }
6413  
6414  
6415 sub sortCmdLog {
6416 0 ▶my %record;
Subroutine sortCmdLog: not called CC=6 SCAR=37.4
Pod undocumented
6417 0 open Fin, "$c/$_TAF/_cmdLogs.txt";
6418 0 ▶while (<Fin>) { if ($_ =~ /(.+)>\s+/) { if ( &Date_Cmp (&DateCalc("now", "+0 day"), &DateCalc("now", $commandLogLifeSpan)) >= 0 ) {$record{$1} = $_;} } } close Fin;
Branch: 3 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ /(.+)>\s+/) 0 0 0
if (&Date_Cmp(&DateCalc("now", "+0 day"), &DateCalc("now", $commandLogLifeSpan)) >= 0) 0 0 0
6419 0 ▶open Fout, "> $c/$_TAF/_cmdLogs.txt_"; foreach my $each (reverse sort keys %record) { $record{$each} =~ s/\s*\n$//g; if ($record{$each}) {print Fout "$record{$each}\n";} } close Fout;
Branch: 1 branch
BranchTrueFalseTotal
if ($record{$each}) 0 0 0
6420 0 copy ("$c/$_TAF/_cmdLogs.txt_", "$c/$_TAF/_cmdLogs.txt");
6421 }
6422  
6423 ################################################################################
6424 # Subroutine Name : appendtoFile
6425 # Function: append text to a file
6426 # Input Parameters: 1 Filename 2 String
6427 # Output/Returns : New File with the appened text
6428 ################################################################################
6429 sub appendtoFile() { # TH:Generic Functions: append to file (TH:Generic Functions)
6430 16 ▶ my $fname = $_[0];
Subroutine appendtoFile: called CC=1 SCAR=0.0
Pod undocumented
6431 16 open Fout, ">>$fname";
6432 16 print Fout "$_[1]";
6433 16 close Fout;
6434 }
6435  
6436 sub appendtoFileStart() { # TH:Generic Functions: append to file (TH:Generic Functions)
6437 0 ▶ my $fname = $_[0];
Subroutine appendtoFileStart: not called CC=2 SCAR=17.9
Pod undocumented
6438 0 ▶ if (-e $fname ) { open Fin, $fname; @_=<Fin>; close Fin;}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) 0 0 0
6439 0 open Fout, ">>$fname";
6440 0 print Fout "$_[1]\n";
6441 0 print Fout @_;
6442 0 close Fout;
6443 }
6444  
6445  
6446 ################################################################################
6447 # Subroutine Name : appendtoFileFile
6448 # Function: append file1 to file2
6449 # Input Parameters: 1 Filename 2 String
6450 # Output/Returns : New File with the appened text
6451 ################################################################################
6452 sub appendtoFileFile() { # TH:Generic Functions: append file to file (TH:Generic Functions)
6453 0 ▶ my $fname = $_[0]; my $fnameOUT = $_[1];
Subroutine appendtoFileFile: not called CC=4 SCAR=30.0
Pod undocumented
6454 0 ▶ open Fin, "$fname" || die "Can't open $fname:$!";
Condition0%0/2
"$fname" || die("Can't open ${fname}:$!")
l!l
00
MC/DC0%0/1
"$fname" || die("Can't open ${fname}:$!")
"$fname"
Truth table0%0/2
A
A= "$fname"
Aresult
11
00
6455 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6456 0 ▶ &appendtoFile($fnameOUT, $_) if ($_ !~ /^\s*$/);
Branch: 1 branch
BranchTrueFalseTotal
unless $_ =~ /^\s*$/ 0 0 0
6457 }
6458 0 close Fin;
6459 }
6460  
6461  
6462 sub appendtoFileUniq_ { # fname, fileContent, maxTCExecTime
6463 0 ▶ my $fname = "e.txt" ; $fname = shift if @_;
Subroutine appendtoFileUniq_: not called CC=12 SCAR=50.5
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6464 0 ▶ my $content = "" ; $content = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6465 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6466 0 my $fname_ = $fname."_" ;
6467 0 my %record;
6468 0 ▶ while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname_) 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6469 #if (-e $fname ){
6470 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1) {;} else { &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1,"") };
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml1) { } 0 0 0
6471 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http) {;} else { &createFile_($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml1_http,"") };
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml1_http) { } 0 0 0
6472 0 ▶ open Fin , "$fname"; while ($_ = <Fin>) { my $_tmp = $_; $_tmp =~ s/_semi_/;/g; if ($_tmp =~ /exitTAFGracefullyString=(.+)\s*;\s*exitTAF/) { $record{$1} = $_; } } close Fin;
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
if ($_tmp =~ /exitTAFGracefullyString=(.+)\s*;\s*exitTAF/) 0 0 0
6473 #}
6474 0 ▶ my $content_tmp = $content; $content_tmp =~ s/_semi_/;/g; if ( $content_tmp =~ /exitTAFGracefullyString=(.+)\s*;\s*exitTAF/) {$record{$1} = $content;}
Branch: 1 branch
BranchTrueFalseTotal
if ($content_tmp =~ /exitTAFGracefullyString=(.+)\s*;\s*exitTAF/) 0 0 0
6475 # open Fout, ">$fname_"; foreach my $each (sort keys %record) {
6476 0 open Fout, ">$fname_"; foreach my $each (sort keys %record) {
6477 0 print Fout $record{$each} } close Fout;
6478  
6479 0 move ($fname_, $fname);
6480 }
6481  
6482 sub appendtoFileUniqly { # fname, fileContent, maxTCExecTime
6483 0 ▶ my $fname = "e.txt" ; $fname = shift if @_;
Subroutine appendtoFileUniqly: not called CC=11 SCAR=48.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6484 0 ▶ my $content = "" ; $content = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6485 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6486 0 my $fname_ = $fname."_" ;
6487 0 my %record;
6488 0 ▶ while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname_) 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6489 0 ▶ if (-e $fname) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) { } 0 0 0
6490 0 ▶ open Fin , "$fname"; while ($_ = <Fin>) { $_ =~ s/\s*\n//g; $record{$_} = $_; } close Fin; $record{$content}=$content;
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6491 0 ▶ open Fout, ">$fname_"; foreach my $each (sort keys %record) { print Fout "$record{$each}\n" if ($record{$each} !~ /^\s*$/); }
Branch: 1 branch
BranchTrueFalseTotal
unless $record{$each} =~ /^\s*$/ 0 0 0
6492 0 close Fout;
6493 0 move ($fname_, $fname);
6494 } else {
6495 0 ▶ open Fout , ">$fname" || die "Can't open $fname:$!";
Condition0%0/2
">$fname" || die("Can't open ${fname}:$!")
l!l
00
MC/DC0%0/1
">$fname" || die("Can't open ${fname}:$!")
">$fname"
Truth table0%0/2
A
A= ">$fname"
Aresult
11
00
6496 0 print Fout $content;
6497 0 close Fout;
6498 }
6499 }
6500  
6501 sub write2File{ # fname, fileContent, maxTCExecTime
6502 0 ▶ my $fname = "e.txt" ; $fname = shift if @_;
Subroutine write2File: not called CC=6 SCAR=37.4
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6503 0 ▶ my $content = "" ; $content = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6504 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6505 0 my $fname_ = $fname."_" ;
6506 0 my %record;
6507 0 ▶ while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname_) 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6508 0 open Fout, ">$fname_"; print Fout $content; close Fout; move ($fname_, $fname);
6509 }
6510  
6511  
6512 sub copyFile { # fname, fileContent, maxTCExecTime
6513 0 ▶ my $fnameFrom = "e.txt" ; $fnameFrom = shift if @_;
Subroutine copyFile: not called CC=4 SCAR=30.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6514 0 ▶ my $fnameTo = "e.txt" ; $fnameTo = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6515 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6516 # my $fname_ = $fname."_" ;
6517 # my %record;
6518 #while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
6519 0 copy ($fnameFrom, $fnameTo);
6520 }
6521  
6522 ################################################################################
6523 # Subroutine Name : createFile
6524 # Function: create a new file
6525 # Input Parameters: 1 Filename 2 String
6526 # Output/Returns : New File with the appened text
6527 ################################################################################
6528 sub createFile() { # TH:Generic Functions: create to file (TH:Generic Functions)
6529 19 ▶ my $fname = $_[0];
Subroutine createFile: called CC=2 SCAR=6.9
Pod undocumented
6530 19 $fname =~ s/\\/\//g;
6531 19 ▶ if (-e &getDir($fname)) { chmod 0777, &getDir($fname); ;} else { umask 0000; mkpath &getDir($fname); chmod 0777, &getDir($fname); }
Branch: 1 branch
BranchTrueFalseTotal
if (-e &getDir($fname)) { } 18 1 19
6532 19 umask 0000; open Fout, ">$fname"; print Fout "$_[1]\n"; close Fout; chmod 0777, $fname;
6533 }
6534  
6535 ################################################################################
6536 # Subroutine Name : readFile
6537 # Function: Read a file
6538 # Input Parameters: Filename
6539 # Output/Returns : String
6540 ################################################################################
6541 sub readFile() { # TH:Generic Functions: read file (TH:Generic Functions)
6542 0 ▶ my $fname = $_[0];
Subroutine readFile: not called CC=2 SCAR=17.9
Pod undocumented
6543 0 ▶ if ( -e $fname ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) { } 0 0 0
6544 0 open Fin, "$fname";
6545 0 @_ = <Fin>;
6546 0 close Fin;
6547 0 return " @_";
6548 0 } else { return "";}
6549 }
6550  
6551  
6552 ################################## STOP TAF Gracefully ############################################
6553 sub getExitTAFGracefullyLock {
6554 0 ▶ if ( -e $exitTAFGracefullyLock) {
Subroutine getExitTAFGracefullyLock: not called CC=4 SCAR=30.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $exitTAFGracefullyLock) { } 0 0 0
6555 0 ▶ open Fin, $exitTAFGracefullyLock || die "Can't open $exitTAFGracefullyLock:$!";
Condition0%0/2
$exitTAFGracefullyLock || die("Can't open ${exitTAFGracefullyLock}:$!")
l!l
00
MC/DC0%0/1
$exitTAFGracefullyLock || die("Can't open ${exitTAFGracefullyLock}:$!")
$exitTAFGracefullyLock
Truth table0%0/2
A
A= $exitTAFGracefullyLock
Aresult
11
00
6556 0 $_ = <Fin>;
6557 0 close Fin;
6558 0 ▶ if ($_ =~ /exitTAFGracefullyString\s*=\s*(.+)/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /exitTAFGracefullyString\s*=\s*(.+)/) 0 0 0
6559 0 return $1;
6560 }
6561 0 } else { return "unlocked"; }
6562 }
6563 0 ▶sub detectExitTAFGracefullyLock { if ( -e $exitTAFGracefullyLock) { return "locked"; } else { return "unlocked"; } }
Subroutine detectExitTAFGracefullyLock: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if (-e $exitTAFGracefullyLock) { } 0 0 0
6564 0 ▶sub setExitTAFGracefullyLock { open Fout, ">$exitTAFGracefullyLock"; print Fout "exitTAFGracefullyString=$exitTAFGracefullyString"; close Fout; }
Subroutine setExitTAFGracefullyLock: not called CC=1 SCAR=6.9
Pod undocumented
6565 0 ▶sub releaseExitTAFGracefullyLock { unlink $exitTAFGracefullyLock; }
Subroutine releaseExitTAFGracefullyLock: not called CC=1 SCAR=6.9
Pod undocumented
6566 0 ▶sub exitTAF { open Fout, ">$exitTAFGracefullyLock"; print Fout "exitTAFGracefullyString=$exitTAFGracefullyString"; close Fout; sleep $outputPause; 1;}
Subroutine exitTAF: not called CC=1 SCAR=6.9
Pod undocumented
6567 ################################## concurrency file log ############################################
6568  
6569 sub updateWeb_ {
6570 0 ▶ my %tsProperty;
Subroutine updateWeb_: not called CC=33 SCAR=70.2
Pod undocumented
6571 0 ▶ my $tcname = 'TC_tc1' ; $tcname = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6572 0 ▶ my $scrollamount = 0 ; $scrollamount = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6573 0 ▶ my $borderwidth = 0 ; $borderwidth = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6574 0 ▶ my $borderstyle = 'SOLID' ; $borderstyle = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6575 0 ▶ my $movingString = '>' ; $movingString = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6576 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6577 0 @_ = split (/,/ , $scrollamount);
6578 0 ▶ if ($_[0]) { $scrollamount = $_[0];}
Branch: 1 branch
BranchTrueFalseTotal
if ($_[0]) 0 0 0
6579 0 ▶ if ($_[1]) { $borderwidth= $_[1];}
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1]) 0 0 0
6580 0 ▶ if ($_[2]) { $borderstyle= $_[2];}
Branch: 1 branch
BranchTrueFalseTotal
if ($_[2]) 0 0 0
6581  
6582 0 ▶ if ($movingString =~ /runTC/i) { $movingString = '>'; }
Branch: 1 branch
BranchTrueFalseTotal
if ($movingString =~ /runTC/i) 0 0 0
6583 0 ▶ if ($movingString =~ /runTS/i) { $movingString = '>>'; }
Branch: 1 branch
BranchTrueFalseTotal
if ($movingString =~ /runTS/i) 0 0 0
6584  
6585 0 $tcname = &getTCName($tcname); $tcname =~ s/\\/\//g;
6586 ############ BEGIN #############
6587 0 my $fname_ = $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_";
6588 0 ▶ while (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_") { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml . '_') 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6589 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml) 0 0 0
6590 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml;
6591 0 open Fout, ">".$SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_";
6592 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6593 0 my $tcnameTmp = $tcname;
6594 0 ▶ if ( $_ =~ /$tcnameTmp/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tcnameTmp/i) 0 0 0
6595 0 $_ =~ />(\S+)<\/marquee>/; my $movingString_ = $1;
6596 0 ▶ if ($_ =~ /\s+(\S+\(s\))/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /\s+(\S+\(s\))/) 0 0 0
6597 0 my $tmp_total_time = $1;
6598 0 my $currentTime = &UnixDate( "now", "%m/%d/%Y %H:%M:%S" );
6599 0 my $tmp_perf_str = "***Start at $currentTime for $tmp_total_time***";
6600 0 ▶ if ($scrollamount > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($scrollamount > 0) { } 0 0 0
6601 0 $_ =~ s/Run Tests \(Testcase Number >=/$tmp_perf_str Run Tests \(Testcase Number >=/;
6602 } else {
6603 0 $_ =~ s/\*\*\*.+\*\*\*//;
6604 }
6605 }
6606  
6607  
6608 0 ▶ if ($movingString_) {;} else { $movingString_ = '>>'; }
Branch: 1 branch
BranchTrueFalseTotal
if ($movingString_) { } 0 0 0
6609 0 $_ =~ s/>$movingString_<\/marquee>/>$movingString<\/marquee>/;
6610 0 ▶ $_ =~ /scrollamount=\s*(\d+)\s*/; my $scrollamount_ = $1; if ($scrollamount_) {;} else { $scrollamount_ = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($scrollamount_) { } 0 0 0
6611 0 $_ =~ s/scrollamount=\s*$scrollamount_\s*/scrollamount=$scrollamount/;
6612  
6613 0 ▶ $_ =~ /border:RED\s+(\d+)\s*px/; my $borderwidth_ = $1; if ($borderwidth_) {;} else { $borderwidth_ = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($borderwidth_) { } 0 0 0
6614 0 $_ =~ s/border:RED\s*$borderwidth_\s*px/border:RED ${borderwidth}px/;
6615  
6616 0 ▶ $_ =~ /(border:RED\s+\d+\s*px\s+)(DASHED|SOLID|DOTTED)"/; my $borderstyle_= $2; if ($borderstyle_) {;} else { $borderstyle_ = 'SOLID'; }
Branch: 1 branch
BranchTrueFalseTotal
if ($borderstyle_) { } 0 0 0
6617 0 $_ =~ s/(border:RED\s+\d+\s*px\s+)$borderstyle_"/${1}${borderstyle}"/ ;
6618 }
6619 0 print Fout $_;
6620 }
6621 0 close Fout;
6622 0 close Fin;
6623 0 move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml);
6624 } ############ END ###############
6625  
6626 ############ BEGIN #############
6627 0 my $fname_http = $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_";
6628 0 ▶ while (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_") { my $mtime = ( stat $fname_http)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml_http . '_') 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6629 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml_http) 0 0 0
6630 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http;
6631 0 open Fout, ">".$SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_";
6632 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6633 0 ▶ if ($_ =~ /\s+(\S+\s*\(s\))/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /\s+(\S+\s*\(s\))/) 0 0 0
6634 0 my $tmp_total_time = $1;
6635 0 my $currentTime = &UnixDate( "now", "%m/%d/%Y %H:%M:%S" );
6636 0 my $tmp_perf_str = "***Start at $currentTime for $tmp_total_time***";
6637 0 ▶ if ($scrollamount > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($scrollamount > 0) { } 0 0 0
6638 0 $_ =~ s/Run Tests \(Testcase Number >=/$tmp_perf_str Run Tests \(Testcase Number >=/;
6639 } else {
6640 0 $_ =~ s/\*\*\*.+\*\*\*//;
6641 }
6642 }
6643  
6644  
6645 0 my $tcnameTmp = $tcname;
6646 0 ▶ if ( $_ =~ /$tcnameTmp/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tcnameTmp/i) 0 0 0
6647 0 ▶ $_ =~ /scrollamount=\s*(\d+)\s*/; my $scrollamount_ = $1; if ($scrollamount_) {;} else { $scrollamount_ = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($scrollamount_) { } 0 0 0
6648 0 $_ =~ s/scrollamount=\s*$scrollamount_\s*/scrollamount=$scrollamount/;
6649  
6650 0 ▶ $_ =~ /border:RED\s+(\d+)\s*px/; my $borderwidth_ = $1; if ($borderwidth_) {;} else { $borderwidth_ = 0; }
Branch: 1 branch
BranchTrueFalseTotal
if ($borderwidth_) { } 0 0 0
6651 0 $_ =~ s/border:RED\s*$borderwidth_\s*px/border:RED ${borderwidth}px/;
6652  
6653 0 ▶ $_ =~ /(border:RED\s+\d+\s*px\s+)(DASHED|SOLID|DOTTED)"/; my $borderstyle_= $2; if ($borderstyle_) {;} else { $borderstyle_ = 'SOLID'; }
Branch: 1 branch
BranchTrueFalseTotal
if ($borderstyle_) { } 0 0 0
6654 0 $_ =~ s/(border:RED\s+\d+\s*px\s+)$borderstyle_"/${1}${borderstyle}"/ ;
6655 }
6656  
6657  
6658  
6659  
6660 0 print Fout $_;
6661 }
6662 0 close Fout;
6663 0 close Fin;
6664  
6665 0 move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http);
6666 } ############ END ###############
6667  
6668 # move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml);
6669 0 return "tcCtr_Dynamics=$scrollamount";
6670 }
6671  
6672 sub mergeFile_ {
6673 0 ▶ my $indexFName = "index.htm" ; $indexFName = shift if @_;
Subroutine mergeFile_: not called CC=12 SCAR=50.5
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6674 0 ▶ my $reportFName = "_tcReport_.html" ; $reportFName = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6675 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6676  
6677 0 $indexFName =~ s/\\/\//g; # todo10 \\
6678 0 $reportFName =~ s/\\/\//g; # todo11 \\
6679  
6680 0 my %index; my $indexFName_ = $indexFName."_";
6681 0 ▶ while (-e $indexFName_) { my $mtime = ( stat $indexFName)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $indexFName_) 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6682 0 ▶ if ( -e $indexFName) {open Fin, $indexFName ; while ($_ = <Fin> ) { if ($_ =~ /$_TAF\/(.+)\/_tcLog.html/) { $_ =~ /$_TAF\/(.+)\/_tcLog.html/; $index{$1} = $_; } } close Fin; }
Branch: 3 branches
BranchTrueFalseTotal
if (-e $indexFName) 0 0 0
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ m[$_TAF/(.+)/_tcLog.html]) 0 0 0
6683 0 ▶ if ( -e $reportFName) {open Fin, $reportFName; while ($_ = <Fin> ) { if ($_ =~ /$_TAF\/(.+)\/_tcLog.html/) { $_ =~ /$_TAF\/(.+)\/_tcLog.html/; $index{$1} = $_; } } close Fin; }
Branch: 3 branches
BranchTrueFalseTotal
if (-e $reportFName) 0 0 0
if (defined($_ = readline Fin)) 0 0 0
if ($_ =~ m[$_TAF/(.+)/_tcLog.html]) 0 0 0
6684 }
6685  
6686 sub updateWeb1_ {
6687 0 ▶ my %tsProperty;
Subroutine updateWeb1_: not called CC=10 SCAR=47.0
Pod undocumented
6688 0 ▶ my $tcname = 'TC_tc1' ; $tcname = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6689 0 ▶ my $tcHtml = "" ; $tcHtml = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6690 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6691 0 my $testsuiteTotalExecTime = &getTestsuiteTotalExecTime ("$SvrDrive/$SvrProjName/$reportHtml1");
6692  
6693 0 $tcname = &getTCName($tcname); $tcname =~ s/\\/\//g;
6694 0 my $fname_ = $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_";
6695 0 ▶ while (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_") { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml . '_') 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6696 0 my $findMatch = 'n';
6697 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml) 0 0 0
6698 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml;
6699 0 open Fout, ">".$SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_";
6700 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6701 0 my $tcnameTmp = $tcname;
6702 0 ▶ if ( $_ =~ /$tcnameTmp/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tcnameTmp/i) 0 0 0
6703 0 $_ = $tcHtml;
6704 0 $findMatch ='y';
6705 }
6706  
6707 # Update Testsuite properties on Test case level
6708 0 ▶ if ( $_ =~ /\(Avg Time is\s+(\d+:\d+:\d+)\)/) { $_ =~ s/Avg Time is $1/Avg Time is $testsuiteTotalExecTime/; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /\(Avg Time is\s+(\d+:\d+:\d+)\)/) 0 0 0
6709 0 print Fout $_;
6710 }
6711 0 close Fout;
6712 0 close Fin;
6713  
6714 0 move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml);
6715 }
6716 0 return 1;
6717 }
6718  
6719 sub updateWeb1Http_ {
6720 0 ▶ my %tsProperty;
Subroutine updateWeb1Http_: not called CC=10 SCAR=47.0
Pod undocumented
6721 0 ▶ my $tcname = 'TC_tc1' ; $tcname = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6722 0 ▶ my $tcHtml = "" ; $tcHtml = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6723 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6724 0 my $testsuiteTotalExecTime = &getTestsuiteTotalExecTime ("$SvrDrive/$SvrProjName/$reportHtml1");
6725  
6726 0 $tcname = &getTCName($tcname); $tcname =~ s/\\/\//g;
6727 0 my $fname_ = $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_";
6728 0 ▶ while (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_") { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml_http . '_') 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6729 0 my $findMatch = 'n';
6730 0 ▶ if (-e $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $SvrDrive . '/' . $SvrProjName . '/' . $reportHtml_http) 0 0 0
6731 0 open Fin, $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http;
6732 0 open Fout, ">".$SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_";
6733 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6734 0 my $tcnameTmp = $tcname;
6735 0 ▶ if ( $_ =~ /$tcnameTmp/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$tcnameTmp/i) 0 0 0
6736 0 $_ = $tcHtml;
6737 0 $findMatch ='y';
6738 }
6739  
6740 # Update Testsuite properties on Test case level
6741 0 ▶ if ( $_ =~ /\(Avg Time is\s+(\d+:\d+:\d+)\)/) { $_ =~ s/Avg Time is $1/Avg Time is $testsuiteTotalExecTime/; }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /\(Avg Time is\s+(\d+:\d+:\d+)\)/) 0 0 0
6742 0 print Fout $_;
6743 }
6744 0 close Fout;
6745 0 close Fin;
6746  
6747 0 move ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http."_", $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http);
6748 }
6749 0 return 1;
6750 }
6751  
6752 sub resetTSFile { # fname, fileContent, maxTCExecTime
6753 0 ▶ my $fname = "$SvrDrive/$SvrProjName/$resetTSFileName"; $fname = shift if @_;
Subroutine resetTSFile: not called CC=6 SCAR=37.4
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6754 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6755 0 my $content = "";
6756 0 my $fname_ = $fname."_" ;
6757 0 ▶ while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname_) 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6758 0 ▶ open Fout, ">$fname_" or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open Fout, ">$fname_" or die $! 0 0 0
6759 0 print Fout $content;
6760 0 close Fout;
6761 0 move ($fname_, $fname);
6762 #### print " <-> Reset $SvrDrive/$SvrProjName/$resetTSFileName - Done\n";
6763 0 1;
6764 }
6765  
6766 sub createFile_ { # fname, fileContent, maxTCExecTime
6767 0 ▶ my $fname = "e.txt" ; $fname = shift if @_;
Subroutine createFile_: not called CC=7 SCAR=40.3
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6768 0 ▶ my $content = "" ; $content = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6769 0 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
6770 0 my $fname_ = $fname."_" ;
6771 0 ▶ while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname_) 0 0 0
if ($diff > $MaxTCExecTime) 0 0 0
6772 0 mkpath &getDir($fname_);
6773 0 ▶ open Fout, ">$fname_" or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open Fout, ">$fname_" or die $! 0 0 0
6774 0 print Fout $content;
6775 0 close Fout;
6776 0 move ($fname_, $fname);
6777 0 1;
6778 }
6779  
6780 sub appendtoFile_ { # fname, fileContent, maxTCExecTime
6781 91 ▶ my $fname = "e.txt" ; $fname = shift if @_;
Subroutine appendtoFile_: called CC=9 SCAR=26.1
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 91 0 91
6782 91 ▶ my $content = " " ; $content = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 91 0 91
6783 91 ▶ my $MaxTCExecTime = 10 ; $MaxTCExecTime= shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 91 91
6784 91 my $fname_ = $fname."_" ;
6785 91 ▶ if (-e $fname) {;} else { &createFile($fname,"");}
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) { } 90 1 91
6786  
6787 0 ▶ while (-e $fname_) { my $mtime = ( stat $fname_)[9]; my $current_time = time; my $diff = $current_time - $mtime; if ($diff > $MaxTCExecTime) { last; } sleep 1; }
Branch: 2 branches
BranchTrueFalseTotal
if (-e $fname_) 0 91 91
if ($diff > $MaxTCExecTime) 0 0 0
6788  
6789 91 copy ($fname, $fname_);
6790 91 ▶ open Fout, ">>$fname_" or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open Fout, ">>$fname_" or die $! 91 0 91
6791 0 ▶ if ($content) {;} else { $content = "";}
Branch: 1 branch
BranchTrueFalseTotal
if ($content) { } 91 0 91
6792 91 print Fout $content;
6793 91 close Fout;
6794 91 move ($fname_, $fname);
6795 }
6796  
6797  
6798 sub appendtoFileFile_ { # TH:Generic Functions: append file to file (TH:Generic Functions)
6799 0 ▶ my $fname = $_[0]; my $fnameOUT = $_[1];
Subroutine appendtoFileFile_: not called CC=5 SCAR=34.0
Pod undocumented
6800 0 ▶ if (-e $fname) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $fname) 0 0 0
6801 0 ▶ open Fin, "$fname" || die "Can't open $fname:$!";
Condition0%0/2
"$fname" || die("Can't open ${fname}:$!")
l!l
00
MC/DC0%0/1
"$fname" || die("Can't open ${fname}:$!")
"$fname"
Truth table0%0/2
A
A= "$fname"
Aresult
11
00
6802 0 my $content;
6803 0 ▶ while ($_ = <Fin>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline Fin)) 0 0 0
6804 0 ▶ if ($_ !~ /^\s*$/) {$content = $content .$_; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($_ =~ /^\s*$/) 0 0 0
6805 }
6806 0 close Fin;
6807 0 &appendtoFile_($fnameOUT, $content) ;
6808 }
6809 }
6810  
6811 sub formatSeconds{
6812 0 ▶my $time = shift;
Subroutine formatSeconds: not called CC=2 SCAR=17.9
Pod undocumented
6813 0 ▶if ($time <60) { return int($time)."(s)";}
Branch: 1 branch
BranchTrueFalseTotal
if ($time < 60) 0 0 0
6814 0 my $hours = int ($time / 3600); $time = $time % 3600;
6815 0 my $minutes = int ($time / 60); $time = $time % 60;
6816 0 my $seconds = int ($time);
6817 0 return sprintf "%02d:%02d:%02d(s)",$hours,$minutes,$seconds;
6818 }
6819 ################################## concurrency file log ############################################
6820 39 ▶sub getRoot { my $string = shift; @_ = split /\\|\//, $string; return $_[$#_]; } # return tc.pl
Subroutine getRoot: called CC=1 SCAR=0.0
Pod undocumented
6821 0 ▶sub getRoot_1 { my $string = shift; @_ = split /\\|\//, $string; return $_[$#_-1]; } # remove tc.pl
Subroutine getRoot_1: not called CC=1 SCAR=6.9
Pod undocumented
6822 0 ▶sub getRoot_2 { my $string = shift; $string =~ s/\\/\//g; $string =~ s/\/$tc_pl//; return $string; } # remove c:\
Subroutine getRoot_2: not called CC=1 SCAR=6.9
Pod undocumented
6823 0 ▶sub getRoot_3 { my $string = shift; @_ = split /\\|\//, $string; # remove c:\
Subroutine getRoot_3: not called CC=6 SCAR=37.4
Pod undocumented
6824 0 ▶ if ($#_ == 1) { return $_[$#_]; }
Branch: 5 branches
BranchTrueFalseTotal
if ($#_ == 1) { } 0 0 0
elsif ($#_ == 2) { } 0 0 0
elsif ($#_ == 3) { } 0 0 0
elsif ($#_ == 4) { } 0 0 0
elsif ($#_ == 5) { } 0 0 0
6825 0 elsif ($#_ == 2) { my $tmp = $#_ -1; return $_[$tmp].'/'.$_[$#_]; }
6826 0 elsif ($#_ == 3) { my $tmp = $#_ -1; my $tmp1 = $#_ -2; return $_[$tmp1].'/'.$_[$tmp].'/'.$_[$#_]; }
6827 0 elsif ($#_ == 4) { my $tmp = $#_ -1; my $tmp1 = $#_ -2; my $tmp2 = $#_ - 3; return $_[$tmp2].'/'.$_[$tmp1].'/'.$_[$tmp].'/'.$_[$#_]; }
6828 0 elsif ($#_ == 5) { my $tmp = $#_ -1; my $tmp1 = $#_ -2; my $tmp2 = $#_ - 3; my $tmp3 = $#_ - 4; return $_[$tmp3].'/'.$_[$tmp2].'/'.$_[$tmp1].'/'.$_[$tmp].'/'.$_[$#_]; }
6829 }
6830 0 ▶sub getRoot_4 { my $string = shift; $string =~ s/\w:[\/|\\]//; $string =~ s/\s*\/\s*$//; return $string; } # remove c:\ yw remove last /
Subroutine getRoot_4: not called CC=1 SCAR=6.9
Pod undocumented
6831 0 ▶sub getRoot_N { my $string = shift; my $len = shift; @_ = split /\\|\//, $string; my $return="";
Subroutine getRoot_N: not called CC=3 SCAR=24.8
Pod undocumented
6832 0 ▶ if ($len >$#_) { return $string;} # "_treeLevel_ > dir Level_ ";
Branch: 1 branch
BranchTrueFalseTotal
if ($len > $#_) 0 0 0
6833 0 ▶ for (my $i = 0; $i <= $len; $i++ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $len) 0 0 0
6834 0 $return = $return."/".$_[$i]}; $return =~ s/^\s*\///g;
6835 0 return $return;
6836 }
6837  
6838 39 ▶sub getDir { my $string = shift; my $root =&getRoot($string); $string =~ s/([\\|\/])?$root//i; return $string; }
Subroutine getDir: called CC=1 SCAR=0.0
Pod undocumented
6839  
6840 sub prJScript {
6841
6842 0 ▶my $indexHtml =<<EOF;
Subroutine prJScript: not called CC=1 SCAR=6.9
Pod undocumented
6843  
6844 <html>
6845 <head>
6846 <META http-equiv="refresh" content="$htmlRefreshRateLogUI">
6847 <HTA:APPLICATION ID="oMyApp"
6848 APPLICATIONNAME="Application Executer"
6849 BORDER="no"
6850 CAPTION="no"
6851 SHOWINTASKBAR="yes"
6852 SINGLEINSTANCE="yes"
6853 SYSMENU="yes"
6854 SCROLL="no"
6855 WINDOWSTATE="normal">
6856 <script language="JavaScript">
6857 function RunFile(file) {
6858 // alert("file is " + file );
6859 WshShell = new ActiveXObject("WScript.Shell");
6860 WshShell.Run(file, 1, false);
6861 }
6862  
6863 function RunFileHTTP(testsuite, testcase) {
6864 // alert("testsuite is " + testsuite + " testcase is " );
6865 WshShell = new ActiveXObject("WScript.Shell");
6866 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /delete /tn TAF_'+ testsuite + '_' + testcase + ' /f'; WshShell.Run(cmd, 1, false);
6867 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /create /TR "$c\\\\$_TAF\\\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec" /TN TAF_'+testsuite+'_'+testcase+' /sc monthly /mo 1 /F'; WshShell.Run(cmd, 1, false);
6868 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /run /tn TAF_'+testsuite+'_'+testcase; WshShell.Run(cmd, 1, false);
6869 }
6870 // <body OnLoad ="function1()">
6871 </script>
6872 </head>
6873 <body><pre>
6874 EOF
6875 # <!-script type="text/javascript"> if (navigator.appName != "Microsoft Internet Explorer") alert("Please use IE to access TAF's webUI") </script>
6876 0 return $indexHtml;
6877 }
6878  
6879 sub prJScript2 {
6880 0 ▶my $str=<<EOF;
Subroutine prJScript2: not called CC=1 SCAR=6.9
Pod undocumented
6881 <html>
6882 <META http-equiv="refresh" content="$htmlRefreshRate">
6883 <HTA:APPLICATION ID="oMyApp"
6884 APPLICATIONNAME="Application Executer" c:/_TAF/taf.pl testcaseNode=_null_;testsuite=c:/_perlTestsuite_/AppBuildpath/_automated_testsuites1_/_testsuite_pl;generateTAFTestsuite
6885 BORDER="no"
6886 CAPTION="no"
6887 SHOWINTASKBAR="yes"
6888 SINGLEINSTANCE="yes"
6889 SYSMENU="yes"
6890 SCROLL="no"
6891 WINDOWSTATE="normal">
6892  
6893 <style type="text/css">
6894 /* ul.LinkedList { display: block; } */
6895 ul.LinkedList { display: black; }
6896 ul.LinkedList { list-style-type: none; }
6897 ul.LinkedList { list-style-position: inside; }
6898 ul.LinkedList { list-style-padding: 0px; }
6899 ul.LinkedList { list-style-margin-left: 0px; }
6900 ul.LinkedList { list-style-padding-left: 0px; }
6901 ul.LinkedList { list-style-text-indent: 0px; }
6902 ul.LinkedList { list-style-text-align: left; }
6903  
6904 ul.LinkedList ul { display: none; }
6905 ul.LinkedList ul { list-style-type: none; }
6906 ul.LinkedList ul { list-style-position: inside; }
6907 ul.LinkedList ul { list-style-padding: 0px; }
6908 ul.LinkedList ul { list-style-margin-left: 0px; }
6909 ul.LinkedList ul { list-style-padding-left: 0px; }
6910 ul.LinkedList ul { list-style-text-indent: 0px; }
6911 ul.LinkedList ul { list-style-text-align: left; }
6912 .HandCursorStyle { cursor: pointer; cursor: hand; } /* For IE */
6913 </style>
6914  
6915 <script type="text/JavaScript">
6916 function RunFile(file) {
6917 // alert("file is " + file );
6918 WshShell = new ActiveXObject("WScript.Shell");
6919 WshShell.Run(file, 1, false);
6920 }
6921  
6922 function RunFileHTTP(testsuite, testcase) {
6923 // alert("testsuite is " + testsuite + " testcase is " );
6924 WshShell = new ActiveXObject("WScript.Shell");
6925 cmd = 'c:\\windows\\system32\\schtasks.exe /delete /tn TAF_'+ testsuite + '_' + testcase + ' /f'; WshShell.Run(cmd, 1, false);
6926 cmd = 'c:\\windows\\system32\\schtasks.exe /create /TR "$c\\$_TAF\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec" /TN TAF_'+testsuite+'_'+testcase+' /sc monthly /mo 1 /F'; WshShell.Run(cmd, 1, false);
6927 cmd = 'c:\\windows\\system32\\schtasks.exe /run /tn TAF_'+testsuite+'_'+testcase; WshShell.Run(cmd, 1, false);
6928 }
6929 // <body OnLoad ="function1()">
6930  
6931 // Add this to the onload event of the BODY element
6932 function addEvents() {
6933 activateTree(document.getElementById("LinkedList1"));
6934 }
6935  
6936 // This function traverses the list and add links
6937 // to nested list items
6938 function activateTree(oList) {
6939 // Collapse the tree
6940 for (var i=0; i < oList.getElementsByTagName("ul").length; i++) {
6941 oList.getElementsByTagName("ul")[i].style.display="none";
6942 }
6943 // Add the click-event handler to the list items
6944 if (oList.addEventListener) {
6945 oList.addEventListener("click", toggleBranch, false);
6946 } else if (oList.attachEvent) { // For IE
6947 oList.attachEvent("onclick", toggleBranch);
6948 }
6949 // Make the nested items look like links
6950 addLinksToBranches(oList);
6951 }
6952  
6953 // This is the click-event handler
6954 function toggleBranch(event) {
6955 var oBranch, cSubBranches;
6956 if (event.target) {
6957 oBranch = event.target;
6958 } else if (event.srcElement) { // For IE
6959 oBranch = event.srcElement;
6960 }
6961 cSubBranches = oBranch.getElementsByTagName("ul");
6962 if (cSubBranches.length > 0) {
6963 if (cSubBranches[0].style.display == "block") {
6964 cSubBranches[0].style.display = "none";
6965 } else {
6966 cSubBranches[0].style.display = "block";
6967 }
6968 }
6969 }
6970  
6971 // This function makes nested list items look like links
6972 function addLinksToBranches(oList) {
6973 var cBranches = oList.getElementsByTagName("li");
6974 var i, n, cSubBranches;
6975 if (cBranches.length > 0) {
6976 for (i=0, n = cBranches.length; i < n; i++) {
6977 cSubBranches = cBranches[i].getElementsByTagName("ul");
6978 if (cSubBranches.length > 0) {
6979 addLinksToBranches(cSubBranches[0]);
6980 cBranches[i].className = "HandCursorStyle";
6981 cBranches[i].style.color = "blue";
6982 cSubBranches[0].style.color = "black";
6983 cSubBranches[0].style.cursor = "auto";
6984 }
6985 }
6986 }
6987 }
6988 </script>
6989  
6990 <script language="JavaScript">
6991 function RunFile(file) {
6992 // alert("file is " + file );
6993 WshShell = new ActiveXObject("WScript.Shell");
6994 WshShell.Run(file, 1, false);
6995 }
6996  
6997 function RunFileHTTP(testsuite, testcase) {
6998 // alert("testsuite is " + testsuite + " testcase is " );
6999 WshShell = new ActiveXObject("WScript.Shell");
7000 cmd = 'c:\\windows\\system32\\schtasks.exe /delete /tn TAF_'+ testsuite + '_' + testcase + ' /f'; WshShell.Run(cmd, 1, false);
7001 cmd = 'c:\\windows\\system32\\schtasks.exe /create /TR "$c\\$_TAF\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec" /TN TAF_'+testsuite+'_'+testcase+' /sc monthly /mo 1 /F'; WshShell.Run(cmd, 1, false);
7002 cmd = 'c:\\windows\\system32\\schtasks.exe /run /tn TAF_'+testsuite+'_'+testcase; WshShell.Run(cmd, 1, false);
7003 }
7004 // <body OnLoad ="function1()">
7005 </script>
7006 EOF
7007 0 return $str;
7008 }
7009 sub prHtml1_strGen() {
7010 0 ▶ my $localUrl = $url; $localUrl = shift if @_;
Subroutine prHtml1_strGen: not called CC=8 SCAR=42.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
7011 0 my $tcPropertyPatternPattern_ = ".*"; ####################### Reset the tcPropertyPatternPattern for index.htm
7012 0 my $testsuiteTotalExecTime = &getTestsuiteTotalExecTime ("$SvrDrive/$SvrProjName/$reportHtml1");
7013 0 my $tcDescTitle = "<a href=\"${localUrl}/$SvrProjName/_generateExcelReport.html\" title=\"Link to Daily Report. Below link to TC Logs\">";
7014 0 $tcDescTitle = sprintf "$tcDescTitle%-${webUI_TCDescWidth}s</a>"," ------------------Testcase Description------------------";
7015 0 my $TCCtrToolTip = sprintf "Run Test Suite 24/7 (Avg Time is $testsuiteTotalExecTime)";
7016 0 ▶ if ($Execution_24_7_title =~ /n/i) { $TCCtrToolTip = sprintf "Run Test Suite (Avg Time is $testsuiteTotalExecTime)";}
Branch: 1 branch
BranchTrueFalseTotal
if ($Execution_24_7_title =~ /n/i) 0 0 0
7017 0 my $execTS = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;Execution_24_7=$Execution_24_7_title;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;exec')\" title=\"$TCCtrToolTip\"> Exec</a>");
7018 0 my $stopTS = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName exitTAFGracefullyString=exitTAF;exitTAF')\" title=\"Stop Test Execution gracefully\" >.</a>");
7019 0 my $markTS = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;Execution_24_7=n;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;mark;resetLock')\" title=\"MarK the beginning of a execution by \|\"> \|</a>");
7020 0 my $listTSUnderTest = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseNode=testcase;titleStatus=(UnderTestDontUse);list')\" title=\"Display UnderTestDontUser\"> </a>");
7021 0 my $listTSUnderTestNull = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseNode=testcase;titleStatus=;list')\" title=\"set titleStatus to Null \"> </a>");
7022 0 my $listTS = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseNode=testcase;list')\" title=\"Update webUI /o Tags (default)\">S</a>");
7023 0 my $listTSAll = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=_null_;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;list')\" title=\"Update webUI /w Tags\">U</a>");
7024 0 my $updateTS = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtml\" onClick=\"RunFile('$perl $scriptName SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;createOrAppendTS=append;testsuit=$c/$SvrProjName;generateTAFTestsuite')\" title=\"Update webUI /o Tags (default)\">S</a>");
7025 0 my $listTAFTestBed = sprintf("<a href=\"${localUrl}/taf.txt\" title=\"Display TAF Testbed scripts\">E</a>");
7026 0 my $indexthProperty = sprintf("<a href=\"${localUrl}/$SvrProjName/tsProperty.txt\" title=\"Display TS property\">L</a>");
7027 0 my $tafGlobalVars = sprintf("<a href=\"${localUrl}/_tafGlobalVars.txt\" title=\"Display TAF Global Variables\">T</a>");
7028 0 my $indexCmdLog = sprintf("<a href=\"${localUrl}/_cmdLogs.txt\" title=\"Display TAF Cmd History\">S</a>");
7029 0 my $indexFailed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_failed.htm\" title=\"Display *Failed* TCs\">Fail</a>");
7030 0 my $indexPassed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_passed.htm\" title=\"Display *Passed* TCs\">Pass</a>");
7031 0 my $indexOthers = sprintf("<a href=\"${localUrl}/$SvrProjName/index_others.htm\" title=\"Display *others* TCs\">/</a>");
7032 0 my $indexUrlIIS = sprintf("<a href=\"${url}/$SvrProjName/index_http.htm\" title=\"$web_ui_title_tip\"> <font color=\"white\">TC Manual Command</font></a>");
7033 0 my $indexSeconds = "<a title=\"Total TS Execution time = $testsuiteTotalExecTime (s) \">(sec)</a>";
7034 0 my $indexTitle = sprintf("<a href=\"${localUrl}/index.htm\" title=\"View *all* Testsuites\">$web_ui_title</a>");
7035 0 my $indexResult = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtmlSummary\" title=\"testofUpdate\">".substr ("Result ", 0, $passFailDisplayWidth-7)."</a>");
7036 0 my $tmp10 = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtmlSummary\" title=\"$reportHtmlSummaryStr\">");
7037 0 my $passFailDisplay = &genPassFailDisplay("");
7038  
7039 0 my $queueSizeUI; my $queueSizeUICGI; my $queueSize=0; $queueSize = &Queue("", "queueSize");
7040 0 ▶ if ($queueSize > 0) { $queueSizeUI = " <a href=\"$url/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize > 0) 0 0 0
7041 0 ▶ if ($queueSize > 0) { $queueSizeUICGI = " <a href=\"$urlHttp/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize > 0) 0 0 0
7042 0 ▶ if ($queueSize == 0) { $queueSizeUI = " <a style=\"color:white\" href=\"$url/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize == 0) 0 0 0
7043 0 ▶ if ($queueSize == 0) { $queueSizeUICGI = " <a style=\"color:white\" href=\"$urlHttp/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize == 0) 0 0 0
7044  
7045 0 ▶ if ( $localUrl =~ /^\s*http:/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($localUrl =~ /^\s*http:/) 0 0 0
7046 0 $indexTitle = sprintf("<a href=\"${localUrl}/index_http.htm\" title=\"$web_ui_title_tip\">$web_ui_title</a>");
7047 0 $indexFailed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_http_failed.htm\" title=\"Display *Failed* TCs\">Fail</a>");
7048 0 $indexPassed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_http_passed.htm\" title=\"Display *Passed* TCs\">Pass</a>");
7049 0 $indexOthers = sprintf("<a href=\"${localUrl}/$SvrProjName/index_http_others.htm\" title=\"Display *others* TCs\">/</a>");
7050 }
7051
7052 0 my $indexHtml =<<EOF;
7053  
7054 <html>
7055 <head>
7056 <META http-equiv="refresh" content="$htmlRefreshRate">
7057 <HTA:APPLICATION ID="oMyApp"
7058 APPLICATIONNAME="Application Executer"
7059 BORDER="no"
7060 CAPTION="no"
7061 SHOWINTASKBAR="yes"
7062 SINGLEINSTANCE="yes"
7063 SYSMENU="yes"
7064 SCROLL="no"
7065 WINDOWSTATE="normal">
7066 <script language="JavaScript">
7067 function RunFile(file) {
7068 // alert("file is " + file );
7069 WshShell = new ActiveXObject("WScript.Shell");
7070 WshShell.Run(file, 1, false);
7071 }
7072  
7073 function RunFileHTTP(testsuite, testcase) {
7074 // alert("testsuite is " + testsuite + " testcase is " );
7075 WshShell = new ActiveXObject("WScript.Shell");
7076 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /delete /tn TAF_'+ testsuite + '_' + testcase + ' /f'; WshShell.Run(cmd, 1, false);
7077 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /create /TR "$c\\\\$_TAF\\\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec" /TN TAF_'+testsuite+'_'+testcase+' /sc monthly /mo 1 /F'; WshShell.Run(cmd, 1, false);
7078 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /run /tn TAF_'+testsuite+'_'+testcase; WshShell.Run(cmd, 1, false);
7079 }
7080 // <body OnLoad ="function1()">
7081 </script>
7082 </head>
7083 <script type="text/javascript"> if (navigator.appName != "Microsoft Internet Explorer") alert("Please use IE to access TAF's webUI") </script>
7084 <body>
7085 <pre>
7086 <p>
7087 <h2> ${titleStatus}${indexTitle}${listTSUnderTest}${listTSUnderTestNull}${queueSizeUI}</h2>
7088 ${indexResult}${listTAFTestBed}${updateTS}${listTSAll}${indexthProperty}${tafGlobalVars}${indexCmdLog} ${stopTS}${markTS}${execTS} <a title=\"Click Testcase Desc to view TC logs\">$tcDescTitle ${indexPassed}${indexOthers}${indexFailed} ${indexSeconds} ${indexUrlIIS} </span>
7089 EOF
7090 0 return $indexHtml;
7091 }
7092  
7093 sub prHtml1_strGen_CGI() {
7094 0 ▶ my $localUrl = $url; $localUrl = shift if @_;
Subroutine prHtml1_strGen_CGI: not called CC=8 SCAR=42.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
7095 0 my $tcPropertyPatternPattern_ = ".*"; ####################### Reset the tcPropertyPatternPattern for index.htm
7096 0 my $testsuiteTotalExecTime = &getTestsuiteTotalExecTime ("$SvrDrive/$SvrProjName/$reportHtml1");
7097 0 my $tcDescTitle = "<a href=\"${localUrl}/$SvrProjName/_generateExcelReport.html\" title=\"Link to Daily Report. Below link to TC Logs\">";
7098 0 $tcDescTitle = sprintf "$tcDescTitle%-${webUI_TCDescWidth}s</a>"," ------------------Testcase Description------------------";
7099 0 my $TCCtrToolTip = sprintf "Run Test Suite 24/7 (Avg Time is $testsuiteTotalExecTime)";
7100 0 ▶ if ($Execution_24_7_title =~ /n/i) { $TCCtrToolTip = sprintf "Run Test Suite (Avg Time is $testsuiteTotalExecTime)";}
Branch: 1 branch
BranchTrueFalseTotal
if ($Execution_24_7_title =~ /n/i) 0 0 0
7101 0 my $execTS = sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=Execution_from_cgi=y;Execution_local_only=$Execution_local_only;SysDrive=$SvrDrive;performanceMode=fast;Execution_24_7=$Execution_24_7_title;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;exec_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"$TCCtrToolTip\"> Exec</a>");
7102 0 my $stopTS = sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=exitTAFGracefullyString=exitTAF;exitTAF_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Stop Test Execution gracefully\" >.</a>");
7103 0 my $markTS = sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;performanceMode=fast;Execution_24_7=n;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;mark_realSemi_resetLock_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Mark the beginning of a execution by \|\"> \|</a>");
7104 0 my $listTSUnderTest = sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseNode=testcase;titleStatus=(UnderTestDontUse);list_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Display (UnderTestDontUse)\"> </a>");
7105 0 my $listTSUnderTestNull = sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseNode=testcase;titleStatus=;list_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Set titleStatus as Null\"> </a>");
7106 0 my $listTS = sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=$testcaseNode;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;testcaseNode=testcase;list_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Update webUI /o Tags (default)\">S</a>");
7107 0 my $listTSAll=sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;performanceMode=fast;testcaseNode=_null_;$tcPropertyPatternName=$tcPropertyPatternName;tcPropertyPatternPattern=$tcPropertyPatternPattern_;testsuit=$SvrProjName;list_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Update webUI /w Tags\">U</a>");
7108 0 my $updateTS =sprintf("<a href=\"${localUrl}/${cgi_bin}$tafCGI?tafArgs=SysDrive=$SvrDrive;performanceMode=fast;tcPropertyPatternPattern=$tcPropertyPatternPattern_;createOrAppendTS=append;testsuit=$c/$SvrProjName;generateTAFTestsuite;list_realSemi_tafRedirectory=${localUrl}/$SvrProjName/$reportHtml_http\" title=\"Update webUI /o Tags (default)\">S</a>");
7109  
7110 0 $execTS =~ s/;/_semi_/g; $execTS =~ s/_realSemi_/$_realSemi_/g;
7111 0 $stopTS =~ s/;/_semi_/g; $stopTS =~ s/_realSemi_/$_realSemi_/g;
7112 0 $markTS =~ s/;/_semi_/g; $markTS =~ s/_realSemi_/$_realSemi_/g;
7113 0 $listTSUnderTest =~ s/;/_semi_/g; $listTSUnderTest =~ s/_realSemi_/$_realSemi_/g;
7114 0 $listTS =~ s/;/_semi_/g; $listTS =~ s/_realSemi_/$_realSemi_/g;
7115 0 $listTSAll =~ s/;/_semi_/g; $listTSAll =~ s/_realSemi_/$_realSemi_/g;
7116 0 $updateTS =~ s/;/_semi_/g; $updateTS=~ s/_realSemi_/$_realSemi_/g;
7117  
7118 0 my $listTAFTestBed = sprintf("<a href=\"${localUrl}/taf.txt\" title=\"Display TAF Testbed scripts\">E</a>");
7119 0 my $indexthProperty = sprintf("<a href=\"${localUrl}/$SvrProjName/tsProperty.txt\" title=\"Display TS property\">L</a>");
7120 0 my $tafGlobalVars = sprintf("<a href=\"${localUrl}/_tafGlobalVars.txt\" title=\"Display TAF Global Variables\">T</a>");
7121 0 my $indexCmdLog = sprintf("<a href=\"${localUrl}/_cmdLogs.txt\" title=\"Display TAF Cmd History\">S</a>");
7122 0 my $indexFailed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_failed.htm\" title=\"Display *Failed* TCs\">Fail</a>");
7123 0 my $indexPassed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_passed.htm\" title=\"Display *Passed* TCs\">Pass</a>");
7124 0 my $indexOthers = sprintf("<a href=\"${localUrl}/$SvrProjName/index_others.htm\" title=\"Display *others* TCs\">/</a>");
7125 0 my $indexUrlIIS = sprintf("<a href=\"${url}/$SvrProjName/index_http.htm\" title=\"$web_ui_title\"> <font color=\"white\">TC Manual Command</font></a>");
7126 0 my $indexSeconds = "<a title=\"Total TS Execution time = $testsuiteTotalExecTime (s) \">(sec)</a>";
7127 0 my $indexTitle = sprintf("<a href=\"${localUrl}/index.htm\" title=\"$web_ui_title_tip\">Test Automation </a>");
7128 0 my $indexResult = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtmlSummary\" title=\"Latest TC pass/fail (Gree/Red) Click to Display Test Suite Summary\">".substr ("Result ", 0, $passFailDisplayWidth-7)."</a>");
7129 0 my $tmp10 = sprintf("<a href=\"${localUrl}/$SvrProjName/$reportHtmlSummary\" title=\"$reportHtmlSummaryStr\">");
7130 0 my $passFailDisplay = &genPassFailDisplay("");
7131  
7132 0 my $queueSizeUI; my $queueSizeUICGI; my $queueSize=0; $queueSize = &Queue("", "queueSize");
7133 0 ▶ if ($queueSize > 0) { $queueSizeUI = " <a href=\"$url/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize > 0) 0 0 0
7134 0 ▶ if ($queueSize > 0) { $queueSizeUICGI = " <a href=\"$urlHttp/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize > 0) 0 0 0
7135 0 ▶ if ($queueSize == 0) { $queueSizeUI = " <a style=\"color:white\" href=\"$url/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize == 0) 0 0 0
7136 0 ▶ if ($queueSize == 0) { $queueSizeUICGI = " <a style=\"color:white\" href=\"$urlHttp/${queueFName}_active\" title=\"View waiting jobs\">$queueSize job(s) is/are waiting....</a>";}
Branch: 1 branch
BranchTrueFalseTotal
if ($queueSize == 0) 0 0 0
7137  
7138 0 ▶ if ( $localUrl =~ /^\s*http:/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($localUrl =~ /^\s*http:/) 0 0 0
7139 0 $indexTitle = sprintf("<a href=\"${localUrl}/index_http.htm\" title=\"$web_ui_title_tip\">$web_ui_title</a>");
7140 0 $indexFailed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_http_failed.htm\" title=\"Display *Failed* TCs\">Fail</a>");
7141 0 $indexPassed = sprintf("<a href=\"${localUrl}/$SvrProjName/index_http_passed.htm\" title=\"Display *Passed* TCs\">Pass</a>");
7142 0 $indexOthers = sprintf("<a href=\"${localUrl}/$SvrProjName/index_http_others.htm\" title=\"Display *others* TCs\">/</a>");
7143 }
7144
7145 0 my $indexHtml =<<EOF;
7146  
7147 <html>
7148 <head>
7149 <META http-equiv="refresh" content="$htmlRefreshRate">
7150 <HTA:APPLICATION ID="oMyApp"
7151 APPLICATIONNAME="Application Executer"
7152 BORDER="no"
7153 CAPTION="no"
7154 SHOWINTASKBAR="yes"
7155 SINGLEINSTANCE="yes"
7156 SYSMENU="yes"
7157 SCROLL="no"
7158 WINDOWSTATE="normal">
7159 <script language="JavaScript">
7160 function RunFile(file) {
7161 // alert("file is " + file );
7162 WshShell = new ActiveXObject("WScript.Shell");
7163 WshShell.Run(file, 1, false);
7164 }
7165  
7166 function RunFileHTTP(testsuite, testcase) {
7167 // alert("testsuite is " + testsuite + " testcase is " );
7168 WshShell = new ActiveXObject("WScript.Shell");
7169 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /delete /tn TAF_'+ testsuite + '_' + testcase + ' /f'; WshShell.Run(cmd, 1, false);
7170 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /create /TR "$c\\\\$_TAF\\\\taf.pl testsuit='+testsuite+';testcaseExec='+testcase+';exec" /TN TAF_'+testsuite+'_'+testcase+' /sc monthly /mo 1 /F'; WshShell.Run(cmd, 1, false);
7171 cmd = '$c\\\\windows\\\\system32\\\\schtasks.exe /run /tn TAF_'+testsuite+'_'+testcase; WshShell.Run(cmd, 1, false);
7172 }
7173 // <body OnLoad ="function1()">
7174 </script>
7175 </head>
7176 <body>
7177 <pre>
7178 <p>
7179 <h2> ${titleStatus}${indexTitle}(Automation Host: $hostname/$ip)${listTSUnderTest}${listTSUnderTestNull}${queueSizeUICGI}</h2>
7180 ${indexResult}${listTAFTestBed}${updateTS}${listTSAll}${indexthProperty}${tafGlobalVars}${indexCmdLog} ${stopTS}${markTS}${execTS} <a title=\"Click Testcase Desc to view TC logs\">$tcDescTitle ${indexPassed}${indexOthers}${indexFailed} ${indexSeconds} ${indexUrlIIS} </span>
7181 EOF
7182  
7183 0 return $indexHtml;
7184 }
7185  
7186  
7187 sub prHtml1 { # print index.htm beginnings
7188 0 ▶ my $tcPropertyPatternPattern_ = ".*"; ####################### Reset the tcPropertyPatternPattern for index.htm
Subroutine prHtml1: not called CC=1 SCAR=6.9
Pod undocumented
7189 0 my $testsuiteTotalExecTime = &getTestsuiteTotalExecTime ("$SvrDrive/$SvrProjName/$reportHtml1");
7190 0 &createFile_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml, '' );
7191 0 &createFile_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http, '' );
7192 0 my $str =<<EOF;
7193 taf.pl : TAF Driver
7194 taf.bat : TAF testbed setup
7195 tc.pl : TC hook
7196 _tcAppend.txt: TC log hook
7197 EOF
7198  
7199 0 &readTestSuitProperty();
7200 0 my $indexHtml = &prHtml1_strGen($url);
7201 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml, $indexHtml);
7202  
7203 0 my $indexHtml_http = &prHtml1_strGen_CGI($urlHttp);
7204 0 &appendtoFile_ ($SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http, $indexHtml_http);
7205 }
7206  
7207 sub prHtml2 { # print index.htm endings
7208  
7209 ############ Temporal Solution of $c collision #############
7210 0 ▶my $tsDriverStr= &readFile("$c/$SvrProjName/index.pl") if ($^O =~ /win/i); ##### unix only
Subroutine prHtml2: not called CC=6 SCAR=37.4
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /win/i 0 0 0
7211 0 ▶ $tsDriverStr= &readFile("/$SvrProjName/index.pl") if ($^O =~ /linux/i); ##### unix only
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /linux/i 0 0 0
7212  
7213 0 ▶if ($tsDriverStr =~ /^\s*$/){ $tsDriverStr = "This Testsuite doesn't have a hook (index.pl). "; }
Branch: 1 branch
BranchTrueFalseTotal
if ($tsDriverStr =~ /^\s*$/) 0 0 0
7214  
7215 0 my $tmp;
7216  
7217 0 ▶if ($^O =~ /linux/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /linux/i) 0 0 0
7218 0 $tmp =<<EOF;
7219 Step 1: Generate Testsuite Template: $perl_ $c/$_TAF/$taf testsuite=/$SvrProjName${deli}createTS
7220 Step 2: Edit the Testsuite Template: /$SvrProjName/index.pl to add customer test suite
7221 EOF
7222  
7223 }
7224  
7225 0 ▶if ($^O =~ /win/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /win/i) 0 0 0
7226 0 $tmp =<<EOF;
7227 Step 1: Generate Testsuite Template: $perl_ $c/$_TAF/$taf testsuite=$c/$SvrProjName${deli}createTS
7228 Step 2: Edit the Testsuite Template: $c/$SvrProjName/index.pl to add customer test suite
7229 EOF
7230 }
7231 0 $tsDriverStr =~ s/print\s*<</# todo: After copy-and-paste, please *delete* the white spaces in the following line to make the scrept work!\n print << /g;
7232 0 my $html =<<EOF;
7233  
7234 <font color=\"white\">
7235 ---------------------------TS Driver $c/$SvrProjName/index.pl -------------------------
7236 Step 1: Generate Testsuite Template: $perl_ $c/$_TAF/$taf testsuite=$c/$SvrProjName${deli}createTS
7237 Step 2: Edit the Testsuite Template: $c/$SvrProjName/index.pl to add customer test suite
7238 ---------------------------TS Driver $c/$SvrProjName/index.pl -------------------------
7239 $tsDriverStr
7240 ---------------------------TS Driver -------------------------<font>
7241 </pre></body>
7242 </html>
7243 <style type="text/css"> a { text-decoration:none} </style>
7244 EOF
7245  
7246  
7247 0 &appendtoFile_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml, $html );
7248 0 &appendtoFile_( $SvrDrive.'/'.$SvrProjName.'/'.$reportHtml_http, $html );
7249 }
7250  
7251  
7252  
7253 __END__
↑ Summary