282-info-command.exp (modules-5.1.1.tar.bz2) | : | 282-info-command.exp (modules-5.2.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 14 | skipping to change at line 14 | |||
# | # | |||
# File: modules.50-cmds/%M% | # File: modules.50-cmds/%M% | |||
# Revision: %I% | # Revision: %I% | |||
# First Edition: 2017/01/27 | # First Edition: 2017/01/27 | |||
# Last Mod.: %U%, %G% | # Last Mod.: %U%, %G% | |||
# | # | |||
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr | # Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr | |||
# | # | |||
# Description: Testuite testsequence | # Description: Testuite testsequence | |||
# Command: load, display, whatis, search, source, restore | # Command: load, display, whatis, search, source, restore | |||
# Command: unload, switch, purge, reload, help, test | # Command: unload, switch, purge, reload, help, test, reset | |||
# Command: stash, stashpop | ||||
# Modulefiles: info/command | # Modulefiles: info/command | |||
# Sub-Command: | # Sub-Command: | |||
# | # | |||
# Comment: %C{ | # Comment: %C{ | |||
# Tests the 'module-info command' module subcommand with- | # Tests the 'module-info command' module subcommand with- | |||
# out own suggestion. | # out own suggestion. | |||
# This command does not change behaviour depending on | # This command does not change behaviour depending on | |||
# the user shell. Tests are made for the bourne shell | # the user shell. Tests are made for the bourne shell | |||
# here. | # here. | |||
# }C% | # }C% | |||
skipping to change at line 63 | skipping to change at line 64 | |||
testouterr_cmd "sh" "load $module" $ans "load" | testouterr_cmd "sh" "load $module" $ans "load" | |||
skip_if_quick_mode | skip_if_quick_mode | |||
# test try-loading | # test try-loading | |||
testouterr_cmd sh "try-load $module" $ans try-load | testouterr_cmd sh "try-load $module" $ans try-load | |||
# test load-any | # test load-any | |||
testouterr_cmd sh "load-any $module" $ans load-any | testouterr_cmd sh "load-any $module" $ans load-any | |||
# test mod-to-sh | ||||
# specific test as this subcmd output shell code on report message channel | ||||
set tserr [shell_set sh INFOCMD mod-to-sh] | ||||
testouterr_cmd sh "mod-to-sh sh $module" [list [list OK nop]] $tserr | ||||
# test reset | ||||
setenv_var __MODULES_LMINIT "module use --append $modpath:module load $module" | ||||
testouterr_cmd sh reset $ans reset\n[msg_load $module] | ||||
unsetenv_var __MODULES_LMINIT | ||||
# test stash | ||||
setenv_var __MODULES_LMINIT "module use --append $modpath:module load $module" | ||||
testouterr_cmd sh stash $ans stash\n[msg_load $module] | ||||
unsetenv_var __MODULES_LMINIT | ||||
# test stashpop | ||||
setenv_loaded_module [list $module] [list $modulefile] | ||||
testouterr_cmd sh stashpop $ansun stashpop\n[msg_unload $module] | ||||
unsetenv_loaded_module | ||||
# test displaying | # test displaying | |||
testouterr_cmd_re "sh" "display $module" "OK" "$modlin\n$modulefilere:\n\ndispla y\n$modlin" | testouterr_cmd_re "sh" "display $module" "OK" "$modlin\n$modulefilere:\n\ndispla y\n$modlin" | |||
# test whatis | # test whatis | |||
testouterr_cmd_re "sh" "whatis $module" "OK" "$header\n\\s+$module: whatis(\\n\\ s+\\S*$module\\S*: .*)*" | testouterr_cmd_re "sh" "whatis $module" "OK" "$header\n\\s+$module: whatis(\\n\\ s+\\S*$module\\S*: .*)*" | |||
# test searching | # test searching | |||
# error found in interpreted module, so an error code is rendered | # error found in interpreted module, so an error code is rendered | |||
testouterr_cmd_re "sh" "search search" "ERR" "$header\n\\s+$module: search(\\n\\ s+\\S+: search)*" | testouterr_cmd_re "sh" "search search" "ERR" "$header\n\\s+$module: search(\\n\\ s+\\S+: search)*" | |||
skipping to change at line 84 | skipping to change at line 105 | |||
testouterr_cmd "sh" "source $modulefile" "OK" "source" | testouterr_cmd "sh" "source $modulefile" "OK" "source" | |||
# set HOME to location containing collections | # set HOME to location containing collections | |||
set homewithcoll "$env(HOME)/home" | set homewithcoll "$env(HOME)/home" | |||
if { $verbose > 0 } { | if { $verbose > 0 } { | |||
send_user "\tSetup HOME = $homewithcoll\n" | send_user "\tSetup HOME = $homewithcoll\n" | |||
} | } | |||
set env(HOME) "$homewithcoll" | set env(HOME) "$homewithcoll" | |||
# test restoring | # test restoring | |||
testouterr_cmd "sh" "restore infocmd" $ans "restore\nLoading info/command" | testouterr_cmd "sh" "restore infocmd" $ans restore\n[msg_load $module] | |||
# restore default testsuite home | # restore default testsuite home | |||
if { $verbose > 0 } { | if { $verbose > 0 } { | |||
send_user "\tRestore HOME = $ORIG_HOME\n" | send_user "\tRestore HOME = $ORIG_HOME\n" | |||
} | } | |||
set env(HOME) $ORIG_HOME | set env(HOME) $ORIG_HOME | |||
# Set up the environment for test that require the module to be loaded | # Set up the environment for test that require the module to be loaded | |||
setenv_loaded_module $module $modulefile | setenv_loaded_module $module $modulefile | |||
# test unloading | # test unloading | |||
testouterr_cmd "sh" "unload $module" $ansun "unload" | testouterr_cmd "sh" "unload $module" $ansun "unload" | |||
# test switching | # test switching | |||
testouterr_cmd "sh" "switch $module $module" $ans "switch\nswitch" | testouterr_cmd "sh" "switch $module $module" $ans "switch\nswitch" | |||
# test refreshing | # test refreshing | |||
setenv_var __MODULES_LMREFRESH $module | ||||
testouterr_cmd sh refresh OK refresh | testouterr_cmd sh refresh OK refresh | |||
unsetenv_var __MODULES_LMREFRESH | ||||
# test purging | # test purging | |||
testouterr_cmd "sh" "purge" $ansun "purge" | testouterr_cmd "sh" "purge" $ansun "purge" | |||
# test reloading | # test reloading | |||
testouterr_cmd "sh" "reload" $ans "reload\nreload" | testouterr_cmd "sh" "reload" $ans "reload\nreload" | |||
# Clean up the just changed environment | # Clean up the just changed environment | |||
unsetenv_loaded_module | unsetenv_loaded_module | |||
End of changes. 5 change blocks. | ||||
2 lines changed or deleted | 25 lines changed or added |