os/mm/mmtestenv/mmtesttools/Scripts/RunTests.bat
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
@rem
sl@0
     2
@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
@rem All rights reserved.
sl@0
     4
@rem This component and the accompanying materials are made available
sl@0
     5
@rem under the terms of "Eclipse Public License v1.0"
sl@0
     6
@rem which accompanies this distribution, and is available
sl@0
     7
@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
@rem
sl@0
     9
@rem Initial Contributors:
sl@0
    10
@rem Nokia Corporation - initial contribution.
sl@0
    11
@rem
sl@0
    12
@rem Contributors:
sl@0
    13
@rem
sl@0
    14
@rem Description:
sl@0
    15
@rem
sl@0
    16
@rem = '--*-Perl-*--
sl@0
    17
@echo off
sl@0
    18
if "%OS%" == "Windows_NT" goto WinNT
sl@0
    19
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
sl@0
    20
goto endofperl
sl@0
    21
:WinNT
sl@0
    22
perl -x -S "%0" %*
sl@0
    23
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
sl@0
    24
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
sl@0
    25
goto endofperl
sl@0
    26
@rem ';
sl@0
    27
#!perl
sl@0
    28
#line 14
sl@0
    29
    eval 'exec perl.exe -S $0 ${1+"$@"}'
sl@0
    30
    if $running_under_some_shell;
sl@0
    31
sl@0
    32
use strict; # important pragma
sl@0
    33
use File::Copy;
sl@0
    34
use File::Find;
sl@0
    35
sl@0
    36
sl@0
    37
