##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		modules.50-cmds/%M%
#   Revision:		%I%
#   First Edition:	2018/01/07
#   Last Mod.:		%U%, %G%
#
#   Authors:		Xavier Delaruelle, xavier.delaruelle@cea.fr
#
#   Description:	Testuite testsequence
#   Command:		load
#   Modulefiles:	modvar/modfile, modvar/submodfile
#   Sub-Command:
#
#   Comment:	%C{
#           Tests the availability of known variables in modulefile
#           interpretation context.
#   }C%
#
##############################################################################

# ensure auto symbolic versions are not set for these tests
setenv_var MODULES_ADVANCED_VERSION_SPEC 0

set module1 "modvar/modfile"
set modulefile1 "$modpath/$module1"
set module2 "modvar/submodfile"
set modulefile2 "$modpath/$module2"


#
#  The tests
#

lappend ans [list set ts1 $modulefile1]
lappend ans [list set ts2 $modulefile2]
lappend ans [list setpath LOADEDMODULES "$module2:$module1"]
lappend ans [list setpath _LMFILES_ "$modulefile2:$modulefile1"]
lappend ans [list setpath MODULES_LMNOTUASKED "$module2"]
lappend ans [list set ts3 $modulefile1]
lappend ans [list setpath MODULES_LMPREREQ $module1&$module2]

testouterr_cmd_re "sh" "load $module1" $ans [msg_top_load $module1 {} $module2 {}]


#
#  Cleanup
#

reset_test_env
