############################################################################## # Modules Revision 3.0 # Providing a flexible user environment # # File: modules.50-cmds/%M% # Revision: %I% # First Edition: 95/12/06 # Last Mod.: %U%, %G% # # Authors: Jens Hamisch, Jens.Hamisch@Strawberry.COM # # Description: Testuite testsequence # Command: load # Modulefiles: alias/2.0 # Sub-Command: # # Comment: %C{ # Tests the 'set-alias' module subcommand for all allowed # shell types. # }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 "alias/2.0" set modulefile "$env(MODULEPATH)/$module" set alias "ps -auxww | grep modulecmd" # # For the different shells ... # set tfnam_pat "/\[a-zA-Z_0-9_/\\.\\-\]+M_od_\[a-zA-Z_0-9\\.\\-\]+" set fil_cmd_sh "testsuite() {\n$alias;\n}" set fil_cmd_ksh "alias testsuite='$alias'" set fil_cmd_csh "alias testsuite '$alias'" set lmf_sh "_LMFILES_='\[a-zA-Z0-9_/\\.\\-\]+';export _LMFILES_;" set lm_sh "LOADEDMODULES='alias/2\.0';export LOADEDMODULES;" set ts_sh "\\. ($tfnam_pat);/bin/rm -f $tfnam_pat;" set lmf_csh "setenv _LMFILES_ '\[a-zA-Z0-9_/\\.\\-\]+';" set lm_csh "setenv LOADEDMODULES 'alias/2\.0';" set ts_csh "source ($tfnam_pat);/bin/rm -f $tfnam_pat;" set lmf_perl "\\\$ENV\\\{'_LMFILES_'\\\} = '\[a-zA-Z0-9_/\\.\\-\]+';" set lm_perl "\\\$ENV\\\{'LOADEDMODULES'\\\} = 'alias/2\.0';" set ts_perl "$warn_msgs: Shell 'perl': cannot source alias tempfile - No aliases set" # # The tests # test_alias "sh" "load $module" "$lmf_sh$lm_sh$ts_sh" "$fil_cmd_sh" test_alias "ksh" "load $module" "$lmf_sh$lm_sh$ts_sh" "$fil_cmd_ksh" test_alias "zsh" "load $module" "$lmf_sh$lm_sh$ts_sh" "$fil_cmd_ksh" test_alias "csh" "load $module" "$lmf_csh$lm_csh$ts_csh" "$fil_cmd_csh" test_alias "tcsh" "load $module" "$lmf_csh$lm_csh$ts_csh" "$fil_cmd_csh" # only available for csh/sh derivatives ... no longer warn for others #testerr_cmd_re "perl" "load $module" "$lmf_perl$lm_perl$ts_perl" # # Cleanup # unset lmf_perl unset lm_perl unset ts_perl unset ts_sh unset lm_sh unset lmf_sh unset ts_csh unset lm_csh unset lmf_csh unset modulefile unset module unset fil_cmd_sh unset fil_cmd_csh unset tfnam_pat