| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.70-maint/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 2018/02/25 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Xavier Delaruelle, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: display |
| 14 |
# Modulefiles: bad2 |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Tests the MODULECONTACT environment variable |
| 19 |
# }C% |
| 20 |
# |
| 21 |
############################################################################## |
| 22 |
|
| 23 |
skip_if_quick_mode |
| 24 |
|
| 25 |
# skip tests if implicit_default option could not be overridden |
| 26 |
if {[is_config_locked implicit_default]} { |
| 27 |
send_user "\tskipping tests as implicit_default could not be overridden\n" |
| 28 |
} else { |
| 29 |
|
| 30 |
# ensure avail tests have implicit default enabled |
| 31 |
setenv_var MODULES_IMPLICIT_DEFAULT 1 |
| 32 |
|
| 33 |
# |
| 34 |
# Test variables |
| 35 |
# |
| 36 |
|
| 37 |
set contact "[email protected]" |
| 38 |
if {$verbose} { |
| 39 |
send_user "\tSetup MODULECONTACT = '$contact'\n" |
| 40 |
} |
| 41 |
set env(MODULECONTACT) $contact |
| 42 |
|
| 43 |
set module "bad2" |
| 44 |
set custom { (procedure "ModulesDisplay" line 2) |
| 45 |
invoked from within |
| 46 |
"ModulesDisplay"} |
| 47 |
set custom [escre [msg_moderr "$msg_invcmdname \"bad-command\"" bad-command $modpath/$module/proc {} { } {} $contact $custom]] |
| 48 |
set out_interr "$modlin |
| 49 |
$modpathre/$module/proc: |
| 50 |
|
| 51 |
setenv\t\ttestsuite yes |
| 52 |
module-whatis\t{erroneous module test} |
| 53 |
$custom |
| 54 |
$modlin" |
| 55 |
|
| 56 |
|
| 57 |
# |
| 58 |
# The tests |
| 59 |
# |
| 60 |
|
| 61 |
testouterr_cmd_re "sh" "display $module" "ERR" "$out_interr" |
| 62 |
|
| 63 |
# |
| 64 |
# Cleanup |
| 65 |
# |
| 66 |
|
| 67 |
reset_test_env |
| 68 |
|
| 69 |
} |