mmtestenv/mmtesttools/Scripts/RunTests.bat
branchRCL_3
changeset 50 948c7f65f6d4
parent 49 735348f59235
equal deleted inserted replaced
49:735348f59235 50:948c7f65f6d4
   365     $ScriptFile =~ s/^[\s]*[a-z]://i;
   365     $ScriptFile =~ s/^[\s]*[a-z]://i;
   366 
   366 
   367     my $regex = quotemeta $EpocCDrive;
   367     my $regex = quotemeta $EpocCDrive;
   368     $ScriptFile =~ s/$regex//gi;
   368     $ScriptFile =~ s/$regex//gi;
   369 
   369 
   370 
   370     # We must decide if the test needs to be run using epoc or the test framework. This is
   371     #alloc tests must be run under debug
   371     # done by looking for _WM (Window Manager) appended to the script name. 
   372     if($ScriptFile =~ /_recog_alloc.script/i)
   372     # NB. This only applies to Typhoon, Jetstream is unaffected.
   373 	    {
   373 
   374 	    $Cmd = "$RecogUdebTestFramework $ScriptFile";
   374     if (!(-f $eka2IdentifyFile) && ($ScriptFile =~ /_wm.script/i)) # This script must be run using epoc and the recogniser
       
   375       {
       
   376       # First create the recogniser config file
       
   377       my $line1 = "// This file is generated by runtests.bat\n";
       
   378       my $line2 = "RUN_SCRIPT\n";
       
   379       my $line3 = "";
       
   380 
       
   381       #alloc tests must be run under debug
       
   382       if($ScriptFile =~ /_alloc_wm.script/i)
       
   383         {
       
   384         $Cmd = "$UdebEpocEmulator";
       
   385         $line3 = "C:$ScriptFile -t 15000000\n";
   375         }
   386         }
   376     elsif($ScriptFile =~ /_nocap_alloc.script/i)
   387       else
       
   388         {
       
   389         $Cmd = "$UrelEpocEmulator";
       
   390         $line3 = "C:$ScriptFile 15000000\n";
       
   391         }
       
   392       open(RECOGNISER_CFG_FILE,">$RecogniserCfgFile") or die "Could not open $RecogniserCfgFile for writing\n";
       
   393       print RECOGNISER_CFG_FILE $line1, $line2, $line3; 
       
   394       close(RECOGNISER_CFG_FILE);
       
   395       }
       
   396     else                              # This script can be run from the test framework
       
   397       {
       
   398       #alloc tests must be run under debug
       
   399       if($ScriptFile =~ /_recog_alloc.script/i)
       
   400 	{
       
   401 	$Cmd = "$RecogUdebTestFramework $ScriptFile";
       
   402         }
       
   403       elsif($ScriptFile =~ /_nocap_alloc.script/i)
   377        	{
   404        	{
   378       	$Cmd = "$NoneUdebTestFramework $ScriptFile";
   405       	$Cmd = "$NoneUdebTestFramework $ScriptFile";
   379        	}
   406        	}
   380     elsif(($ScriptFile =~ /_alloc.script/i) || ($ScriptFile =~ /_alloc_wm.script/i) || ($ScriptFile =~ /_debug.script/i) || ($optctl{"d"}) )
   407       elsif(($ScriptFile =~ /_alloc.script/i) || ($ScriptFile =~ /_alloc_wm.script/i) || ($ScriptFile =~ /_debug.script/i) || ($optctl{"d"}) )
   381        	{
   408        	{
   382       	$Cmd = "$UdebTestFramework $ScriptFile";
   409       	$Cmd = "$UdebTestFramework $ScriptFile";
   383        	}
   410        	}
   384     elsif($ScriptFile =~ /_recog.script/i)
   411      elsif($ScriptFile =~ /_recog.script/i)
   385        	{
   412        	{
   386       	$Cmd = "$RecogUrelTestFramework $ScriptFile";
   413       	$Cmd = "$RecogUrelTestFramework $ScriptFile";
   387        	}
   414        	}
   388     elsif($ScriptFile =~ /_nocap.script/i)
   415      elsif($ScriptFile =~ /_nocap.script/i)
   389        	{
   416        	{
   390       	$Cmd = "$NoneUrelTestFramework $ScriptFile";
   417       	$Cmd = "$NoneUrelTestFramework $ScriptFile";
   391        	}	
   418        	}	
   392     elsif($ScriptFile =~ /_mmddcap.script/i)
   419      elsif($ScriptFile =~ /_mmddcap.script/i)
   393        	{
   420        	{
   394       	$Cmd = "$MMDDCapUrelTestFramework $ScriptFile";
   421       	$Cmd = "$MMDDCapUrelTestFramework $ScriptFile";
   395        	}
   422        	}
   396     elsif($ScriptFile =~ /_uecap.script/i)
   423      elsif($ScriptFile =~ /_uecap.script/i)
   397        	{
   424        	{
   398       	$Cmd = "$UECapUrelTestFramework $ScriptFile";
   425       	$Cmd = "$UECapUrelTestFramework $ScriptFile";
   399        	}
   426        	}
   400     elsif($ScriptFile =~ /_secdisp.script/i)
   427      elsif($ScriptFile =~ /_secdisp.script/i)
   401       	{
   428       	{
   402      	#Take a backup of the existing ini files to .OLD and copy our ini files from the current dir to \epoc folders
   429      	#Take a backup of the existing ini files to .OLD and copy our ini files from the current dir to \epoc folders
   403 	    if(!(system($copy_ini_secdisp)==0))
   430 	if(!(system($copy_ini_secdisp)==0))
   404       	    {
   431       	    {
   405       	    print "Failure to execute - $Cmd: $!";
   432       	    print "Failure to execute - $Cmd: $!";
   406       	    print TESTRUNLOG "Failure to execute - $Cmd: $!\n";
   433       	    print TESTRUNLOG "Failure to execute - $Cmd: $!\n";
   407       	    }
   434       	    }
   408 	    $Cmd = "$UrelTestFramework $ScriptFile";
   435 	$Cmd = "$UrelTestFramework $ScriptFile";
   409 	    }
   436 	}
   410     elsif($ScriptFile =~ /\\te_/i)
   437      elsif($ScriptFile =~ /\\te_/i)
   411  	    {
   438  	{
   412  	    $Cmd = "$UdebTestExecute $ScriptFile";
   439  	$Cmd = "$UdebTestExecute $ScriptFile";
   413  	    }
   440  	}
   414     elsif($ScriptFile =~ /_te.script/i)
   441      elsif($ScriptFile =~ /_te.script/i)
   415  	    {
   442  	{
   416  	    $Cmd = "$UdebTestExecute $ScriptFile";
   443  	$Cmd = "$UdebTestExecute $ScriptFile";
   417  	    }
   444  	}
   418     else
   445      else
   419      	{
   446      	{
   420        	$Cmd = "$UrelTestFramework $ScriptFile";
   447        	$Cmd = "$UrelTestFramework $ScriptFile";
   421        	}
   448        	}
       
   449       }
       
   450 
       
   451 
   422 
   452 
   423     ($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime(time);  
   453     ($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime(time);  
   424     print "Starting script at $hour:$min:$sec\n";
   454     print "Starting script at $hour:$min:$sec\n";
   425     print TESTRUNLOG "Starting script at $hour:$min:$sec\n";
   455     print TESTRUNLOG "Starting script at $hour:$min:$sec\n";
   426 
   456