openenvutils/commandshell/shell/test/scripts/redirecttest.sh
changeset 0 2e3d3ce01487
child 1 0fdb7f6b0309
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of the License "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 #
       
    15 
       
    16 init()
       
    17     {
       
    18     let totalno=0;
       
    19     let passno=0;
       
    20     let failno=0;
       
    21     }
       
    22 
       
    23 test_redirect2()
       
    24 {
       
    25     let totalno=totalno+1
       
    26     echo "Test $totalno: Test redirection of text file to stdin  and stdout of a exe using < and >"
       
    27 
       
    28     echo "456789" > C:\\in.txt
       
    29     tredirect < C:\\in.txt > C:\\out.txt
       
    30     
       
    31     read temp < c:\\out.txt
       
    32     
       
    33     if [ $temp = 456789 ]
       
    34     then
       
    35         echo "PASS"
       
    36         let passno=passno+1
       
    37     else
       
    38         echo "FAIL"
       
    39         let failno=failno+1
       
    40     fi
       
    41                  
       
    42 
       
    43 }
       
    44 
       
    45 test_redirect1()
       
    46 {
       
    47     let totalno=totalno+1
       
    48     echo "Test $totalno: Test redirection of text file to stdin  of a exe using < "
       
    49 
       
    50     echo "456789" >  C:\\in.txt
       
    51     
       
    52     tredirect < C:\\in.txt 
       
    53     ret=$?
       
    54 
       
    55     if [ $ret = 0 ]
       
    56     then
       
    57          echo
       
    58          echo "Is previous output on the screen 456789\(y\/n\):"
       
    59          read yesorno 
       
    60          if [ $yesorno = "y" ]
       
    61          then
       
    62               echo "PASS"
       
    63               let passno=passno+1
       
    64          else
       
    65               echo "FAIL"
       
    66               let failno=failno+1
       
    67          fi
       
    68     else
       
    69          echo "FAIL"
       
    70          let failno=failno+1
       
    71     fi
       
    72 
       
    73 }
       
    74 
       
    75 
       
    76 report()
       
    77     {
       
    78     echo "#############################################################################"
       
    79     echo "Total tests : $totalno"
       
    80     echo "Passed      : $passno"
       
    81     echo "Failed      : $failno"
       
    82     echo "#############################################################################"
       
    83     }
       
    84 
       
    85 
       
    86 init
       
    87 test_redirect1
       
    88 test_redirect2
       
    89 report
       
    90 rm -f  C:\\in.txt  C:\\out.txt
       
    91 
       
    92