secureswitools/swisistools/test/tsignsis/createandsignunicode.pl
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 #
       
     2 # Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of the License "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: 
       
    15 #
       
    16 
       
    17 
       
    18 
       
    19 	use File::Basename;
       
    20 	my $toworkindir= dirname $0;
       
    21 	print "Changing dir to $toworkindir\n";
       
    22 	chdir $toworkindir;
       
    23 
       
    24 	$logFile = "\\epoc32\\winscw\\c\\createandsignunicode.txt";
       
    25 
       
    26 	#
       
    27 # Counters for results
       
    28 #
       
    29 $NumberOfTests  = 3;
       
    30 $NumberOfPassed = 3;
       
    31 $NumberOfFailed = 0;
       
    32 	#
       
    33 	#Function to write log into file
       
    34 	#
       
    35 sub WriteLog 
       
    36 	{
       
    37 	my ($log) = @_;
       
    38 	unless( open($fh, ">> $logFile")) 
       
    39 		{
       
    40 		printf STDERR "Can\'t open $logfile:$!\n";
       
    41 		return;
       
    42 		}
       
    43 	printf $fh $log;
       
    44 	printf $log;
       
    45 	close $fh;
       
    46 	}
       
    47 
       
    48   	# For creating unicode based sis files for NQP
       
    49 	system ("WScript.exe createnunicodefile.vbs");
       
    50 	system("createnormalsis.pl");
       
    51 	system("WScript.exe renameunicode.vbs");
       
    52 	system("WScript.exe signunicodesis.vbs");
       
    53 
       
    54 	#For Embeded SIS file
       
    55 	system("createembededsis.pl");
       
    56 	system("WScript.exe signembededunicodesis.vbs");
       
    57 
       
    58 	#For creating the SIS file which produces large data, 
       
    59 	#moved to this stuff as ONB was failing being this pkg file in tsisfile dir.
       
    60 	system("unzip -q -o largefile.zip");
       
    61 	system("makesis largedata.pkg");
       
    62 	system("signsis -s largedata.sis largedata.sis default.cer 	default.key");
       
    63 
       
    64 
       
    65 	#Copy the sis files to Z drive
       
    66 	system "copytozdrive.bat";
       
    67 
       
    68 	system("del /f largefile.txt");
       
    69 	unlink($logFile);
       
    70 	WriteLog("Created test data for NQP.\n\n");
       
    71 	#
       
    72 # Display the result
       
    73 #
       
    74 WriteLog("\n\nTests completed OK\n");
       
    75 WriteLog(sprintf "Run: %d\n", $NumberOfTests );
       
    76 WriteLog(sprintf "Passed: %d\n", $NumberOfPassed );
       
    77 WriteLog(sprintf "%d tests failed out of %d\n", $NumberOfFailed, $NumberOfTests );