Group/smoketest.pl
branchSymbian3
changeset 38 09fe1b977394
parent 25 41d3d13445ee
child 47 a7888304ad19
equal deleted inserted replaced
37:39b95dd8b504 38:09fe1b977394
    17 use Getopt::Long;
    17 use Getopt::Long;
    18 use File::Copy;
    18 use File::Copy;
    19 use File::Path;
    19 use File::Path;
    20 
    20 
    21 my $target;
    21 my $target;
       
    22 my $ats_version;
    22 my $help;
    23 my $help;
    23 
    24 
    24 sub usage($);
    25 sub usage($);
    25 sub help();
    26 sub help();
    26 sub usage_error();
    27 sub usage_error();
    27 
    28 
    28 my %optmap = (  'target' => \$target,
    29 my %optmap = (  'target' => \$target,
       
    30 				'ats-version' => \$ats_version,
    29 				'help' => \$help);
    31 				'help' => \$help);
    30 
    32 
    31 GetOptions(\%optmap,
    33 GetOptions(\%optmap,
    32           'target=s',
    34           'target=s',
       
    35 		  'ats-version=s',
    33 		  'help!') 
    36 		  'help!') 
    34           or usage_error();
    37           or usage_error();
    35 
    38 
    36 if ($help) {
    39 if ($help) {
    37 	help();
    40 	help();
    47     print "Building ATS test drop for Syborg... \n";
    50     print "Building ATS test drop for Syborg... \n";
    48 }
    51 }
    49 else {
    52 else {
    50 	# unknown target.
    53 	# unknown target.
    51     usage_error();
    54     usage_error();
       
    55 }
       
    56 
       
    57 # --ats-version is not mandatory.
       
    58 if (!defined($ats_version)) { # Set ats3 by default
       
    59 	$ats_version = "ats3" 
    52 }
    60 }
    53 
    61 
    54 unlink "smoketest.zip";
    62 unlink "smoketest.zip";
    55 rmtree "temp";
    63 rmtree "temp";
    56 mkpath "temp";
    64 mkpath "temp";
    69 	mkpath "temp/smoketest/bitmap/general";
    77 	mkpath "temp/smoketest/bitmap/general";
    70 	mkpath "temp/smoketest/ethernet/general";
    78 	mkpath "temp/smoketest/ethernet/general";
    71 	mkpath "temp/smoketest/web/general";
    79 	mkpath "temp/smoketest/web/general";
    72 
    80 
    73 	my $epoc=$ENV{'EPOCROOT'} . "epoc32/";
    81 	my $epoc=$ENV{'EPOCROOT'} . "epoc32/";
    74 	copy("smoketest.xml",												"temp/test.xml");
    82 	if (lc($ats_version) eq "ats3") { copy("smoketest.xml",				"temp/test.xml"); } # Use ATS3 test plan.
       
    83 	if (lc($ats_version) eq "ats4") { copy("ats4_smoketest.xml",		"temp/test.xml"); } # Use ATS4 test plan.
    75 	copy($epoc . "data/z/smoketest/smoketest_agenda.ini",				"temp/smoketest/general/smoketest_agenda.ini");
    84 	copy($epoc . "data/z/smoketest/smoketest_agenda.ini",				"temp/smoketest/general/smoketest_agenda.ini");
    76 	copy($epoc . "data/z/smoketest/smoketest_agenda.script",			"temp/smoketest/general/smoketest_agenda.script");
    85 	copy($epoc . "data/z/smoketest/smoketest_agenda.script",			"temp/smoketest/general/smoketest_agenda.script");
    77 	copy($epoc . "data/z/smoketest/smoketest_apploader.ini",			"temp/smoketest/general/smoketest_apploader.ini");
    86 	copy($epoc . "data/z/smoketest/smoketest_apploader.ini",			"temp/smoketest/general/smoketest_apploader.ini");
    78 	copy($epoc . "data/z/smoketest/smoketest_apploader.script",			"temp/smoketest/general/smoketest_apploader.script");
    87 	copy($epoc . "data/z/smoketest/smoketest_apploader.script",			"temp/smoketest/general/smoketest_apploader.script");
    79 	copy($epoc . "data/z/smoketest/smoketest_contacts.ini",				"temp/smoketest/general/smoketest_contacts.ini");
    88 	copy($epoc . "data/z/smoketest/smoketest_contacts.ini",				"temp/smoketest/general/smoketest_contacts.ini");
   192 	copy($epoc . "data/c/smoketest/web/img8.jpg",						"temp/smoketest/web/general/img8.jpg");
   201 	copy($epoc . "data/c/smoketest/web/img8.jpg",						"temp/smoketest/web/general/img8.jpg");
   193 	copy($epoc . "winscw/c/smoketest/ui_browser_control_smoke.cfg",   	"temp/smoketest/general/ui_browser_control_smoke.cfg");
   202 	copy($epoc . "winscw/c/smoketest/ui_browser_control_smoke.cfg",   	"temp/smoketest/general/ui_browser_control_smoke.cfg");
   194 	copy($epoc . "release/winscw/udeb/BrCtlApiTest.dll",				"temp/smoketest/winscw_udeb/BrCtlApiTest.dll");
   203 	copy($epoc . "release/winscw/udeb/BrCtlApiTest.dll",				"temp/smoketest/winscw_udeb/BrCtlApiTest.dll");
   195 }
   204 }
   196 elsif ($target eq "SYBORG") { # Build ATS test drop for Syborg.
   205 elsif ($target eq "SYBORG") { # Build ATS test drop for Syborg.
   197 	copy("smoketest_syborg.xml",										"temp/test.xml");
   206 	if (lc($ats_version) eq "ats3") { copy("smoketest_syborg.xml",		"temp/test.xml"); } # Use ATS3 test plan.
       
   207 	if (lc($ats_version) eq "ats4") { copy("ats4_smoketest_syborg.xml",	"temp/test.xml"); } # Use ATS4 test plan.
   198 }
   208 }
   199 
   209 
   200 system("7z a -tzip smoketest.zip ./temp/*");
   210 system("7z a -tzip smoketest.zip ./temp/*");
   201 
   211 
   202 exit 0;
   212 exit 0;
   207     my $fh = $error == 0 ? *STDOUT : *STDERR;
   217     my $fh = $error == 0 ? *STDOUT : *STDERR;
   208     print $fh "smoketest.pl\n" .
   218     print $fh "smoketest.pl\n" .
   209             "Specify the target\n" .
   219             "Specify the target\n" .
   210             "synopsis:\n" .
   220             "synopsis:\n" .
   211             "  smoketest.pl --help\n" .
   221             "  smoketest.pl --help\n" .
   212             "  smoketest.pl [--target=TARGET] \n" .
   222             "  smoketest.pl [--target=TARGET] [--ats-version=VERSION]\n" .
   213             "options:\n" .
   223             "options:\n" .
   214             "  --help                        Display this help and exit.\n" .
   224             "  --help                        Display this help and exit.\n" .
   215             "  --target=TARGET               TARGET is the target on which the smoketest will be run (WINSCW | SYBORG). If not specified WINSCW will be used.\n";
   225 			"  --target=TARGET               TARGET is the target on which the smoketest will be run (WINSCW | SYBORG). If not specified WINSCW will be used.\n" .
   216     exit $error;            
   226             "  --ats-version=VERSION         VERSION is the version of ATS which will be used to run the smoketest (ATS3 | ATS4). If not specified ATS3 will be set by default.\n";
       
   227     exit $error;
   217 }
   228 }
   218 
   229 
   219 sub help()
   230 sub help()
   220 {
   231 {
   221     usage(0);
   232     usage(0);