mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
Check if a passed modulefile correspond to an already loaded full path module (passed as full path name when it was loaded) thank to set modulepath. This is done to detect this modulefile is-loaded, should not be loaded a second time (with a different name) or should be unloaded. Add a 'findModuleNameFromModulefile' procedure to get corresponding modulefile name from a full path name based on currently enabled modulepaths. Adapt 'getLoadedWithClosestName' and 'getLoadedMatchingName' procedures to make use of 'findModuleNameFromModulefile' when a loaded module is detected to be full path. Make cmdModuleLoad use 'getLoadedMatchingName' after 'getPathToModule' to check whether returned module is already loaded or not (checking short or full path name combinations) Add tests on load, unload, swap and is-loaded actions.
47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
##############################################################################
|
|
# Modules Revision 3.0
|
|
# Providing a flexible user environment
|
|
#
|
|
# File: modules.00-init/%M%
|
|
# Revision: %I%
|
|
# First Edition: 95/12/06
|
|
# Last Mod.: %U%, %G%
|
|
#
|
|
# Authors: Jens Hamisch, Jens.Hamisch@Strawberry.COM
|
|
#
|
|
# Description: Testuite testsequence
|
|
# Command:
|
|
# Sub-Command:
|
|
#
|
|
# Comment: %C{
|
|
# Check valid shell type.
|
|
#
|
|
# This test has to be run at a moment, when *NO*
|
|
# initialization (MODULEPATH !) is done in order to
|
|
# ensure well defined error-answers!
|
|
# }C%
|
|
#
|
|
##############################################################################
|
|
#
|
|
# The following answers are to be expected in this testcase ...
|
|
#
|
|
|
|
set bad_shell "$error_msgs: Unknown shell type '(\[^ \t\n'\]+)'"
|
|
|
|
#
|
|
# The tests
|
|
#
|
|
|
|
if { $verbose > 0 } {
|
|
send_user "\tChecking user shells as arg 1 of modulecmd ...\n"
|
|
}
|
|
|
|
testouterr_cmd_re "ALL" "avail" "ERR" $err_nomodpath
|
|
testouterr_cmd_re "abc" "avail" "OK" $bad_shell
|
|
|
|
#
|
|
# Clean up variables used in this test case
|
|
#
|
|
|
|
unset bad_shell
|