| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.50-cmds/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 2017/05/22 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Xavier Delaruelle, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: load, display, help, test |
| 14 |
# Modulefiles: info/others |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Tests the 'module-info' module subcommand with bad or |
| 19 |
# deprecated keywords. |
| 20 |
# }C% |
| 21 |
# |
| 22 |
############################################################################## |
| 23 |
|
| 24 |
skip_if_quick_mode |
| 25 |
|
| 26 |
# |
| 27 |
# Variables. This test forces a module load command. It will result in the |
| 28 |
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to |
| 29 |
# be set up |
| 30 |
# |
| 31 |
|
| 32 |
set module "info/others" |
| 33 |
set modulefile "$modpath/$module" |
| 34 |
set modulefilere "$modpathre/$module" |
| 35 |
|
| 36 |
# |
| 37 |
# For sh shell only (no need to check every shells) |
| 38 |
# |
| 39 |
|
| 40 |
set trace_msg "trace: " |
| 41 |
set tracepat_msg "tracepat: " |
| 42 |
|
| 43 |
|
| 44 |
# |
| 45 |
# The tests |
| 46 |
# |
| 47 |
|
| 48 |
# test loading |
| 49 |
set custom {module-info bad} |
| 50 |
if {[cmpversion $tclsh_version 8.6] == -1} { |
| 51 |
append custom "\" |
| 52 |
invoked from within |
| 53 |
\"if \{ \[module-info mode load\] \} \{ |
| 54 |
puts stderr \"trace: \[module-info trace\]\" |
| 55 |
puts stderr \"tracepat: \[module-info tracepat\]\" |
| 56 |
puts stderr \"\[mod..." |
| 57 |
set linenum 47 |
| 58 |
} else { |
| 59 |
set linenum 50 |
| 60 |
} |
| 61 |
set bad_msg [msg_moderr {module-info bad not supported} $custom $modulefile $linenum] |
| 62 |
testouterr_cmd "sh" "load $module" "ERR" $trace_msg\n$tracepat_msg\n\n[msg_load $module $bad_msg] |
| 63 |
|
| 64 |
# test displaying |
| 65 |
set bad_msg [escre [msg_moderr {module-info bad not supported} {module-info bad} $modulefile 4 { } ModulesDisplay]] |
| 66 |
testouterr_cmd_re "sh" "display $module" "ERR" "$modlin\n$modulefilere:\n\n$trace_msg\n$tracepat_msg\n$bad_msg\n$modlin" |
| 67 |
|
| 68 |
# test help |
| 69 |
set bad_msg [escre [msg_moderr {module-info bad not supported} {module-info bad} $modulefile 4 { } ModulesHelp]] |
| 70 |
testouterr_cmd_re "sh" "help $module" "ERR" "$modlin\nModule Specific Help for $modulefilere:\n\n$trace_msg\n$tracepat_msg\n$bad_msg\n$modlin" |
| 71 |
|
| 72 |
# test test |
| 73 |
set bad_msg [escre [msg_moderr {module-info bad not supported} {module-info bad} $modulefile 4 { } ModulesTest]] |
| 74 |
testouterr_cmd_re "sh" "test $module" "ERR" "$modlin\nModule Specific Test for $modulefilere:\n\n$trace_msg\n$tracepat_msg\n$bad_msg\n$modlin" |
| 75 |
|
| 76 |
|
| 77 |
# |
| 78 |
# Cleanup |
| 79 |
# |
| 80 |
|
| 81 |
reset_test_env |