my @Month =("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
sl@0
    38
my ($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst); 
sl@0
    39
sl@0
    40
sl@0
    41
my $BuildToUse="winscw";
sl@0
    42
my $EpocCDrive = "$ENV{EPOCROOT}epoc32\\$BuildToUse\\c";
sl@0
    43
my $ResultsDirectory = "$EpocCDrive\\Logs\\TestResults";
sl@0
    44
my $TestFrameworkOpts="";
sl@0
    45
my $TestFrameworkNoDelay="";
sl@0
    46
my $Debug=0;
sl@0
    47
my $Warning=0; #controls how pernickety the output is
sl@0
    48
my $Cmd; #general variable to carry system commands
sl@0
    49
my $CodeCover=0;
sl@0
    50
my $ScriptToRun='[\S]+\.script';
sl@0
    51
my $TimesToRun=1;
sl@0
    52
sl@0
    53
sl@0
    54
if(@ARGV && (($ARGV[0] eq "-h") ||
sl@0
    55
     ($ARGV[0] eq "--h") ||
sl@0
    56
     ($ARGV[0] eq "-help") ||
sl@0
    57
     ($ARGV[0] eq "--help") ||
sl@0
    58
     ($ARGV[0] eq "help"))
sl@0
    59
	 )
sl@0
    60
    {
sl@0
    61
    print "Runs all the Test Framework and Test Execute script files.\n";
sl@0
    62
    print "\nSyntax : runtests -b=sss -d -c -a -v=nnn -cc -rep=nnn -q\n";
sl@0
    63
	print "-b   Compiler version to use [wins\|winscw) (default=$BuildToUse)\n";
sl@0
    64
    print "-d   Force to run testframework at debug mode \n";
sl@0
    65
    print "-c   Clean results directory ($ResultsDirectory)\n";
sl@0
    66
    print "-a   Full output in testframework console\n";
sl@0
    67
    print "-v   Provide verbose output 1=limited 2=maximum\n";
sl@0
    68
    print "-s   Define a script to be executed (ommitting causes all scripts to be run)\n";
sl@0
    69
    print "-cc  Only run release builds for Code Cover\n";
sl@0
    70
    print "-rep Repeat the test run a number of times\n";
sl@0
    71
    print "-q      Start testframework without the 20 second delay\n";
sl@0
    72
sl@0
    73
    exit 0;
sl@0
    74
    }
sl@0
    75
sl@0
    76
sl@0
    77
sl@0
    78
use Getopt::Long;
sl@0
    79
my %optctl = ();
sl@0
    80
keys(%optctl)=10;
sl@0
    81
unless (GetOptions (\%optctl, "b=s","d","c","v=i", "cc", "s=s","rep=i","a","q")) 
sl@0
    82
  {exit 1;}
sl@0
    83
sl@0
    84
sl@0
    85
sl@0
    86
if($optctl{"b"})
sl@0
    87
  {
sl@0
    88
  $BuildToUse=$optctl{"b"};
sl@0
    89
  if((lc($BuildToUse) ne "wins") && (lc($BuildToUse) ne "winscw"))
sl@0
    90
    {
sl@0
    91
	print STDERR "only wins and winscw builds are supported\n";
sl@0
    92
	exit 1;
sl@0
    93
	}
sl@0
    94
sl@0
    95
   $EpocCDrive = "$ENV{EPOCROOT}epoc32\\$BuildToUse\\c";
sl@0
    96
   $ResultsDirectory = "$EpocCDrive\\Logs\\TestResults";
sl@0
    97
  }
sl@0
    98
#repeat test run a number of times
sl@0
    99
if($optctl{"rep"})
sl@0
   100
  {
sl@0
   101
  $TimesToRun = $optctl{"rep"};
sl@0
   102
  if(($TimesToRun < 1))
sl@0
   103
    {
sl@0
   104
    print STDERR "must specify a positive number of repeates\n";
sl@0
   105
    exit 1;
sl@0
   106
    }
sl@0
   107
  }
sl@0
   108
sl@0
   109
sl@0
   110
#debug on
sl@0
   111
if($optctl{"v"})
sl@0
   112
  {$Debug=$optctl{"v"};}
sl@0
   113
sl@0
   114
if($Debug ==2)
sl@0
   115
  {
sl@0
   116
  print "Command line options:-\n";
sl@0
   117
  while ((my $key, my $val) = each %optctl) 
sl@0
   118
    {print "$key  =>  $val\n";}
sl@0
   119
  }
sl@0
   120
sl@0
   121
sl@0
   122
#Code Cover run
sl@0
   123
if($optctl{"cc"})
sl@0
   124
  {$CodeCover=1;}
sl@0
   125
sl@0
   126
sl@0
   127
if($Debug ==2)
sl@0
   128
  {
sl@0
   129
  print "Command line options:-\n";
sl@0
   130
  while ((my $key, my $val) = each %optctl) 
sl@0
   131
    {print "$key  =>  $val\n";}
sl@0
   132
  }
sl@0
   133
sl@0
   134
sl@0
   135
sl@0
   136
if($optctl{"c"})
sl@0
   137
  {
sl@0
   138
  print "Deleting Existing Results FIles\n";
sl@0
   139
sl@0
   140
  my @ExistingResultsFiles;
sl@0
   141
  my $ExistingResultsFile;
sl@0
   142
  find( sub { push @ExistingResultsFiles, $File::Find::name if /\.htm/ }, ($ResultsDirectory) );
sl@0
   143
sl@0
   144
sl@0
   145
  foreach $ExistingResultsFile (@ExistingResultsFiles)
sl@0
   146
    {
sl@0
   147
    $ExistingResultsFile =~ s/\//\\/g;
sl@0
   148
    $Cmd="del $ExistingResultsFile";
sl@0
   149
    if($Debug==2)
sl@0
   150
	  {print "executing $Cmd\n";}
sl@0
   151
    system($Cmd);
sl@0
   152
	}
sl@0
   153
sl@0
   154
  }
sl@0
   155
sl@0
   156
if($optctl{"a"})
sl@0
   157
  {
sl@0
   158
  print "Full output in testframework console\n";
sl@0
   159
  $TestFrameworkOpts .= " -a";
sl@0
   160
  }
sl@0
   161
sl@0
   162
if($optctl{"s"})
sl@0
   163
  {
sl@0
   164
  $ScriptToRun = $optctl{"s"};
sl@0
   165
    
sl@0
   166
  print "Looking for script file $ScriptToRun\n";
sl@0
   167
  }
sl@0
   168
sl@0
   169
# Only add -q flag to textframework request
sl@0
   170
if($optctl{"q"})
sl@0
   171
	{
sl@0
   172
  	$TestFrameworkNoDelay .= " -q";
sl@0
   173
  	}
sl@0
   174
sl@0
   175
my $UrelTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\testframework.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   176
my $UdebTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\udeb\\testframework.exe -t" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   177
my $RecogUrelTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\testframeworkrecognizer.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   178
my $RecogUdebTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\udeb\\testframeworkrecognizer.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   179
my $NoneUrelTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\testframeworkNone.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   180
my $NoneUdebTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\udeb\\testframeworkNone.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   181
my $MMDDCapUrelTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\testframeworkMMDDCap.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   182
my $UECapUrelTestFramework = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\testframeworkUECap.exe" . $TestFrameworkOpts . $TestFrameworkNoDelay;
sl@0
   183
my $UrelEpocEmulator  = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\epoc.exe" . $TestFrameworkOpts;
sl@0
   184
my $UdebEpocEmulator  = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\udeb\\epoc.exe" . $TestFrameworkOpts;
sl@0
   185
my $eka2IdentifyFile  = "$ENV{EPOCROOT}epoc32\\release\\winscw\\udeb\\winsgui.dll"; # if file present, is EKA2 build
sl@0
   186
my $UrelTestExecute = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\urel\\testexecute.exe" . $TestFrameworkOpts;
sl@0
   187
my $UdebTestExecute = "$ENV{EPOCROOT}epoc32\\release\\$BuildToUse\\udeb\\testexecute.exe" . $TestFrameworkOpts;
sl@0
   188
sl@0
   189
my $RecogniserCfgFile = "$EpocCDrive\\mm\\AutorunTests.cfg";
sl@0
   190
my $copy_ini_secdisp = "perl secdisp_ini_append.pl append"; 
sl@0
   191
my $delete_ini_secdisp = "perl secdisp_ini_append.pl restore";
sl@0
   192
if($Debug>=1)
sl@0
   193
  {
sl@0
   194
  print "\nUsing $RecogniserCfgFile to configure the Epoc recogniser\n";
sl@0
   195
  }
sl@0
   196
sl@0
   197
print "\nScanning $EpocCDrive for script files\n";
sl@0
   198
my @ScriptFilesFound;
sl@0
   199
my $ScriptFile;
sl@0
   200
my $ScriptToRunTmp = $ScriptToRun;
sl@0
   201
sl@0
   202
#Firstly, try to find an exact script name
sl@0
   203
print "ScriptToRunTmp = $ScriptToRunTmp\n";
sl@0
   204
sl@0
   205
if(!($ScriptToRun =~ /\.script/i))
sl@0
   206
  {$ScriptToRunTmp = $ScriptToRun .'\.script';}
sl@0
   207
 
sl@0
   208
#find all the required script files
sl@0
   209
find( sub { push @ScriptFilesFound, $File::Find::name if /^$ScriptToRunTmp$/i }, ($EpocCDrive) );
sl@0
   210
sl@0
   211
#if no scripts were found, look for scripts that wildcard match
sl@0
   212
if(@ScriptFilesFound < 1)
sl@0
   213
  {
sl@0
   214
  if(!($ScriptToRun =~ /\.script/i))
sl@0
   215
    {$ScriptToRunTmp = '[\S]*' . $ScriptToRun .'[\S]*\.script';}
sl@0
   216
  else
sl@0
   217
    {$ScriptToRunTmp = $ScriptToRun;}
sl@0
   218
sl@0
   219
  find( sub { push @ScriptFilesFound, $File::Find::name if /$ScriptToRunTmp/i }, ($EpocCDrive) );
sl@0
   220
  }
sl@0
   221
sl@0
   222
if($Debug>=1)
sl@0
   223
  {
sl@0
   224
  my $len = @ScriptFilesFound;
sl@0
   225
  print "\nScanned $len script files in $EpocCDrive\n";
sl@0
   226
  foreach $ScriptFile (@ScriptFilesFound)
sl@0
   227
    {print "$ScriptFile\n";}
sl@0
   228
  }
sl@0
   229
sl@0
   230
sl@0
   231
#look for any scripts that are called from other scripts; no need to call these directly
sl@0
   232
my @IndirectScripts;
sl@0
   233
my $IndirectScript;
sl@0
   234
foreach $ScriptFile (@ScriptFilesFound)
sl@0
   235
  {
sl@0
   236
  unless (open(SCRIPTFILE,"$ScriptFile")) 
sl@0
   237
    {
sl@0
   238
    print STDERR "Can't open $ScriptFile: $!\n";
sl@0
   239
    exit 1;
sl@0
   240
    }
sl@0
   241
 
sl@0
   242
  my $ScriptFileLine;
sl@0
   243
  my @ResultFileContents = <SCRIPTFILE>;
sl@0
   244
sl@0
   245
  foreach $ScriptFileLine (@ResultFileContents)
sl@0
   246
    {
sl@0
   247
    if($ScriptFileLine =~ /^RUN_SCRIPT[\s]+[\S]+[\s]*$/)
sl@0
   248
      { 
sl@0
   249
	  if($Debug==2)
sl@0
   250
        {print "File: $ScriptFile Line:  $ScriptFileLine\n";}
sl@0
   251
	  
sl@0
   252
	  $IndirectScript =  $ScriptFileLine;
sl@0
   253
	  $_ = $IndirectScript;
sl@0
   254
sl@0
   255
	  m/^RUN_SCRIPT[\s]+([\S]+)[\s]*$/;
sl@0
   256
      $IndirectScript=($1);
sl@0
   257
sl@0
   258
	  if($Debug==2)
sl@0
   259
        {print "Secondary Script = $IndirectScript\n";}
sl@0
   260
sl@0
   261
	  push @IndirectScripts, $IndirectScript;
sl@0
   262
	  }
sl@0
   263
    }
sl@0
   264
  }
sl@0
   265
sl@0
   266
sl@0
   267
#produce a list of the script files that need running
sl@0
   268
my @ScriptsToRun;
sl@0
   269
ScriptFile_LBL: foreach $ScriptFile (@ScriptFilesFound)
sl@0
   270
  {
sl@0
   271
  
sl@0
   272
  foreach $IndirectScript (@IndirectScripts)
sl@0
   273
    {
sl@0
   274
	if($ScriptFile =~ /$IndirectScript/)
sl@0
   275
	  {
sl@0
   276
	  if($Debug==2)
sl@0
   277
        {print "Not running $ScriptFile directly\n";}
sl@0
   278
	  next ScriptFile_LBL;}
sl@0
   279
	}   
sl@0
   280
sl@0
   281
  push @ScriptsToRun, $ScriptFile;
sl@0
   282
  }
sl@0
   283
sl@0
   284
sl@0
   285
if($Debug>=1)
sl@0
   286
  {
sl@0
   287
  foreach $ScriptFile (@ScriptsToRun)
sl@0
   288
    {print "Running $ScriptFile\n";}
sl@0
   289
  }
sl@0
   290
sl@0
   291
sl@0
   292
unless (open(TESTRUNLOG,">TestRunLog.txt")) 
sl@0
   293
  {
sl@0
   294
  print STDERR "Can't open orphanedtests.txt: $!\n";
sl@0
   295
  exit 1;
sl@0
   296
  }
sl@0
   297
sl@0
   298
unless (open(MASTERSCRIPT,">master.script")) 
sl@0
   299
  {
sl@0
   300
  print STDERR "Can't open master.script: $!\n";
sl@0
   301
  exit 1;
sl@0
   302
  }
sl@0
   303
unless (open(MASTERALLOCSCRIPT,">master_alloc.script")) 
sl@0
   304
  {
sl@0
   305
  print STDERR "Can't open master_alloc.script: $!\n";
sl@0
   306
  exit 1;
sl@0
   307
  }
sl@0
   308
sl@0
   309
#create a master script file, this could be usefull for running on hardware.
sl@0
   310
foreach $ScriptFile (@ScriptsToRun)
sl@0
   311
  {
sl@0
   312
  $ScriptFile =~ s/\//\\/g;
sl@0
   313
  $ScriptFile =~ s/^[\s]*[a-z]://i;
sl@0
   314
sl@0
   315
  my $regex = quotemeta $EpocCDrive;
sl@0
   316
  $ScriptFile =~ s/$regex//gi;
sl@0
   317
sl@0
   318
  #alloc tests must be run under debug
sl@0
   319
  if($ScriptFile =~ /_alloc(_wm)?.script/i)
sl@0
   320
    {
sl@0
   321
    print MASTERALLOCSCRIPT "RUN_SCRIPT $ScriptFile\n";}
sl@0
   322
  else
sl@0
   323
    {print MASTERSCRIPT "RUN_SCRIPT $ScriptFile\n";}
sl@0
   324
sl@0
   325
  }
sl@0
   326
close MASTERSCRIPT;
sl@0
   327
close MASTERALLOCSCRIPT;
sl@0
   328
sl@0
   329
sl@0
   330
#remove any alloc tests from list. Alloc tests must be run on debug builds, Code Cover tests 
sl@0
   331
#are only done against release builds.
sl@0
   332
if($CodeCover==1)
sl@0
   333
  {
sl@0
   334
  my @ScriptsToRunTmp=();
sl@0
   335
  foreach $ScriptFile (@ScriptsToRun)
sl@0
   336
    {
sl@0
   337
    if(!($ScriptFile =~ /_alloc(_wm)?.script/i))
sl@0
   338
	  {
sl@0
   339
      push @ScriptsToRunTmp, $ScriptFile;
sl@0
   340
	  }
sl@0
   341
	}
sl@0
   342
  @ScriptsToRun = @ScriptsToRunTmp;
sl@0
   343
  }
sl@0
   344
sl@0
   345
sl@0
   346
my $TotalScriptFiles = @ScriptsToRun;
sl@0
   347
if($TimesToRun > 1)
sl@0
   348
  {
sl@0
   349
  print "Running $TotalScriptFiles scripts  $TimesToRun times\n";
sl@0
   350
  }
sl@0
   351
else
sl@0
   352
  {
sl@0
   353
  print "Running $TotalScriptFiles scripts\n";
sl@0
   354
  }
sl@0
   355
sl@0
   356
sl@0
   357
my $RunCount=0;
sl@0
   358
for ($RunCount = 0; $RunCount < $TimesToRun; $RunCount++) 
sl@0
   359
  {
sl@0
   360
  my $ScriptsRun=0;
sl@0
   361
  #run each script
sl@0
   362
  foreach $ScriptFile (@ScriptsToRun)
sl@0
   363
    {
sl@0
   364
    $ScriptFile =~ s/\//\\/g;
sl@0
   365
    $ScriptFile =~ s/^[\s]*[a-z]://i;
sl@0
   366
sl@0
   367
    my $regex = quotemeta $EpocCDrive;
sl@0
   368
    $ScriptFile =~ s/$regex//gi;
sl@0
   369
sl@0
   370
sl@0
   371
    #alloc tests must be run under debug
sl@0
   372
    if($ScriptFile =~ /_recog_alloc.script/i)
sl@0
   373
	    {
sl@0
   374
	    $Cmd = "$RecogUdebTestFramework $ScriptFile";
sl@0
   375
        }
sl@0
   376
    elsif($ScriptFile =~ /_nocap_alloc.script/i)
sl@0
   377
       	{
sl@0
   378
      	$Cmd = "$NoneUdebTestFramework $ScriptFile";
sl@0
   379
       	}
sl@0
   380
    elsif(($ScriptFile =~ /_alloc.script/i) || ($ScriptFile =~ /_alloc_wm.script/i) || ($ScriptFile =~ /_debug.script/i) || ($optctl{"d"}) )
sl@0
   381
       	{
sl@0
   382
      	$Cmd = "$UdebTestFramework $ScriptFile";
sl@0
   383
       	}
sl@0
   384
    elsif($ScriptFile =~ /_recog.script/i)
sl@0
   385
       	{
sl@0
   386
      	$Cmd = "$RecogUrelTestFramework $ScriptFile";
sl@0
   387
       	}
sl@0
   388
    elsif($ScriptFile =~ /_nocap.script/i)
sl@0
   389
       	{
sl@0
   390
      	$Cmd = "$NoneUrelTestFramework $ScriptFile";
sl@0
   391
       	}	
sl@0
   392
    elsif($ScriptFile =~ /_mmddcap.script/i)
sl@0
   393
       	{
sl@0
   394
      	$Cmd = "$MMDDCapUrelTestFramework $ScriptFile";
sl@0
   395
       	}
sl@0
   396
    elsif($ScriptFile =~ /_uecap.script/i)
sl@0
   397
       	{
sl@0
   398
      	$Cmd = "$UECapUrelTestFramework $ScriptFile";
sl@0
   399
       	}
sl@0
   400
    elsif($ScriptFile =~ /_secdisp.script/i)
sl@0
   401
      	{
sl@0
   402
     	#Take a backup of the existing ini files to .OLD and copy our ini files from the current dir to \epoc folders
sl@0
   403
	    if(!(system($copy_ini_secdisp)==0))
sl@0
   404
      	    {
sl@0
   405
      	    print "Failure to execute - $Cmd: $!";
sl@0
   406
      	    print TESTRUNLOG "Failure to execute - $Cmd: $!\n";
sl@0
   407
      	    }
sl@0
   408
	    $Cmd = "$UrelTestFramework $ScriptFile";
sl@0
   409
	    }
sl@0
   410
    elsif($ScriptFile =~ /\\te_/i)
sl@0
   411
 	    {
sl@0
   412
 	    $Cmd = "$UdebTestExecute $ScriptFile";
sl@0
   413
 	    }
sl@0
   414
    elsif($ScriptFile =~ /_te.script/i)
sl@0
   415
 	    {
sl@0
   416
 	    $Cmd = "$UdebTestExecute $ScriptFile";
sl@0
   417
 	    }
sl@0
   418
    else
sl@0
   419
     	{
sl@0
   420
       	$Cmd = "$UrelTestFramework $ScriptFile";
sl@0
   421
       	}
sl@0
   422
sl@0
   423
    ($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime(time);  
sl@0
   424
    print "Starting script at $hour:$min:$sec\n";
sl@0
   425
    print TESTRUNLOG "Starting script at $hour:$min:$sec\n";
sl@0
   426
sl@0
   427
    $ScriptsRun++;
sl@0
   428
    print "executing $Cmd ($ScriptsRun of $TotalScriptFiles)\n";
sl@0
   429
sl@0
   430
    print TESTRUNLOG "executing $Cmd\n";
sl@0
   431
sl@0
   432
    if(!(system($Cmd)==0))
sl@0
   433
      {
sl@0
   434
      print "Failure to execute - $Cmd: $!";
sl@0
   435
      print TESTRUNLOG "Failure to execute - $Cmd: $!\n";
sl@0
   436
      }
sl@0
   437
   if($ScriptFile =~ /_secdisp.script/i)
sl@0
   438
    {
sl@0
   439
    #Delete .ini files and rename  .OLD files to .ini files
sl@0
   440
    if(!(system($delete_ini_secdisp)==0))
sl@0
   441
         {
sl@0
   442
          print "Failure to execute - $Cmd: $!";
sl@0
   443
          print TESTRUNLOG "Failure to execute - $Cmd: $!\n";
sl@0
   444
          }
sl@0
   445
    } 
sl@0
   446
   
sl@0
   447
    }#foreach $ScriptFile (@ScriptsToRun)
sl@0
   448
sl@0
   449
  if($TimesToRun > 1)
sl@0
   450
    {
sl@0
   451
    #now copy the results to a new numbered directory 
sl@0
   452
    $Cmd = "xcopy /E /R /I /Y P:\\epoc32\\wins\\c\\Logs\\TestResults P:\\epoc32\\wins\\c\\Logs\\TestResults$RunCount";
sl@0
   453
    print "executing $Cmd";
sl@0
   454
sl@0
   455
    if(!(system($Cmd)==0))
sl@0
   456
      {
sl@0
   457
      print "Failure to execute - $Cmd: $!";
sl@0
   458
      print TESTRUNLOG "Failure to execute - $Cmd: $!\n";
sl@0
   459
      }
sl@0
   460
    }
sl@0
   461
  }
sl@0
   462
sl@0
   463
sl@0
   464
sl@0
   465
$Cmd="del /F /Q $RecogniserCfgFile";
sl@0
   466
if($Debug==2)
sl@0
   467
  {print "executing $Cmd\n";}
sl@0
   468
system($Cmd);
sl@0
   469
sl@0
   470
($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime(time);  
sl@0
   471
print "Test run completed at $hour:$min:$sec\n";
sl@0
   472
print TESTRUNLOG "Test run completed at $hour:$min:$sec\n";
sl@0
   473
sl@0
   474
sl@0
   475
__END__
sl@0
   476
sl@0
   477
:endofperl
sl@0
   478