core/tsrc/fshell-scriptcif-test.script
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 #!fshell
       
     2 # fshell-scriptcif-test.script
       
     3 # 
       
     4 # Copyright (c) 2010 Accenture. All rights reserved.
       
     5 # This component and the accompanying materials are made available
       
     6 # under the terms of the "Eclipse Public License v1.0"
       
     7 # which accompanies this distribution, and is available
       
     8 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 # 
       
    10 # Initial Contributors:
       
    11 # Accenture - Initial contribution
       
    12 #
       
    13 
       
    14 source $SCRIPT_PATH\errordef.script
       
    15 export QUIET "2>&1 >/dev/null" # Used to quieten the things that we're fully expecting to fail
       
    16 
       
    17 # The things that should suceed use "|| $Error", the things that should fail use $QUIET and "&& $Error" in case they actually succeed when the shouldn't
       
    18 
       
    19 fshell $SCRIPT_PATH\tscriptargs.script abc123 || $Error
       
    20 fshell $SCRIPT_PATH\tscriptargs.script $QUIET && $Error
       
    21 
       
    22 export EXPECTEDMYOPTIONALARG optionalarg
       
    23 fshell $SCRIPT_PATH\tscriptargs.script abc123 optionalarg || $Error
       
    24 fshell $SCRIPT_PATH\tscriptargs.script abc123 $QUIET && $Error
       
    25 fshell $SCRIPT_PATH\tscriptargs.script abc123 wrongoptionalarg $QUIET && $Error
       
    26 export EXPECTEDMYOPTIONALARG
       
    27 
       
    28 # Check that the arguments to the script are being set as local environment variables and so don't pollute our env
       
    29 var myarg not-defined || $Error # Just to make sure our env is sane to start with
       
    30 source $SCRIPT_PATH\tscriptargs.script abc123 || $Error
       
    31 var myarg not-defined || $Error
       
    32 
       
    33 # Now test that even if we define a var of the same name, we don't see the definition from the child script
       
    34 export myarg "Something that isn't abc123."
       
    35 source $SCRIPT_PATH\tscriptargs.script abc123 || $Error
       
    36 var myarg == "Something that isn't abc123." || $Error
       
    37 
       
    38 fshell tlotsofscriptargs abc123 123 0x123 $SCRIPT_PATHtlotsofscriptargs.script 3.141 enumsecondvalue || $Error