| 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: 2017/05/18 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Xavier Delaruelle, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: paths |
| 14 |
# Modulefiles: help averssort |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Tests the module command 'paths' |
| 19 |
# }C% |
| 20 |
# |
| 21 |
############################################################################## |
| 22 |
|
| 23 |
skip_if_quick_mode |
| 24 |
|
| 25 |
# |
| 26 |
# Test variables |
| 27 |
# |
| 28 |
|
| 29 |
set module_1 "help" |
| 30 |
set modulefile_1 "$modpath/help/2.0" |
| 31 |
set module_2 "foo" |
| 32 |
set module_3 "averssort" |
| 33 |
set modulefile_3 [list "$modpath/verssort/1" "$modpath/verssort/1.2.4" "$modpath/verssort/1.10"] |
| 34 |
|
| 35 |
# |
| 36 |
# test with a modulefile |
| 37 |
# |
| 38 |
|
| 39 |
lappend ans [list text $modulefile_1] |
| 40 |
testouterr_cmd "ALL" "paths $module_1" $ans "" |
| 41 |
|
| 42 |
# setup MODULEPATH with a trailing slash and an empty dir element |
| 43 |
setenv_path_var MODULEPATH {} "$modpath/" |
| 44 |
testouterr_cmd "sh" "paths $module_1" $ans "" |
| 45 |
|
| 46 |
# restore MODULEPATH |
| 47 |
setenv_path_var MODULEPATH $modpath |
| 48 |
|
| 49 |
# |
| 50 |
# test with nonexistent modulefile |
| 51 |
# |
| 52 |
|
| 53 |
set ans [list] |
| 54 |
lappend ans [list text ""] |
| 55 |
|
| 56 |
testouterr_cmd "ALL" "paths $module_2" $ans "" |
| 57 |
|
| 58 |
# |
| 59 |
# test with aliases to resolve |
| 60 |
# |
| 61 |
|
| 62 |
set ans [list] |
| 63 |
lappend ans [list text $modulefile_3] |
| 64 |
|
| 65 |
testouterr_cmd "ALL" "paths $module_3" $ans "" |
| 66 |
|
| 67 |
|
| 68 |
# |
| 69 |
# Cleanup |
| 70 |
# |
| 71 |
|
| 72 |
reset_test_env |