##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		modules.70-maint/%M%
#   Revision:		%I%
#   First Edition:	1995/12/06
#   Last Mod.:		%U%, %G%
#
#   Authors:		Jens Hamisch, Jens.Hamisch@Strawberry.COM
#
#   Description:	Testuite testsequence
#   Command:		load
#   Modulefiles:	whatis/lines, whatis/multiple, whatis/none
#   Modulefiles:	whatis/single, whatis/string
#   Sub-Command:
#
#   Comment:	%C{
#			Tests the loading of modulefiles with only a
#			'module-whatis' command in 'em
#		}C%
#
##############################################################################

#
#  Variables. This test forces a module load command. It will result in the
#    environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
#    be set up
#

set module_1 "whatis/none"
set modulefile_1 "$env(MODULEPATH)/$module_1"

set module_2 "whatis/lines"
set modulefile_2 "$env(MODULEPATH)/$module_2"

set module_3 "whatis/multiple"
set modulefile_3 "$env(MODULEPATH)/$module_3"

set module_4 "whatis/single"
set modulefile_4 "$env(MODULEPATH)/$module_4"

set module_5 "whatis/string"
set modulefile_5 "$env(MODULEPATH)/$module_5"

#
#  Test only for the csh
#

set lmf_csh_1 "setenv _LMFILES_ $modulefile_1 ;"
set lm_csh_1 "setenv LOADEDMODULES $module_1 ;"

set lmf_csh_2 "setenv _LMFILES_ $modulefile_2 ;"
set lm_csh_2 "setenv LOADEDMODULES $module_2 ;"

set lmf_csh_3 "setenv _LMFILES_ $modulefile_3 ;"
set lm_csh_3 "setenv LOADEDMODULES $module_3 ;"

set lmf_csh_4 "setenv _LMFILES_ $modulefile_4 ;"
set lm_csh_4 "setenv LOADEDMODULES $module_4 ;"

set lmf_csh_5 "setenv _LMFILES_ $modulefile_5 ;"
set lm_csh_5 "setenv LOADEDMODULES $module_5 ;"

set ts_csh "setenv testsuite yes ;"

#
#  The tests
#

test_cmd "csh" "--terse load $module_1" "$lm_csh_1$lmf_csh_1$ts_csh"
test_cmd "csh" "--terse load $module_2" "$lm_csh_2$lmf_csh_2$ts_csh"
test_cmd "csh" "--terse load $module_3" "$lm_csh_3$lmf_csh_3$ts_csh"
test_cmd "csh" "--terse load $module_4" "$lm_csh_4$lmf_csh_4$ts_csh"
test_cmd "csh" "--terse load $module_5" "$lm_csh_5$lmf_csh_5$ts_csh"

#
#  Cleanup
#

unset ts_csh

unset lm_csh_1
unset lmf_csh_1

unset lm_csh_2
unset lmf_csh_2

unset lm_csh_3
unset lmf_csh_3

unset lm_csh_4
unset lmf_csh_4

unset lm_csh_5
unset lmf_csh_5

unset modulefile_1
unset module_1

unset modulefile_2
unset module_2

unset modulefile_3
unset module_3

unset modulefile_4
unset module_4

unset modulefile_5
unset module_5
