@@ -12,10 +12,11 @@ BEGIN {
1212
1313sub PerforceIntegrationTests
1414{
15- $dir = $_ [0];
16- $p4port = $_ [1];
17- $option = $_ [2];
18- $filter = $_ [3];
15+ $suite = $_ [0];
16+ $dir = $_ [1];
17+ $p4port = $_ [2];
18+ $option = $_ [3];
19+ $filter = $_ [4];
1920 $mfa = index ($dir , " MultiFactorAuthentication" ) > -1;
2021 $devnull = " > /dev/null 2>&1" ;
2122
@@ -25,11 +26,11 @@ sub PerforceIntegrationTests
2526 if ($filter ne " "
2627 && index ($filter , $dir ) == -1)
2728 {
28- print " Not Running Perforce Integration Tests in dir: '" ,$dir ," ' p4port:'" ,$p4port ," ' (Not included in filter).\n " ;
29- return 0;
29+ print " \n [ $suite ] '" ,$dir ," ' Perforce Integration Tests Ignored ( p4port:'" ,$p4port ," ') (Not included in filter).\n " ;
30+ return 0;
3031 }
3132
32- print " Running Perforce Integration Tests in dir: '" ,$dir ," ' p4port:'" ,$p4port ," '\n " ;
33+ print " \n\n [ $suite ] '" ,$dir ," ' Perforce Integration Tests Running ( p4port:'" ,$p4port ," ') \n " ;
3334
3435 rmtree(" Test/tmp" );
3536 mkdir " Test/tmp" ;
@@ -44,7 +45,7 @@ sub PerforceIntegrationTests
4445 $ENV {' P4CHARSET' } = ' utf8' ;
4546 $ENV {' VCS_P4PASSWD' } = ' Secret' ;
4647 $ENV {' P4EXECABS' } = getcwd() . " /" . $ENV {' P4EXEC' };
47-
48+
4849 if ($ENV {' TARGET' } eq " win32" )
4950 {
5051 $ENV {' VCS_P4ROOT' } =~ s /\/ / \\ / g ;
@@ -73,7 +74,7 @@ sub PerforceIntegrationTests
7374 # print "Press ENTER to continue...";
7475 # <STDIN>;
7576
76- $exitCode = RunTests($dir , $option , $filter );
77+ $exitCode = RunTests($suite , $ dir , $option , $filter );
7778
7879 # print "Press ENTER to continue...";
7980 # <STDIN>;
@@ -85,14 +86,18 @@ sub PerforceIntegrationTests
8586
8687sub RunTests ()
8788{
88- $dir = $_ [0];
89- $option = $_ [1];
90- $filter = $_ [2];
89+ $suite = $_ [0];
90+ $dir = $_ [1];
91+ $option = $_ [2];
92+ $filter = $_ [3];
9193
9294 @files = <Test/$dir /*.txt>;
9395
94- $total = 0;
96+ $total = @files ;
97+ $count = 0;
9598 $success = 0;
99+ $failed = 0;
100+ $ignored = 0;
96101
97102 $pluginexec = abs_path($ENV {' P4PLUGIN' });
98103 $testserver = abs_path($ENV {' TESTSERVER' });
@@ -106,13 +111,15 @@ sub RunTests()
106111
107112 $cwd = getcwd();
108113 foreach $i (@files ) {
109- if ($filter ne " "
114+ $count ++;
115+ if ($filter ne " "
110116 && index ($i , $filter ) == -1)
111117 {
112- print " Not running Perforce Integration Tests in file:'" ,$i ," ' p4port:'" ,$p4port ," '\n " ;
118+ $ignored ++;
119+ print " \n [$suite ][$count /$total ] '" ,$i ," ' Ignored (p4port:'" ,$p4port ," ')\n " ;
113120 next ;
114121 }
115- print " Running Perforce Integration Tests in file: '" ,$i ," ' p4port:'" ,$p4port ," '\n " ;
122+ print " \n [ $suite ][ $count / $total ] '" ,$i ," ' Running ( p4port:'" ,$p4port ," ') \n " ;
116123 chdir $cwd ;
117124 rmtree( $clientroot , {keep_root => 1} );
118125 print " Changing working directory to: '" , $clientroot ," '\n " ;
@@ -129,21 +136,29 @@ sub RunTests()
129136 }
130137 elsif ($? == -1)
131138 {
132- print " Error running test ' $i ' : $! \n " ;
139+ print " \n [ $suite ][ $count / $total ] ' " , $i , " ' Error running test : $! \n \n" ;
133140 chdir $cwd ;
134141 return 1;
135142 }
136143 else
137144 {
138- print " Test failed -> stopping all tests\n " ;
139- chdir $cwd ;
140- return 1;
145+ print " \n [$suite ][$count /$total ] '" ,$i ," ' Failed (p4port:'" ,$p4port ," ')\n\n " ;
146+ $failed ++;
141147 }
142- $total ++;
143148 RemoveExclusiveFile();
144149 }
145- print " Done: $success of $total tests passed.\n " ;
146150 chdir $cwd ;
151+ if ($ignored > 0)
152+ {
153+ print " [$suite ] $ignored of $total tests ignored.\n " ;
154+ }
155+ if ($failed > 0)
156+ {
157+ print " [$suite ] Failed: $failed of $total tests failed.\n " ;
158+ print " [$suite ] $success of $total tests passed.\n " ;
159+ return $failed ;
160+ }
161+ print " [$suite ] Success: $success of $total tests passed.\n " ;
147162 return 0;
148163}
149164
@@ -160,7 +175,7 @@ sub AddExclusiveFile
160175 open (FH, ' >' , ' Assets/exclusivefile.txt' ) or die $! ;
161176 print (FH ' File with exclusive open file type modifier.' );
162177 close (FH) or die $1 ;
163-
178+
164179 RunCommand(' add -t text+l Assets/exclusivefile.txt' );
165180 RunCommand(' submit -d "Add Assets/exclusivefile.txt." Assets/exclusivefile.txt' );
166181}
@@ -173,7 +188,7 @@ sub RemoveExclusiveFile
173188
174189sub SetupServer
175190{
176- $root = $ENV {' VCS_P4ROOT' };
191+ $root = $ENV {' VCS_P4ROOT' };
177192 my $p4port = $ENV {' VCS_P4PORT' };
178193 print " Setting server in '$root ' listening on port '$p4port '\n " ;
179194 rmtree($root );
@@ -190,6 +205,7 @@ sub SetupServer
190205 }
191206
192207 my $p4d = $ENV {' P4DEXEC' };
208+ print " Starting server '$p4d '\n " ;
193209 system (" $p4d -xi -r \" $root \" " );
194210 my $pidfile = getcwd() . " /server.pid" ;
195211 my $pid = SpawnSubProcess($p4d , " -r \" $root \" -p $p4port --pid-file=$pidfile " );
@@ -288,9 +304,9 @@ Update: 2022/07/20 11:40:48
288304
289305Access: 2022/07/20 11:40:48
290306
291- FullName: Multi Factor Authentication
307+ FullName: Multi Factor Authentication
292308
293- Password: ******
309+ Password: ******
294310
295311AuthMethod: perforce+2fa
296312EOF
@@ -313,9 +329,9 @@ sub SetupMFATriggers
313329 $TRIGGERS =<<EOF ;
314330
315331Triggers:
316- test-pre-2fa auth-pre-2fa auth "$mfa_script -t pre-2fa -e %quote %%email %%quote % -u %user % -h %host %"
317- test-init-2fa auth-init-2fa auth "$mfa_script -t init-2fa -e %quote %%email %%quote % -u %user % -h %host % -m %method %"
318- test-check-2fa auth-check-2fa auth "$mfa_script -t check-2fa -e %quote %%email %%quote % -u %user % -h %host % -s %scheme % -k %token %"
332+ test-pre-2fa auth-pre-2fa auth "$mfa_script -t pre-2fa -e %quote %%email %%quote % -u %user % -h %host %"
333+ test-init-2fa auth-init-2fa auth "$mfa_script -t init-2fa -e %quote %%email %%quote % -u %user % -h %host % -m %method %"
334+ test-check-2fa auth-check-2fa auth "$mfa_script -t check-2fa -e %quote %%email %%quote % -u %user % -h %host % -s %scheme % -k %token %"
319335EOF
320336
321337 open (FD, " | $ENV {'P4EXEC'} -p $ENV {'VCS_P4PORT'} -u mfa_test_user -P Mfau1111 triggers -i " );
@@ -341,7 +357,7 @@ Update:2013/02/19 09:13:18
341357Access:2013/06/24 12:38:18
342358
343359Description:
344- Created by $ENV {'VCS_P4USER'}.
360+ Created by $ENV {'VCS_P4USER'}.
345361
346362Root:$root
347363
@@ -352,8 +368,8 @@ SubmitOptions:submitunchanged
352368LineEnd:local
353369
354370View:
355- //depot/... //$ENV {'VCS_P4CLIENT'}/...
356- -//depot/Assets/excludedfile.txt //$ENV {'VCS_P4CLIENT'}/Assets/excludedfile.txt
371+ //depot/... //$ENV {'VCS_P4CLIENT'}/...
372+ -//depot/Assets/excludedfile.txt //$ENV {'VCS_P4CLIENT'}/Assets/excludedfile.txt
357373EOF
358374
359375 open (FD, " | $ENV {'P4EXEC'} -p $ENV {'VCS_P4PORT'} -u vcs_test_user client -i " );
0 commit comments