openenvutils/commandshell/shell/test/scripts/unziptest.sh
author William Roberts <williamr@symbian.org>
Fri, 23 Apr 2010 14:37:17 +0100
branchRCL_3
changeset 22 c82a39b81a38
parent 4 0fdb7f6b0309
permissions -rw-r--r--
Rework addition of Symbian splash screen to reduce the source impact (uses SVG from Bug 2414) Notes: by using the OPTION SOURCEDIR parameter in the mifconv extension instructions, I can arrange to use the same source file name in sfimage, without having to export over the original Nokia file. This means that the name inside splashscreen.mbg is the same, which removes the need for the conditional compilation in SplashScreen.cpp, and gets rid of sf_splashscreen.mmp.

# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description:
#

init()
{
	let total=0;
	let pass=0;
	let fail=0;

	if [ ! -d c:\\ziptest ]
	then
		echo "Run minizip.sh before testing"
		exit
	else
		cd c:\\ziptest
	fi
	if [ -d .\\unziptest ]
	then
		rm -r .\\unziptest	
	fi
	mkdir .\\unziptest
	cd .\\unziptest
	mkdir .\dir2
	mkdir .\dir3
	mkdir .\dir
	mkdir .\dir1
	cd 
}

test_unzip1()
{
    let total+=1;
    echo "test_unzip1:unzip -d dir2-x ../pqr3.zip "
    #echo "test_unzip1:unzip -d dir2 -x ../pqr3.zip " >>unziplog.txt
    unzip  -o -d c:\\ziptest\\unziptest\\dir2  c:\\ziptest\\pqr3.zip 
    ret=$?
	if [ $ret -ne 0 ]
	then
		echo "FAIL : Return Value $ret"
		let fail+=1;
	else
		echo "PASS";
		let pass+=1;
	fi
}

test_unzip2()
{
    let total+=1;
    echo "test_unzip2:unzip -d dir3 -e ../pqr3.zip "

    #echo "test_unzip2:unzip -d dir3 -e ../pqr3.zip " >>unziplog.txt
    unzip  -o -d c:\\ziptest\\unziptest\\dir3  c:\\ziptest\\pqr3.zip 
    ret=$?
	if [ $ret -ne 0 ]
	then
		echo "FAIL : Return Value $ret"
		let fail+=1;
	else
		echo "PASS";
		let pass+=1;
	fi
}
test_unzip3()
{
    let total+=1;
    echo "test_unzip3:unzip -l ../pqr10.zip "

    unzip -l c:\\ziptest\\pqr3.zip 
	#unzip -l c:\\ziptest\\pqr3.zip > c:\\ziptest\\unziptest\\temp.txt
    ret=$?
	if [ $ret -ne 0 ]
	then
		echo "FAIL : Return Value $ret"
		let fail+=1;
		return
	else
		echo "PASS";
		let pass+=1
	fi
	
}
test_unzip4()
{
    let total+=1;
    echo "test_unzip4:unzip -d dir ../pqr10.zip "
    #echo "test_unzip4:unzip -d dir ../pqr10.zip " >>unziplog.txt
    unzip  -o -d c:\\ziptest\\unziptest\\dir c:\\ziptest\\pqr3.zip #>> unziplog.txt 2>> unziplog.txt
    ret=$?
	if [ $ret -ne 0 ]
	then
		echo "FAIL : Return Value $ret"
		let fail+=1
	else
		echo "PASS";
		let pass+=1;
	fi
}
test_unzip5()
{
    let total+=1;
    echo "test_unzip5:unzip -x -d dir1 ../pqr3.zip "
    #echo "test_unzip5:unzip -x -d dir1 ../pqr11.zip " >>unziplog.txt
    unzip -o -x -d c:\\ziptest\\unziptest\\dir1 c:\\ziptest\\pqr3.zip #>> unziplog.txt 2>> unziplog.txt
    ret=$?
	if [ $ret -ne 0 ]
	then
		echo "FAIL : Return Value $ret"
		let fail+=1;
		return
	else
		echo "PASS";
		let pass+=1;
	fi
}
test_unzip6()
{
    let total+=1;
    echo "test_unzip6:unzip -o ../pqr3.zip "
    #echo "test_unzip6:unzip -o ../pqr10.zip " >>unziplog.txt
    unzip -o c:\\ziptest\\pqr3.zip 
    ret=$?
	if [ $ret -ne 0 ]
	then
		echo "FAIL : Return Value $ret"
		let fail+=1;
		return
	else
		echo "PASS";
		let pass+=1;
	fi
}

report()
{
	echo "Changing the directory back";
	echo "--------------------unzip test results------------------------"
	echo " TOTAL TESTS : $total"
	echo " TOTAL PASS  : $pass"
	echo " TOTAL FAIL  : $fail"
	echo "------------------------------------------------------------"
}

#begin calls
init
test_unzip1
test_unzip2
test_unzip3
test_unzip4
test_unzip5
test_unzip6
report