mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
Put the ModulesDisplay, ModulesHelp and ModulesTest procedures call under the same catch than used for the evaludation of the modulefile content. Doing so an error found within these procedures will be handled the same way than if the error is triggered from the main body of the modulefile. As a consequence, the ModulesDisplay, ModulesHelp and ModulesTest procedures are not anymore called when an error has been raised during the modulefile main evaluation, since the same catch is shared. Some existing test results have been adapted for this change and new tests have been added to check this specific behavior in 070-display, 080-help and 085-test in 70-maint suite.
42 lines
840 B
Plaintext
42 lines
840 B
Plaintext
#%Module1.0
|
|
|
|
##############################################################################
|
|
# Modules Revision 3.0
|
|
# Providing a flexible user environment
|
|
#
|
|
# File: bad2/%M%
|
|
# Revision: %I%
|
|
# First Edition: 2017/05/21
|
|
# Last Mod.: %U%, %G%
|
|
#
|
|
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr
|
|
#
|
|
# Description: Testuite modulefile
|
|
# Command:
|
|
#
|
|
# Invocation:
|
|
# Result: %R{
|
|
# }R%
|
|
# Comment: %C{
|
|
# Test behavior against a modulefile using an unknown command
|
|
# in ModulesDisplay, ModulesTest and ModulesHelp procedures
|
|
# }C%
|
|
#
|
|
##############################################################################
|
|
|
|
proc ModulesDisplay {} {
|
|
bad-command
|
|
}
|
|
|
|
proc ModulesHelp {} {
|
|
bad-command
|
|
}
|
|
|
|
proc ModulesTest {} {
|
|
bad-command
|
|
return 1
|
|
}
|
|
|
|
setenv testsuite "yes"
|
|
module-whatis "erroneous module test"
|