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 # We must decide if the test needs to be run using epoc or the test framework. This is |
370 |
371 # done by looking for _WM (Window Manager) appended to the script name. |
371 #alloc tests must be run under debug |
372 # NB. This only applies to Typhoon, Jetstream is unaffected. |
372 if($ScriptFile =~ /_recog_alloc.script/i) |
373 |
373 { |
374 if (!(-f $eka2IdentifyFile) && ($ScriptFile =~ /_wm.script/i)) # This script must be run using epoc and the recogniser |
374 $Cmd = "$RecogUdebTestFramework $ScriptFile"; |
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"; |
|
386 } |
375 } |
387 else |
376 elsif($ScriptFile =~ /_nocap_alloc.script/i) |
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) |
|
404 { |
377 { |
405 $Cmd = "$NoneUdebTestFramework $ScriptFile"; |
378 $Cmd = "$NoneUdebTestFramework $ScriptFile"; |
406 } |
379 } |
407 elsif(($ScriptFile =~ /_alloc.script/i) || ($ScriptFile =~ /_alloc_wm.script/i) || ($ScriptFile =~ /_debug.script/i) || ($optctl{"d"}) ) |
380 elsif(($ScriptFile =~ /_alloc.script/i) || ($ScriptFile =~ /_alloc_wm.script/i) || ($ScriptFile =~ /_debug.script/i) || ($optctl{"d"}) ) |
408 { |
381 { |
409 $Cmd = "$UdebTestFramework $ScriptFile"; |
382 $Cmd = "$UdebTestFramework $ScriptFile"; |
410 } |
383 } |
411 elsif($ScriptFile =~ /_recog.script/i) |
384 elsif($ScriptFile =~ /_recog.script/i) |
412 { |
385 { |
413 $Cmd = "$RecogUrelTestFramework $ScriptFile"; |
386 $Cmd = "$RecogUrelTestFramework $ScriptFile"; |
414 } |
387 } |
415 elsif($ScriptFile =~ /_nocap.script/i) |
388 elsif($ScriptFile =~ /_nocap.script/i) |
416 { |
389 { |
417 $Cmd = "$NoneUrelTestFramework $ScriptFile"; |
390 $Cmd = "$NoneUrelTestFramework $ScriptFile"; |
418 } |
391 } |
419 elsif($ScriptFile =~ /_mmddcap.script/i) |
392 elsif($ScriptFile =~ /_mmddcap.script/i) |
420 { |
393 { |
421 $Cmd = "$MMDDCapUrelTestFramework $ScriptFile"; |
394 $Cmd = "$MMDDCapUrelTestFramework $ScriptFile"; |
422 } |
395 } |
423 elsif($ScriptFile =~ /_uecap.script/i) |
396 elsif($ScriptFile =~ /_uecap.script/i) |
424 { |
397 { |
425 $Cmd = "$UECapUrelTestFramework $ScriptFile"; |
398 $Cmd = "$UECapUrelTestFramework $ScriptFile"; |
426 } |
399 } |
427 elsif($ScriptFile =~ /_secdisp.script/i) |
400 elsif($ScriptFile =~ /_secdisp.script/i) |
428 { |
401 { |
429 #Take a backup of the existing ini files to .OLD and copy our ini files from the current dir to \epoc folders |
402 #Take a backup of the existing ini files to .OLD and copy our ini files from the current dir to \epoc folders |
430 if(!(system($copy_ini_secdisp)==0)) |
403 if(!(system($copy_ini_secdisp)==0)) |
431 { |
404 { |
432 print "Failure to execute - $Cmd: $!"; |
405 print "Failure to execute - $Cmd: $!"; |
433 print TESTRUNLOG "Failure to execute - $Cmd: $!\n"; |
406 print TESTRUNLOG "Failure to execute - $Cmd: $!\n"; |
434 } |
407 } |
435 $Cmd = "$UrelTestFramework $ScriptFile"; |
408 $Cmd = "$UrelTestFramework $ScriptFile"; |
436 } |
409 } |
437 elsif($ScriptFile =~ /\\te_/i) |
410 elsif($ScriptFile =~ /\\te_/i) |
438 { |
411 { |
439 $Cmd = "$UdebTestExecute $ScriptFile"; |
412 $Cmd = "$UdebTestExecute $ScriptFile"; |
440 } |
413 } |
441 elsif($ScriptFile =~ /_te.script/i) |
414 elsif($ScriptFile =~ /_te.script/i) |
442 { |
415 { |
443 $Cmd = "$UdebTestExecute $ScriptFile"; |
416 $Cmd = "$UdebTestExecute $ScriptFile"; |
444 } |
417 } |
445 else |
418 else |
446 { |
419 { |
447 $Cmd = "$UrelTestFramework $ScriptFile"; |
420 $Cmd = "$UrelTestFramework $ScriptFile"; |
448 } |
421 } |
449 } |
|
450 |
|
451 |
|
452 |
422 |
453 ($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime(time); |
423 ($sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime(time); |
454 print "Starting script at $hour:$min:$sec\n"; |
424 print "Starting script at $hour:$min:$sec\n"; |
455 print TESTRUNLOG "Starting script at $hour:$min:$sec\n"; |
425 print TESTRUNLOG "Starting script at $hour:$min:$sec\n"; |
456 |
426 |