| 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: 2012/10/29 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: R.K. Owen, <[email protected]> |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: load |
| 14 |
# Modulefiles: append/1.0 append/1.1 |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Tests the 'append-path' module subcommand with |
| 19 |
# an arbitrary delimiter and a module swap |
| 20 |
# with a mid-path result |
| 21 |
# }C% |
| 22 |
# |
| 23 |
############################################################################## |
| 24 |
|
| 25 |
skip_if_quick_mode |
| 26 |
|
| 27 |
# |
| 28 |
# Variables. This test forces a module load command. It will result in the |
| 29 |
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to |
| 30 |
# be set up |
| 31 |
# |
| 32 |
|
| 33 |
set ts_1 "http://foobar.org" |
| 34 |
set ts_2 "http://foobar.net" |
| 35 |
set ts_3 "http://foobar.com" |
| 36 |
set ts_4 "http://foobar.us" |
| 37 |
# different behavior than C-version: on Tcl-version loaded path is not |
| 38 |
# prepended or appended only within the space occupied by the unloaded |
| 39 |
# module but through the whole space of the variable. So prepended stuff |
| 40 |
# will go at the beginning of the variable and appended stuff will go |
| 41 |
# at the end. |
| 42 |
set ts_space "$ts_1 $ts_2 $ts_4" |
| 43 |
set env(testsuite) "$ts_1 $ts_3 $ts_2" |
| 44 |
set module "append/1.0" |
| 45 |
set module_new "append/1.1" |
| 46 |
set modulefile "$modpath/$module" |
| 47 |
set modulefile_new "$modpath/$module_new" |
| 48 |
|
| 49 |
setenv_loaded_module $module $modulefile |
| 50 |
|
| 51 |
# |
| 52 |
# For the different shells ... |
| 53 |
# |
| 54 |
|
| 55 |
lappend ans [list set _LMFILES_ $modulefile_new] |
| 56 |
lappend ans [list set LOADEDMODULES $module_new] |
| 57 |
lappend ans [list set testsuite $ts_space] |
| 58 |
|
| 59 |
# |
| 60 |
# The tests |
| 61 |
# |
| 62 |
|
| 63 |
test_cmd_re "ALL" "swap $module_new" $ans |
| 64 |
|
| 65 |
# |
| 66 |
# Cleanup |
| 67 |
# |
| 68 |
|
| 69 |
reset_test_env |