openenvutils/commandshell/shell/test/scripts/redirecttest.sh
changeset 0 2e3d3ce01487
child 1 0fdb7f6b0309
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/openenvutils/commandshell/shell/test/scripts/redirecttest.sh	Tue Feb 02 10:12:00 2010 +0200
@@ -0,0 +1,92 @@
+# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "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 totalno=0;
+    let passno=0;
+    let failno=0;
+    }
+
+test_redirect2()
+{
+    let totalno=totalno+1
+    echo "Test $totalno: Test redirection of text file to stdin  and stdout of a exe using < and >"
+
+    echo "456789" > C:\\in.txt
+    tredirect < C:\\in.txt > C:\\out.txt
+    
+    read temp < c:\\out.txt
+    
+    if [ $temp = 456789 ]
+    then
+        echo "PASS"
+        let passno=passno+1
+    else
+        echo "FAIL"
+        let failno=failno+1
+    fi
+                 
+
+}
+
+test_redirect1()
+{
+    let totalno=totalno+1
+    echo "Test $totalno: Test redirection of text file to stdin  of a exe using < "
+
+    echo "456789" >  C:\\in.txt
+    
+    tredirect < C:\\in.txt 
+    ret=$?
+
+    if [ $ret = 0 ]
+    then
+         echo
+         echo "Is previous output on the screen 456789\(y\/n\):"
+         read yesorno 
+         if [ $yesorno = "y" ]
+         then
+              echo "PASS"
+              let passno=passno+1
+         else
+              echo "FAIL"
+              let failno=failno+1
+         fi
+    else
+         echo "FAIL"
+         let failno=failno+1
+    fi
+
+}
+
+
+report()
+    {
+    echo "#############################################################################"
+    echo "Total tests : $totalno"
+    echo "Passed      : $passno"
+    echo "Failed      : $failno"
+    echo "#############################################################################"
+    }
+
+
+init
+test_redirect1
+test_redirect2
+report
+rm -f  C:\\in.txt  C:\\out.txt
+
+