Debian Codegraph @

testsuite/modules.50-cmds/400-source-sh.exp

raw
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: 2020/05/20
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command:
14 # Modulefiles: source-sh
15 # Sub-Command: *
16 #
17 # Comment: %C{
18 # Check 'source-sh' modulefile command
19 # }C%
20 #
21 ##############################################################################
22
23 set mp $modpath.2
24 set mpre [regsub -all "\(\[.+?\]\)" $mp {\\\1}]
25
26 # setup specific environment
27 setenv_path_var MODULEPATH $mp
28
29 setenv_var TESTSUITE_SHTOMOD_PATHDUP 1
30 setenv_var TESTSUITE_SHTOMOD_NOCOMP 1
31
32
33 #
34 # load and unload tests
35 #
36
37 # basic load
38 set ans [list]
39 lappend ans [list set __MODULES_SHARE_FOOPATHDUPMIX ":1"]
40 lappend ans [list set _LMFILES_ $mp/source-sh/1]
41 lappend ans [list set LOADEDMODULES source-sh/1]
42 lappend ans [list set FOOPATHDUP "/path/to/dir1:/path/to/dir2:/path/to/dir3:/path/to dir4"]
43 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue]
44 lappend ans [list set FOOPATHEM :/path/to/dir1:/path/to/dir2:/path/to/dir3]
45 lappend ans [list set FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}]
46 lappend ans [list set __MODULES_SHARE_FOOPATHDUPEM :1]
47 lappend ans [list set FOOEM {}]
48 lappend ans [list set FOOPATHCB /path/to/dir1:/path/to/d\{r2:/path/to/dir3]
49 lappend ans [list set FOOSP {value }]
50 lappend ans [list set FOOPATHDUPSPEM {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to/dir3 }]
51 lappend ans [list set FOOPATHDUPMIX ":/path/to/dir1:/path/to/dir1 /path/to/dir2 /path/to/dir1:/path/to/dir3"]
52 lappend ans [list set FOOCB va\{ue]
53 lappend ans [list set FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3]
54 lappend ans [list set __MODULES_SHARE_FOOPATHEM :1]
55 lappend ans [list set FOOPATHWC /path/to/dir1:/path/to/d\*r2:/path/to/dir3]
56 lappend ans [list set FOOPATHDUPEM :/path/to/dir1:/path/to/dir2:/path/to/dir3]
57 lappend ans [list set FOO value]
58 lappend ans [list set FOOPATHDUPSP "/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to:dir4 /path/to/dir3"]
59 lappend ans [list set __MODULES_LMREFRESH source-sh/1]
60 lappend ans [list set FOOWC va\*ue]
61 lappend ans [list set FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }]
62 lappend ans [list alias alsp {echo f\"o; echo b\\\"r; echo f\'o}]
63 lappend ans [list alias alfoo {echo $(grep "report .Modules " ../../modulecmd.tcl | tr -d \\ 2>/dev/null | awk '{print $3}')}]
64 lappend ans [list alias alcb echo\ f\{o]
65 lappend ans [list alias alem {}]
66 lappend ans [list funcfoo "() { echo foo; };"]
67 lappend ans [list funccb "() { echo f\{o; };"]
68 lappend ans [list funcwc "() { echo sou*sh; };"]
69 lappend ans [list funcnl "() { echo foo;
70 echo bar; };"]
71 lappend ans [list funcsp "() { echo f\\\"o;
72 echo b\\\\\\\"r;
73 echo f\\'o; };"]
74 lappend ans [list chdir $mp]
75
76 testouterr_cmd sh {load source-sh/1} $ans {}
77
78 # basic unload
79 setenv_loaded_module [list source-sh/1] [list $mp/source-sh/1]
80 setenv_var __MODULES_LMREFRESH source-sh/1
81 setenv_var __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue
82 setenv_path_var FOOPATHDUP "/path/to/dir1:/path/to/dir2:/path/to/dir3:/path/to dir4"
83 setenv_path_var FOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
84 setenv_path_var FOOPATHCB /path/to/dir1:/path/to/d\{r2:/path/to/dir3
85 setenv_path_var FOOPATHWC /path/to/dir1:/path/to/d\*r2:/path/to/dir3
86 setenv_path_var FOOPATHDUPMIX {} "/path/to/dir1:/path/to/dir1 /path/to/dir2 /path/to/dir1:/path/to/dir3"
87 setenv_path_var FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
88 setenv_path_var FOOPATHDUPEM {} /path/to/dir1:/path/to/dir2:/path/to/dir3
89 setenv_path_var FOOPATHDUPSP "/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to:dir4 /path/to/dir3"
90 setenv_var FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
91 setenv_var FOOEM {}
92 setenv_var FOOSP {value }
93 setenv_var FOOPATHDUPSPEM {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to/dir3 }
94 setenv_var FOOCB va\{ue
95 setenv_var FOOWC va\*ue
96 setenv_var FOO value
97 setenv_var FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
98
99 set ans [list]
100 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPMIX]
101 lappend ans [list unset _LMFILES_]
102 lappend ans [list unset LOADEDMODULES]
103 lappend ans [list unset FOOPATHDUP]
104 lappend ans [list unset __MODULES_LMSOURCESH]
105 lappend ans [list unset FOOPATHEM]
106 lappend ans [list unset FOOPATHSP]
107 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPEM]
108 lappend ans [list unset FOOEM]
109 lappend ans [list unset FOOPATHCB]
110 lappend ans [list unset FOOSP]
111 lappend ans [list unset FOOPATHDUPSPEM]
112 lappend ans [list unset FOOPATHDUPMIX]
113 lappend ans [list unset FOOCB]
114 lappend ans [list unset FOOPATH]
115 lappend ans [list unset __MODULES_SHARE_FOOPATHEM]
116 lappend ans [list unset FOOPATHWC]
117 lappend ans [list unset FOOPATHDUPEM]
118 lappend ans [list unset FOO]
119 lappend ans [list unset FOOPATHDUPSP]
120 lappend ans [list unset __MODULES_LMREFRESH]
121 lappend ans [list unset FOOWC]
122 lappend ans [list unset FOOPATHSPEM]
123 lappend ans [list unalias alsp]
124 lappend ans [list unalias alfoo]
125 lappend ans [list unalias alcb]
126 lappend ans [list unalias alem]
127 lappend ans [list "unset -f funcfoo 2>/dev/null || true;"]
128 lappend ans [list "unset -f funccb 2>/dev/null || true;"]
129 lappend ans [list "unset -f funcwc 2>/dev/null || true;"]
130 lappend ans [list "unset -f funcnl 2>/dev/null || true;"]
131 lappend ans [list "unset -f funcsp 2>/dev/null || true;"]
132 testouterr_cmd sh {unload source-sh/1} $ans {}
133
134 skip_if_quick_mode
135
136 # load other modulefiles using source-sh
137 set ans [list]
138 lappend ans [list set FOOMINI value]
139 lappend ans [list set FOOPATH /path/to/mini:/path/to/dir1:/path/to/dir2:/path/to/dir3]
140 lappend ans [list set __MODULES_LMREFRESH source-sh/1:source-sh/2]
141 lappend ans [list set _LMFILES_ $mp/source-sh/1:$mp/source-sh/2]
142 lappend ans [list set LOADEDMODULES source-sh/1:source-sh/2]
143 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue:source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value]
144 lappend ans [list alias almini echo\ mini]
145 testouterr_cmd_re sh {load source-sh/2} $ans {}
146
147 # unload one of these modulefiles
148 setenv_loaded_module [list source-sh/1 source-sh/2] [list $mp/source-sh/1 $mp/source-sh/2]
149 setenv_var __MODULES_LMREFRESH source-sh/1:source-sh/2
150 setenv_var FOOMINI value
151 setenv_path_var FOOPATH /path/to/mini:/path/to/dir1:/path/to/dir2:/path/to/dir3
152 setenv_var __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue:source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value
153
154 set ans [list]
155 lappend ans [list unset FOOMINI]
156 lappend ans [list set FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3]
157 lappend ans [list set _LMFILES_ $mp/source-sh/1]
158 lappend ans [list set LOADEDMODULES source-sh/1]
159 lappend ans [list set __MODULES_LMREFRESH source-sh/1]
160 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue]
161 lappend ans [list unalias almini]
162 testouterr_cmd sh {unload source-sh/2} $ans {}
163
164 set ans [list]
165 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPMIX]
166 lappend ans [list set _LMFILES_ $mp/source-sh/2]
167 lappend ans [list set LOADEDMODULES source-sh/2]
168 lappend ans [list unset FOOPATHDUP]
169 lappend ans [list set __MODULES_LMSOURCESH source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value]
170 lappend ans [list unset FOOPATHEM]
171 lappend ans [list unset FOOPATHSP]
172 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPEM]
173 lappend ans [list unset FOOEM]
174 lappend ans [list unset FOOPATHCB]
175 lappend ans [list unset FOOSP]
176 lappend ans [list unset FOOPATHDUPSPEM]
177 lappend ans [list unset FOOPATHDUPMIX]
178 lappend ans [list unset FOOCB]
179 lappend ans [list set FOOPATH /path/to/mini]
180 lappend ans [list unset __MODULES_SHARE_FOOPATHEM]
181 lappend ans [list unset FOOPATHWC]
182 lappend ans [list unset FOOPATHDUPEM]
183 lappend ans [list unset FOO]
184 lappend ans [list unset FOOPATHDUPSP]
185 lappend ans [list set __MODULES_LMREFRESH source-sh/2]
186 lappend ans [list unset FOOWC]
187 lappend ans [list unset FOOPATHSPEM]
188 lappend ans [list unalias alsp]
189 lappend ans [list unalias alfoo]
190 lappend ans [list unalias alcb]
191 lappend ans [list unalias alem]
192 lappend ans [list "unset -f funcfoo 2>/dev/null || true;"]
193 lappend ans [list "unset -f funccb 2>/dev/null || true;"]
194 lappend ans [list "unset -f funcwc 2>/dev/null || true;"]
195 lappend ans [list "unset -f funcnl 2>/dev/null || true;"]
196 lappend ans [list "unset -f funcsp 2>/dev/null || true;"]
197 testouterr_cmd sh {unload source-sh/1} $ans {}
198
199 # load a third modulefile, using same script than firstly loaded module
200 set ans [list]
201 lappend ans [list set FOOPATHDUPEM :/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3::/path/to/dir3]
202 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPEM]
203 lappend ans [list set __MODULES_SHARE_FOOPATHDUPMIX ":2:/path/to/dir3:2"]
204 lappend ans [list set FOOPATHDUPMIX :/path/to/dir1:/path/to/dir1\ /path/to/dir2\ /path/to/dir1:/path/to/dir3]
205 lappend ans [list set FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3]
206 lappend ans [list set __MODULES_LMREFRESH source-sh/1:source-sh/2:source-sh/3]
207 lappend ans [list set _LMFILES_ $mp/source-sh/1:$mp/source-sh/2:$mp/source-sh/3]
208 lappend ans [list set LOADEDMODULES source-sh/1:source-sh/2:source-sh/3]
209 lappend ans [list set FOOPATHDUP "/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3:/path/to dir4:/path/to/dir3"]
210 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue:source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value:source-sh/3\&bash\ testsuite/example/sh-to-mod.sh\|append-path\ FOOPATHDUPMIX\ /path/to/dir3\ \{\}\|chdir\ $mp\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOOPATH\ /path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir3\|setenv\ FOOPATHDUP\ \{/path/to/dir1\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir3\<EnvModEscPS\>/path/to\ dir4\<EnvModEscPS\>/path/to/dir3\}\|setenv\ FOOPATHDUPEM\ \<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir3\<EnvModEscPS\>\<EnvModEscPS\>/path/to/dir3]
211 lappend ans [list alias alsp {echo f\"o; echo b\\\"r; echo f\'o}]
212 lappend ans [list alias alfoo {echo $(grep "report .Modules " ../../modulecmd.tcl | tr -d \\ 2>/dev/null | awk '{print $3}')}]
213 lappend ans [list alias alcb echo\ f\{o]
214 lappend ans [list alias alem {}]
215 lappend ans [list funcfoo "\\\(\\\) { echo foo; };"]
216 lappend ans [list funccb "\\\(\\\) { echo f\{o; };"]
217 lappend ans [list funcwc "\\\(\\\) { echo sou\\\*sh; };"]
218 lappend ans [list funcnl "\\\(\\\) { echo foo;
219 echo bar; };"]
220 lappend ans [list funcsp "\\\(\\\) { echo f\\\\\"o;
221 echo b\\\\\\\\\\\\\"r;
222 echo f\\\\'o; };"]
223 lappend ans [list chdir $mpre]
224
225 testouterr_cmd_re sh {load source-sh/3} $ans {}
226
227 # unload from that point
228 setenv_loaded_module [list source-sh/1 source-sh/2 source-sh/3] [list $mp/source-sh/1 $mp/source-sh/2 $mp/source-sh/3]
229 setenv_var __MODULES_LMREFRESH source-sh/1:source-sh/2:source-sh/3
230 setenv_var FOOPATHDUP "/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3:/path/to dir4:/path/to/dir3"
231 unsetenv_var __MODULES_SHARE_FOOPATHDUPEM
232 unsetenv_var __MODULES_SHARE_FOOPATH
233 unsetenv_var __MODULES_SHARE_FOOPATHDUP
234 setenv_path_var FOOPATHDUPMIX :/path/to/dir1:/path/to/dir1\ /path/to/dir2\ /path/to/dir1:/path/to/dir3
235 setenv_var FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
236 setenv_var FOOPATHDUPEM :/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3::/path/to/dir3
237 setenv_var __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue:source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value:source-sh/3\&bash\ testsuite/example/sh-to-mod.sh\|append-path\ FOOPATHDUPMIX\ /path/to/dir3\ \{\}\|chdir\ $mp\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOOPATH\ /path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir3\|setenv\ FOOPATHDUP\ \{/path/to/dir1\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir3\<EnvModEscPS\>/path/to\ dir4\<EnvModEscPS\>/path/to/dir3\}\|setenv\ FOOPATHDUPEM\ \<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir3\<EnvModEscPS\>\<EnvModEscPS\>/path/to/dir3
238
239 set ans [list]
240 lappend ans [list set _LMFILES_ $mp/source-sh/2:$mp/source-sh/3]
241 lappend ans [list set LOADEDMODULES source-sh/2:source-sh/3]
242 lappend ans [list unset FOOPATHDUP]
243 lappend ans [list set __MODULES_LMSOURCESH source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value:source-sh/3\&bash\ testsuite/example/sh-to-mod.sh\|append-path\ FOOPATHDUPMIX\ /path/to/dir3\ \{\}\|chdir\ $mp\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOOPATH\ /path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir3\|setenv\ FOOPATHDUP\ \{/path/to/dir1\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir3\<EnvModEscPS\>/path/to\ dir4\<EnvModEscPS\>/path/to/dir3\}\|setenv\ FOOPATHDUPEM\ \<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir2\<EnvModEscPS\>/path/to/dir1\<EnvModEscPS\>/path/to/dir3\<EnvModEscPS\>\<EnvModEscPS\>/path/to/dir3]
244 lappend ans [list unset FOOPATHEM]
245 lappend ans [list unset FOOPATHSP]
246 lappend ans [list unset FOOPATHCB]
247 lappend ans [list unset FOOEM]
248 lappend ans [list unset FOOSP]
249 lappend ans [list unset FOOPATHDUPSPEM]
250 lappend ans [list unset FOOPATHDUPMIX]
251 lappend ans [list unset FOOPATH]
252 lappend ans [list unset FOOCB]
253 lappend ans [list unset __MODULES_SHARE_FOOPATHEM]
254 lappend ans [list unset FOOPATHWC]
255 lappend ans [list unset FOOPATHDUPEM]
256 lappend ans [list unset FOO]
257 lappend ans [list unset FOOPATHDUPSP]
258 lappend ans [list set __MODULES_LMREFRESH source-sh/2:source-sh/3]
259 lappend ans [list unset FOOWC]
260 lappend ans [list unset FOOPATHSPEM]
261 lappend ans [list unalias alsp]
262 lappend ans [list unalias alfoo]
263 lappend ans [list unalias alcb]
264 lappend ans [list unalias alem]
265 lappend ans [list "unset -f funcfoo 2>/dev/null || true;"]
266 lappend ans [list "unset -f funccb 2>/dev/null || true;"]
267 lappend ans [list "unset -f funcwc 2>/dev/null || true;"]
268 lappend ans [list "unset -f funcnl 2>/dev/null || true;"]
269 lappend ans [list "unset -f funcsp 2>/dev/null || true;"]
270 testouterr_cmd_re sh {unload source-sh/1} $ans {}
271
272
273 #
274 # test other modes
275 #
276
277 # test 'list' sub-command
278 testouterr_cmd sh {list -t} OK $cur_loaded\nsource-sh/1\nsource-sh/2\nsource-sh/3
279
280 # test 'whatis' sub-command when some modules are loaded
281 testouterr_cmd_re sh {whatis source-sh} OK "$modlin $mpre $modlin
282 \\s*source-sh/1: source-sh/1
283 \\s*source-sh/2: source-sh/2
284 \\s*source-sh/3: source-sh/3
285 \\s*source-sh/4.0: source-sh/4.0
286 \\s*source-sh/4.1: source-sh/4.1
287 \\s*source-sh/4.2: source-sh/4.2
288 \\s*source-sh/4.3: source-sh/4.3
289 \\s*source-sh/6.0: source-sh/6.0
290 \\s*source-sh/7.0: source-sh/7.0
291 \\s*source-sh/7.1: source-sh/7.1
292 \\s*source-sh/7.2: source-sh/7.2"
293
294 # test 'help' sub-command when some modules are loaded
295 testouterr_cmd_re sh {help source-sh/1} OK "$modlin
296 Module Specific Help for $mpre/source-sh/1:
297
298 $warn_msgs: Unable to find ModulesHelp in $mpre/source-sh/1.
299 $modlin"
300 testouterr_cmd_re sh {help source-sh/4.3} OK "$modlin
301 Module Specific Help for $mpre/source-sh/4.3:
302
303 $warn_msgs: Unable to find ModulesHelp in $mpre/source-sh/4.3.
304 $modlin"
305
306 # test 'test' sub-command when some modules are loaded
307 testouterr_cmd_re sh {test source-sh/1} OK "$modlin
308 Module Specific Test for $mpre/source-sh/1:
309
310 $warn_msgs: Unable to find ModulesTest in $mpre/source-sh/1.
311 $modlin"
312 testouterr_cmd_re sh {test source-sh/4.3} OK "$modlin
313 Module Specific Test for $mpre/source-sh/4.3:
314
315 $warn_msgs: Unable to find ModulesTest in $mpre/source-sh/4.3.
316 $modlin"
317
318 # test 'display' sub-command when some modules are loaded
319 set tserr_disp1 "-------------------------------------------------------------------
320 $mp/source-sh/1:
321
322 chdir\t\t$mp
323 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
324 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
325 prepend-path\tFOOPATHDUP /path/to/dir1 /path/to/dir2 /path/to/dir3 {/path/to dir4}
326 prepend-path\tFOOPATHDUPEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
327 prepend-path\tFOOPATHDUPMIX {} /path/to/dir1 {/path/to/dir1 /path/to/dir2 /path/to/dir1} /path/to/dir3
328 prepend-path\tFOOPATHDUPSP {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to} {dir4 /path/to/dir3}
329 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
330 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
331 set-alias\talcb {echo\ f\{o}
332 set-alias\talem {}
333 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
334 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
335 set-function\tfunccb {
336 echo f\{o}
337 set-function\tfuncfoo {
338 echo foo}
339 set-function\tfuncnl {
340 echo foo;
341 echo bar}
342 set-function\tfuncsp {
343 echo f\\\"o;
344 echo b\\\\\\\"r;
345 echo f\\'o}
346 set-function\tfuncwc {
347 echo sou*sh}
348 setenv\t\tFOO value
349 setenv\t\tFOOCB va\{ue
350 setenv\t\tFOOEM {}
351 setenv\t\tFOOPATHDUPSPEM {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to/dir3 }
352 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
353 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
354 setenv\t\tFOOSP {value }
355 setenv\t\tFOOWC va*ue
356 module-whatis\tsource-sh/1
357 -------------------------------------------------------------------"
358 testouterr_cmd sh {display source-sh/1} OK $tserr_disp1
359
360 set tserr_disp2 "-------------------------------------------------------------------
361 $mp/source-sh/4.3:
362
363 [msg_moderr {Script 'testsuite/example/unk-to-mod.sh' cannot be found} {source-sh sh testsuite/example/unk-to-mod.sh} $mp/source-sh/4.3 2 { }]
364 -------------------------------------------------------------------"
365 testouterr_cmd sh {display source-sh/4.3} ERR $tserr_disp2
366 set tserr_disp3 "-------------------------------------------------------------------
367 $mp/source-sh/5.0:
368
369 append-path FOOPATHDUPMIX /path/to/dir3 {}
370 chdir $mp
371 set-alias\talcb {echo\ f\{o}
372 set-alias\talem {}
373 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
374 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
375 set-function\tfunccb {
376 echo f\{o}
377 set-function\tfuncfoo {
378 echo foo}
379 set-function\tfuncnl {
380 echo foo;
381 echo bar}
382 set-function\tfuncsp {
383 echo f\\\"o;
384 echo b\\\\\\\"r;
385 echo f\\'o}
386 set-function\tfuncwc {
387 echo sou*sh}
388 prepend-path FOOPATH /path/to/mini
389 set-alias almini {echo mini}
390 append-path FOOPATHDUPMIX /path/to/dir3 {}
391 chdir $mp
392 set-alias\talcb {echo\ f\{o}
393 set-alias\talem {}
394 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
395 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
396 set-function\tfunccb {
397 echo f\{o}
398 set-function\tfuncfoo {
399 echo foo}
400 set-function\tfuncnl {
401 echo foo;
402 echo bar}
403 set-function\tfuncsp {
404 echo f\\\"o;
405 echo b\\\\\\\"r;
406 echo f\\'o}
407 set-function\tfuncwc {
408 echo sou*sh}
409 setenv FOOARG1 arg1
410 setenv FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
411 -------------------------------------------------------------------"
412 testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
413 set tserr_disp4 "-------------------------------------------------------------------
414 $mp/source-sh/5.1:
415
416 append-path FOOPATHDUPMIX /path/to/dir3 {}
417 chdir $mp
418 set-alias\talcb {echo\ f\{o}
419 set-alias\talem {}
420 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
421 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
422 set-function\tfunccb {
423 echo f\{o}
424 set-function\tfuncfoo {
425 echo foo}
426 set-function\tfuncnl {
427 echo foo;
428 echo bar}
429 set-function\tfuncsp {
430 echo f\\\"o;
431 echo b\\\\\\\"r;
432 echo f\\'o}
433 set-function\tfuncwc {
434 echo sou*sh}
435 setenv FOOARG1 arg1
436 setenv FOOARG2 arg2
437 prepend-path FOOPATH /path/to/mini
438 set-alias almini {echo mini}
439 append-path FOOPATHDUPMIX /path/to/dir3 {}
440 chdir $mp
441 set-alias\talcb {echo\ f\{o}
442 set-alias\talem {}
443 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
444 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
445 set-function\tfunccb {
446 echo f\{o}
447 set-function\tfuncfoo {
448 echo foo}
449 set-function\tfuncnl {
450 echo foo;
451 echo bar}
452 set-function\tfuncsp {
453 echo f\\\"o;
454 echo b\\\\\\\"r;
455 echo f\\'o}
456 set-function\tfuncwc {
457 echo sou*sh}
458 setenv FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
459 -------------------------------------------------------------------"
460 testouterr_cmd sh {display source-sh/5.1} OK $tserr_disp4
461
462
463 unsetenv_loaded_module
464 unsetenv_var __MODULES_LMREFRESH
465 unsetenv_var __MODULES_LMSOURCESH
466 unsetenv_path_var FOOPATHDUP
467 unsetenv_path_var FOOPATHEM
468 unsetenv_path_var FOOPATHCB
469 unsetenv_path_var FOOPATHWC
470 unsetenv_path_var FOOPATHDUPMIX
471 unsetenv_path_var FOOPATH
472 unsetenv_path_var FOOPATHDUPEM
473 unsetenv_path_var FOOPATHDUPSP
474 unsetenv_var FOOPATHSP
475 unsetenv_var FOOEM
476 unsetenv_var FOOSP
477 unsetenv_var FOOPATHDUPSPEM
478 unsetenv_var FOOCB
479 unsetenv_var FOOWC
480 unsetenv_var FOO
481 unsetenv_var FOOPATHSPEM
482 unsetenv_var FOOMINI
483
484 # test 'whatis' sub-command when no module loaded
485 testouterr_cmd_re sh {whatis source-sh} OK "$modlin $mpre $modlin
486 \\s*source-sh/1: source-sh/1
487 \\s*source-sh/2: source-sh/2
488 \\s*source-sh/3: source-sh/3
489 \\s*source-sh/4.0: source-sh/4.0
490 \\s*source-sh/4.1: source-sh/4.1
491 \\s*source-sh/4.2: source-sh/4.2
492 \\s*source-sh/4.3: source-sh/4.3
493 \\s*source-sh/7.0: source-sh/7.0
494 \\s*source-sh/7.1: source-sh/7.1
495 \\s*source-sh/7.2: source-sh/7.2"
496
497 # test 'help' sub-command when no module loaded
498 testouterr_cmd_re sh {help source-sh/1} OK "$modlin
499 Module Specific Help for $mpre/source-sh/1:
500
501 $warn_msgs: Unable to find ModulesHelp in $mpre/source-sh/1.
502 $modlin"
503 testouterr_cmd_re sh {help source-sh/4.3} OK "$modlin
504 Module Specific Help for $mpre/source-sh/4.3:
505
506 $warn_msgs: Unable to find ModulesHelp in $mpre/source-sh/4.3.
507 $modlin"
508
509 # test 'test' sub-command when no module loaded
510 testouterr_cmd_re sh {test source-sh/1} OK "$modlin
511 Module Specific Test for $mpre/source-sh/1:
512
513 $warn_msgs: Unable to find ModulesTest in $mpre/source-sh/1.
514 $modlin"
515 testouterr_cmd_re sh {test source-sh/4.3} OK "$modlin
516 Module Specific Test for $mpre/source-sh/4.3:
517
518 $warn_msgs: Unable to find ModulesTest in $mpre/source-sh/4.3.
519 $modlin"
520
521 # test 'display' sub-command when no module loaded
522 testouterr_cmd sh {display source-sh/1} OK $tserr_disp1
523 testouterr_cmd sh {display source-sh/4.3} ERR $tserr_disp2
524 set tserr_disp3 "-------------------------------------------------------------------
525 $mp/source-sh/5.0:
526
527 chdir $mp
528 prepend-path FOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
529 prepend-path FOOPATHCB /path/to/dir1 /path/to/d{r2 /path/to/dir3
530 prepend-path FOOPATHDUP /path/to/dir1 /path/to/dir2 /path/to/dir3 {/path/to dir4}
531 prepend-path FOOPATHDUPEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
532 prepend-path FOOPATHDUPMIX {} /path/to/dir1 {/path/to/dir1 /path/to/dir2 /path/to/dir1} /path/to/dir3
533 prepend-path FOOPATHDUPSP {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to} {dir4 /path/to/dir3}
534 prepend-path FOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
535 prepend-path FOOPATHWC /path/to/dir1 /path/to/d*r2 /path/to/dir3
536 set-alias\talcb {echo\ f\{o}
537 set-alias\talem {}
538 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
539 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
540 set-function\tfunccb {
541 echo f\{o}
542 set-function\tfuncfoo {
543 echo foo}
544 set-function\tfuncnl {
545 echo foo;
546 echo bar}
547 set-function\tfuncsp {
548 echo f\\\"o;
549 echo b\\\\\\\"r;
550 echo f\\'o}
551 set-function\tfuncwc {
552 echo sou*sh}
553 setenv FOO value
554 setenv FOOCB va{ue
555 setenv FOOEM {}
556 setenv FOOPATHDUPSPEM {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to/dir3 }
557 setenv FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
558 setenv FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
559 setenv FOOSP {value }
560 setenv FOOWC va*ue
561 prepend-path FOOPATH /path/to/mini
562 set-alias almini {echo mini}
563 setenv FOOMINI value
564 append-path FOOPATHDUPMIX /path/to/dir3 {}
565 chdir $mp
566 set-alias\talcb {echo\ f\{o}
567 set-alias\talem {}
568 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
569 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
570 set-function\tfunccb {
571 echo f\{o}
572 set-function\tfuncfoo {
573 echo foo}
574 set-function\tfuncnl {
575 echo foo;
576 echo bar}
577 set-function\tfuncsp {
578 echo f\\\"o;
579 echo b\\\\\\\"r;
580 echo f\\'o}
581 set-function\tfuncwc {
582 echo sou*sh}
583 setenv FOOARG1 arg1
584 setenv FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
585 setenv FOOPATHDUP {/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3:/path/to dir4:/path/to/dir3}
586 setenv FOOPATHDUPEM :/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3::/path/to/dir3
587 -------------------------------------------------------------------"
588 testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
589 set tserr_disp4 "-------------------------------------------------------------------
590 $mp/source-sh/5.1:
591
592 chdir $mp
593 prepend-path FOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
594 prepend-path FOOPATHCB /path/to/dir1 /path/to/d{r2 /path/to/dir3
595 prepend-path FOOPATHDUP /path/to/dir1 /path/to/dir2 /path/to/dir3 {/path/to dir4}
596 prepend-path FOOPATHDUPEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
597 prepend-path FOOPATHDUPMIX {} /path/to/dir1 {/path/to/dir1 /path/to/dir2 /path/to/dir1} /path/to/dir3
598 prepend-path FOOPATHDUPSP {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to} {dir4 /path/to/dir3}
599 prepend-path FOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
600 prepend-path FOOPATHWC /path/to/dir1 /path/to/d*r2 /path/to/dir3
601 set-alias\talcb {echo\ f\{o}
602 set-alias\talem {}
603 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
604 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
605 set-function\tfunccb {
606 echo f\{o}
607 set-function\tfuncfoo {
608 echo foo}
609 set-function\tfuncnl {
610 echo foo;
611 echo bar}
612 set-function\tfuncsp {
613 echo f\\\"o;
614 echo b\\\\\\\"r;
615 echo f\\'o}
616 set-function\tfuncwc {
617 echo sou*sh}
618 setenv FOO value
619 setenv FOOARG1 arg1
620 setenv FOOARG2 arg2
621 setenv FOOCB va{ue
622 setenv FOOEM {}
623 setenv FOOPATHDUPSPEM {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to/dir3 }
624 setenv FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
625 setenv FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
626 setenv FOOSP {value }
627 setenv FOOWC va*ue
628 prepend-path FOOPATH /path/to/mini
629 set-alias almini {echo mini}
630 setenv FOOMINI value
631 append-path FOOPATHDUPMIX /path/to/dir3 {}
632 chdir $mp
633 set-alias\talcb {echo\ f\{o}
634 set-alias\talem {}
635 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
636 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
637 set-function\tfunccb {
638 echo f\{o}
639 set-function\tfuncfoo {
640 echo foo}
641 set-function\tfuncnl {
642 echo foo;
643 echo bar}
644 set-function\tfuncsp {
645 echo f\\\"o;
646 echo b\\\\\\\"r;
647 echo f\\'o}
648 set-function\tfuncwc {
649 echo sou*sh}
650 setenv FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
651 setenv FOOPATHDUP {/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3:/path/to dir4:/path/to/dir3}
652 setenv FOOPATHDUPEM :/path/to/dir1:/path/to/dir1:/path/to/dir2:/path/to/dir1:/path/to/dir3::/path/to/dir3
653 -------------------------------------------------------------------"
654 testouterr_cmd sh {display source-sh/5.1} OK $tserr_disp4
655
656 #
657 # erroneous call or script
658 #
659
660 # test bad source-sh call
661 set tserr "$moderr_msgs: wrong # args: should be \"source-sh ?--ignore? ?eltlist? shell script ?arg ...?\"
662 while executing
663 \"source-sh sh\"
664 (file \"$mp/source-sh/4.0\" line 2)
665 $err_contactns"
666 testouterr_cmd sh {load source-sh/4.0} ERR [msg_load source-sh/4.0 $tserr]
667 set tserr "$moderr_msgs: wrong # args: should be \"source-sh ?--ignore? ?eltlist? shell script ?arg ...?\"
668 while executing
669 \"source-sh\"
670 (file \"$mp/source-sh/4.1\" line 2)
671 $err_contactns"
672 testouterr_cmd sh {load source-sh/4.1} ERR [msg_load source-sh/4.1 $tserr]
673 set tserr [msg_moderr {Shell 'unk' not supported} {source-sh unk testsuite/example/sh-to-mod.sh} $mp/source-sh/4.2 2]
674 testouterr_cmd sh {load source-sh/4.2} ERR [msg_load source-sh/4.2 $tserr]
675 set tserr [msg_moderr {Script 'testsuite/example/unk-to-mod.sh' cannot be found} {source-sh sh testsuite/example/unk-to-mod.sh} $mp/source-sh/4.3 2]
676 testouterr_cmd sh {load source-sh/4.3} ERR [msg_load source-sh/4.3 $tserr]
677
678 # error during script evaluation
679 setenv_var TESTSUITE_SHTOMOD_FUZZYOUT1 1
680 set tserr [msg_moderr {Unexpected output when sourcing 'testsuite/example/sh-to-mod.sh' in shell 'bash'} {source-sh bash testsuite/example/sh-to-mod.sh} $mp/source-sh/1 2]
681 testouterr_cmd sh {load source-sh/1} ERR [msg_load source-sh/1 $tserr]
682
683
684 #
685 # empty script or duplicate source-sh calls
686 #
687
688 # test 'source-sh' script producing no output
689 unsetenv_var TESTSUITE_SHTOMOD_FUZZYOUT1
690 unsetenv_var TESTSUITE_SHTOMOD_PATHDUP
691 setenv_var TESTSUITE_SHTOMOD_NOVAR 1
692 setenv_var TESTSUITE_SHTOMOD_NOPATH 1
693 setenv_var TESTSUITE_SHTOMOD_NOALIAS 1
694 setenv_var TESTSUITE_SHTOMOD_NOFUNC 1
695 setenv_var TESTSUITE_SHTOMOD_NOCD 1
696 set ans [list]
697 lappend ans [list set _LMFILES_ $mp/source-sh/1]
698 lappend ans [list set LOADEDMODULES source-sh/1]
699 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh]
700 testouterr_cmd sh {load source-sh/1} $ans {}
701 set ans [list]
702 lappend ans [list set LOADEDMODULES source-sh/1:source-sh/2]
703 lappend ans [list set _LMFILES_ $mp/source-sh/1:$mp/source-sh/2]
704 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh:source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value]
705 lappend ans [list setpath FOOPATH /path/to/mini:]
706 lappend ans [list set __MODULES_LMREFRESH source-sh/2]
707 lappend ans [list set FOOMINI value]
708 lappend ans [list alias almini echo\ mini]
709 testouterr_cmd_re sh {load source-sh/1 source-sh/2} $ans {}
710
711 setenv_loaded_module [list source-sh/1 source-sh/2] [list $mp/source-sh/1 $mp/source-sh/2]
712 setenv_var __MODULES_LMREFRESH source-sh/2
713 setenv_var __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh:source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value
714 set ans [list]
715 lappend ans [list set _LMFILES_ $mp/source-sh/2]
716 lappend ans [list set LOADEDMODULES source-sh/2]
717 lappend ans [list set __MODULES_LMSOURCESH source-sh/2\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value]
718 testouterr_cmd sh {unload source-sh/1} $ans {}
719
720 unsetenv_loaded_module
721 unsetenv_var __MODULES_LMREFRESH
722 unsetenv_var __MODULES_LMSOURCESH
723 unsetenv_var TESTSUITE_SHTOMOD_NOVAR
724
725 set ans [list]
726 lappend ans [list set __MODULES_SHARE_FOOPATH :1]
727 lappend ans [list set FOOMINI value]
728 lappend ans [list set LOADEDMODULES source-sh/5.0]
729 lappend ans [list set _LMFILES_ $mp/source-sh/5.0]
730 lappend ans [list set __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1]
731 lappend ans [list set FOOEM {}]
732 lappend ans [list set FOOSP {value }]
733 lappend ans [list set FOOARG1 arg1]
734 lappend ans [list set FOOCB va\{ue]
735 lappend ans [list set FOOPATH /path/to/mini:]
736 lappend ans [list set FOO value]
737 lappend ans [list set __MODULES_LMREFRESH source-sh/5.0]
738 lappend ans [list set FOOWC va\*ue]
739 lappend ans [list alias almini echo\ mini]
740 testouterr_cmd sh {load source-sh/5.0} $ans {}
741
742 set ans [list]
743 lappend ans [list set __MODULES_SHARE_FOOPATH :1]
744 lappend ans [list set FOOMINI value]
745 lappend ans [list set LOADEDMODULES source-sh/5.1]
746 lappend ans [list set _LMFILES_ $mp/source-sh/5.1]
747 lappend ans [list set __MODULES_LMSOURCESH source-sh/5.1\&bash\ testsuite/example/sh-to-mod.sh\ arg1\ arg2\|setenv\ FOO\ value\|setenv\ FOOARG1\ arg1\|setenv\ FOOARG2\ arg2\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value]
748 lappend ans [list set FOOEM {}]
749 lappend ans [list set FOOARG1 arg1]
750 lappend ans [list set FOOSP {value }]
751 lappend ans [list set FOOARG2 arg2]
752 lappend ans [list set FOOCB va\{ue]
753 lappend ans [list set FOOPATH /path/to/mini:]
754 lappend ans [list set FOO value]
755 lappend ans [list set __MODULES_LMREFRESH source-sh/5.1]
756 lappend ans [list set FOOWC va\*ue]
757 lappend ans [list alias almini echo\ mini]
758 testouterr_cmd sh {load source-sh/5.1} $ans {}
759
760
761 #
762 # variable definition relying on a variable defined in sourced script
763 #
764
765 set tserr "-------------------------------------------------------------------
766 $mp/source-sh/6.0:
767
768 prepend-path FOOPATH /path/to/mini {}
769 set-alias almini {echo mini}
770 setenv FOOMINI value
771 setenv TS1 \$FOOMINI
772 setenv TS2 value
773 module-whatis source-sh/6.0
774 -------------------------------------------------------------------"
775 testouterr_cmd sh {display source-sh/6.0} OK $tserr
776 set msgtcl "no such variable
777 (read trace on \"env(FOOMINI)\")
778 invoked from within"
779 set tserr "-------------------------------------------------------------------
780 Module Specific Help for $mp/source-sh/6.0:
781
782 Module ERROR: $msgtcl
783 \"setenv TS2 \$env(FOOMINI)\"
784 (file \"$mp/source-sh/6.0\" line 4)
785 $err_contactns
786 -------------------------------------------------------------------"
787 testouterr_cmd sh {help source-sh/6.0} ERR $tserr
788 set tserr "-------------------------------------------------------------------
789 Module Specific Test for $mp/source-sh/6.0:
790
791 Module ERROR: $msgtcl
792 \"setenv TS2 \$env(FOOMINI)\"
793 (file \"$mp/source-sh/6.0\" line 4)
794 $err_contactns
795 -------------------------------------------------------------------"
796 testouterr_cmd sh {test source-sh/6.0} ERR $tserr
797 testouterr_cmd sh {whatis source-sh/6.0} OK {}
798
799 # try evaluation with variable pre-defined
800 setenv_var FOOMINI value
801
802 set tserr "-------------------------------------------------------------------
803 $mp/source-sh/6.0:
804
805 prepend-path FOOPATH /path/to/mini {}
806 set-alias almini {echo mini}
807 setenv TS1 \$FOOMINI
808 setenv TS2 value
809 module-whatis source-sh/6.0
810 -------------------------------------------------------------------"
811 testouterr_cmd sh {display source-sh/6.0} OK $tserr
812 set tserr "-------------------------------------------------------------------
813 Module Specific Help for $mp/source-sh/6.0:
814
815 $warn_msgs: Unable to find ModulesHelp in $mp/source-sh/6.0.
816 -------------------------------------------------------------------"
817 testouterr_cmd sh {help source-sh/6.0} OK $tserr
818 set tserr "-------------------------------------------------------------------
819 Module Specific Test for $mp/source-sh/6.0:
820
821 $warn_msgs: Unable to find ModulesTest in $mp/source-sh/6.0.
822 -------------------------------------------------------------------"
823 testouterr_cmd sh {test source-sh/6.0} OK $tserr
824
825 set tserr "$modlin $mpre $modlin
826 \\s*source-sh/6.0: source-sh/6.0"
827 testouterr_cmd_re sh {whatis source-sh/6.0} OK $tserr
828
829 unsetenv_var FOOMINI
830
831
832 #
833 # inconsistent environment
834 #
835
836 # module loaded, but no __MODULES_LMSOURCESH
837 setenv_loaded_module [list source-sh/1] [list $mp/source-sh/1]
838 setenv_path_var FOOPATHDUP "/path/to/dir1:/path/to/dir2:/path/to/dir3:/path/to dir4"
839 setenv_path_var FOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
840 setenv_path_var FOOPATHCB /path/to/dir1:/path/to/d\{r2:/path/to/dir3
841 setenv_path_var FOOPATHWC /path/to/dir1:/path/to/d\*r2:/path/to/dir3
842 setenv_path_var FOOPATHDUPMIX {} /path/to/dir1 "/path/to/dir1 /path/to/dir2 /path/to/dir1" /path/to/dir3
843 setenv_path_var FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3
844 setenv_path_var FOOPATHDUPEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
845 setenv_path_var FOOPATHDUPSP "/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to:dir4 /path/to/dir3"
846 setenv_var FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
847 setenv_var FOOEM {}
848 setenv_var FOOSP {value }
849 setenv_var FOOPATHDUPSPEM {/path/to/dir1 /path/to/dir1 /path/to/dir2 /path/to/dir1 /path/to/dir3 /path/to/dir3 }
850 setenv_var FOOCB va\{ue
851 setenv_var FOOWC va\*ue
852 setenv_var FOO value
853 setenv_var FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
854
855 set ans [list]
856 lappend ans [list unset _LMFILES_]
857 lappend ans [list unset LOADEDMODULES]
858 testouterr_cmd sh {unload source-sh/1} $ans {}
859
860 # partial __MODULES_LMSOURCESH
861 setenv_var __MODULES_LMREFRESH source-sh/1
862 setenv_var __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHDUP\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \{/path/to\ dir4\}\|prepend-path\ FOOPATHDUPEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHDUPMIX\ \{\}\ /path/to/dir1\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir1\}\ /path/to/dir3\|prepend-path\ FOOPATHDUPSP\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to\}\ \{dir4\ /path/to/dir3\}\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHDUPSPEM\ \{/path/to/dir1\ /path/to/dir1\ /path/to/dir2\ /path/to/dir1\ /path/to/dir3\ /path/to/dir3\ \}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOWC\ va\*ue
863 set ans [list]
864 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPMIX]
865 lappend ans [list unset _LMFILES_]
866 lappend ans [list unset LOADEDMODULES]
867 lappend ans [list unset FOOPATHDUP]
868 lappend ans [list unset __MODULES_LMSOURCESH]
869 lappend ans [list unset FOOPATHEM]
870 lappend ans [list unset FOOPATHSP]
871 lappend ans [list unset __MODULES_SHARE_FOOPATHDUPEM]
872 lappend ans [list unset FOOEM]
873 lappend ans [list unset FOOPATHCB]
874 lappend ans [list unset FOOPATHDUPSPEM]
875 lappend ans [list unset FOOPATHDUPMIX]
876 lappend ans [list unset FOOCB]
877 lappend ans [list unset FOOPATH]
878 lappend ans [list unset __MODULES_SHARE_FOOPATHEM]
879 lappend ans [list unset FOOPATHWC]
880 lappend ans [list unset FOOPATHDUPEM]
881 lappend ans [list unset FOO]
882 lappend ans [list unset FOOPATHDUPSP]
883 lappend ans [list unset __MODULES_LMREFRESH]
884 lappend ans [list unset FOOWC]
885 lappend ans [list unset FOOPATHSPEM]
886 lappend ans [list unalias alsp]
887 lappend ans [list unalias alcb]
888 lappend ans [list unalias alem]
889 lappend ans [list "unset -f funccb 2>/dev/null || true;"]
890 lappend ans [list "unset -f funcwc 2>/dev/null || true;"]
891 lappend ans [list "unset -f funcnl 2>/dev/null || true;"]
892 lappend ans [list "unset -f funcsp 2>/dev/null || true;"]
893 testouterr_cmd sh {unload source-sh/1} $ans {}
894
895 unsetenv_var __MODULES_LMREFRESH
896 unsetenv_var __MODULES_LMSOURCESH
897 unsetenv_path_var FOOPATHDUP
898 unsetenv_path_var FOOPATHEM
899 unsetenv_path_var FOOPATHCB
900 unsetenv_path_var FOOPATHWC
901 unsetenv_path_var FOOPATHDUPMIX
902 unsetenv_path_var FOOPATHDUPEM
903 unsetenv_path_var FOOPATHDUPSP
904 unsetenv_var FOOPATHSP
905 unsetenv_var FOOPATHDUPSPEM
906 unsetenv_var FOOPATHSPEM
907
908 # a LMSOURCESH entry with shtomodargs but no modcontent
909 setenv_loaded_module [list source-sh/5.0] [list $mp/source-sh/5.0]
910 setenv_var __MODULES_LMREFRESH source-sh/5.0
911 setenv_var FOOMINI value
912 setenv_var FOOARG1 arg1
913 setenv_path_var FOOPATH /path/to/mini {}
914 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1
915
916 set ans [list]
917 lappend ans [list unset FOOMINI]
918 lappend ans [list unset __MODULES_SHARE_FOOPATH]
919 lappend ans [list unset FOOPATH]
920 lappend ans [list unset _LMFILES_]
921 lappend ans [list unset LOADEDMODULES]
922 lappend ans [list unset __MODULES_LMREFRESH]
923 lappend ans [list unset __MODULES_LMSOURCESH]
924 lappend ans [list unset FOOARG1]
925 lappend ans [list unalias almini]
926 testouterr_cmd sh {unload source-sh/5.0} $ans {}
927
928 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1
929 set ans [list]
930 lappend ans [list unset FOOMINI]
931 lappend ans [list unset __MODULES_SHARE_FOOPATH]
932 lappend ans [list unset FOOPATH]
933 lappend ans [list unset _LMFILES_]
934 lappend ans [list unset LOADEDMODULES]
935 lappend ans [list unset __MODULES_LMREFRESH]
936 lappend ans [list unset __MODULES_LMSOURCESH]
937 lappend ans [list unset FOOARG1]
938 lappend ans [list unalias almini]
939 testouterr_cmd sh {unload source-sh/5.0} $ans {}
940
941 # bad modulefile command call in __MODULES_LMSOURCESH (missing alias body arg)
942 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1
943 set ans [list]
944 # value set-alias and set-function is rewritten when parsed
945 lappend ans [list unset FOOMINI]
946 lappend ans [list unset __MODULES_SHARE_FOOPATH]
947 lappend ans [list unset FOOPATH]
948 lappend ans [list unset _LMFILES_]
949 lappend ans [list unset LOADEDMODULES]
950 lappend ans [list unset __MODULES_LMREFRESH]
951 lappend ans [list unset __MODULES_LMSOURCESH]
952 lappend ans [list unset FOOARG1]
953 lappend ans [list unalias almini]
954 testouterr_cmd sh {unload source-sh/5.0} $ans {}
955
956 # bad modulefile command call in __MODULES_LMSOURCESH (missing alias name and body args)
957 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1
958 set tserr "$moderr_msgs: wrong # args: should be \"set-alias alias what\"
959 invoked from within
960 \"set-alias {}\"
961 invoked from within
962 \"interp eval \$itrp \$modcmd\"
963 (procedure \"source-sh-un\" line 12)
964 invoked from within
965 \"source-sh sh testsuite/example/mini-sh-to-mod.sh\"
966 (file \"$mp/source-sh/5.0\" line 3)
967 $err_contactns"
968 testouterr_cmd sh {unload source-sh/5.0} ERR [msg_unload source-sh/5.0 $tserr]
969
970 # bad modulefile command call in __MODULES_LMSOURCESH (missing variable value arg)
971 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1
972 set tserr "$moderr_msgs: wrong # args: should be \"setenv ?--set-if-undef? var val\"
973 while executing
974 \"setenv FOOARG1\"
975 invoked from within
976 \"interp eval \$itrp \$modcmd\"
977 (procedure \"source-sh-un\" line 12)
978 invoked from within
979 \"source-sh bash testsuite/example/sh-to-mod.sh arg1\"
980 (file \"$mp/source-sh/5.0\" line 4)
981 $err_contactns"
982 testouterr_cmd sh {unload source-sh/5.0} ERR [msg_unload source-sh/5.0 $tserr]
983
984 # unknown modulefile command in __MODULES_LMSOURCESH
985 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-foo\ almini\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1
986 set tserr "$moderr_msgs: invalid command name \"set-foo\"
987 while executing
988 \"set-foo almini\"
989 invoked from within
990 \"interp eval \$itrp \$modcmd\"
991 (procedure \"source-sh-un\" line 12)
992 invoked from within
993 \"source-sh sh testsuite/example/mini-sh-to-mod.sh\"
994 (file \"$mp/source-sh/5.0\" line 3)
995 $err_contactns"
996 testouterr_cmd sh {unload source-sh/5.0} ERR [msg_unload source-sh/5.0 $tserr]
997
998 # alias, function and completion defined in __MODULES_LMSOURCESH but not in script when modulefile is displayed
999 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOPATH\ /path/to/mini\ \{\}\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1|set-alias\ alunk\ \{\}\|set-function\ funcunk\ \{\}\|complete\ bash\ compunk\ \{\}
1000 set tserr_disp3 "-------------------------------------------------------------------
1001 $mp/source-sh/5.0:
1002
1003 setenv FOO value
1004 setenv FOOCB va{ue
1005 setenv FOOEM {}
1006 setenv FOOSP {value }
1007 setenv FOOWC va*ue
1008 prepend-path FOOPATH /path/to/mini {}
1009 set-alias almini {echo mini}
1010 setenv FOOMINI value
1011 setenv FOOARG1 arg1
1012 set-alias alunk {}
1013 set-function funcunk {}
1014 complete bash compunk {}
1015 -------------------------------------------------------------------"
1016 testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
1017
1018 # clear source-sh details recorded in env yet module is still loaded
1019 unsetenv_var __MODULES_LMSOURCESH
1020 set tserr_disp3 "-------------------------------------------------------------------
1021 $mp/source-sh/5.0:
1022
1023 -------------------------------------------------------------------"
1024 testouterr_cmd sh {display source-sh/5.0} OK $tserr_disp3
1025
1026
1027 unsetenv_loaded_module
1028 unsetenv_var __MODULES_LMREFRESH
1029 unsetenv_path_var FOOPATH
1030 unsetenv_var FOOEM
1031 unsetenv_var FOOSP
1032 unsetenv_var FOO
1033 unsetenv_var FOOMINI
1034 unsetenv_var FOOARG1
1035 unsetenv_var FOOCB
1036 unsetenv_var FOOWC
1037
1038
1039 #
1040 # escaping special chars
1041 #
1042
1043 setenv_var TESTSUITE_SOURCESH_ESCCHAR 1
1044
1045 set ans [list]
1046 lappend ans [list set __MODULES_SHARE_FOOPATH :1]
1047 lappend ans [list set FOOMINI value]
1048 lappend ans [list set _LMFILES_ $mp/source-sh/5.0]
1049 lappend ans [list set LOADEDMODULES source-sh/5.0]
1050 lappend ans [list set __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOESC\ \{\}\|prepend-path\ FOOPATH\ /path/\\\{\<EnvModEscS2\>\ /path/to/mini\ \{\}\ /path/\\\}\<EnvModEscS1\>\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1]
1051 lappend ans [list set FOOEM {}]
1052 lappend ans [list set FOOSP {value }]
1053 lappend ans [list set __MODULES_SHARE_FOOESC :1]
1054 lappend ans [list set FOOARG1 arg1]
1055 lappend ans [list set FOOCB va\{ue]
1056 lappend ans [list set FOOPATH /path/\{\|:/path/to/mini::/path/\}\&]
1057 lappend ans [list set FOO value]
1058 lappend ans [list set __MODULES_LMREFRESH source-sh/5.0]
1059 lappend ans [list set FOOWC va\*ue]
1060 lappend ans [list set FOOESC {}]
1061 lappend ans [list alias almini echo\ mini]
1062 testouterr_cmd sh {load source-sh/5.0} $ans {}
1063
1064 setenv_loaded_module [list source-sh/5.0] [list $mp/source-sh/5.0]
1065 setenv_var __MODULES_LMREFRESH source-sh/5.0
1066 setenv_var FOOMINI value
1067 setenv_var FOOEM {}
1068 setenv_var FOOSP {value }
1069 setenv_var FOOARG1 arg1
1070 setenv_var FOOCB va\{ue
1071 setenv_var FOOWC va\*ue
1072 setenv_path_var FOOPATH /path/\{\| /path/to/mini {} /path/\}\&
1073 setenv_var FOO value
1074 setenv_var __MODULES_LMSOURCESH source-sh/5.0\&bash\ testsuite/example/sh-to-mod.sh\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue\&sh\ testsuite/example/mini-sh-to-mod.sh\|prepend-path\ FOOESC\ \{\}\|prepend-path\ FOOPATH\ /path/\\\{\<EnvModEscS2\>\ /path/to/mini\ \{\}\ /path/\\\}\<EnvModEscS1\>\|set-alias\ almini\ \{\}\|setenv\ FOOMINI\ value\&bash\ testsuite/example/sh-to-mod.sh\ arg1\|setenv\ FOOARG1\ arg1
1075 setenv_path_var FOOESC {}
1076 set ans [list]
1077 lappend ans [list unset __MODULES_SHARE_FOOPATH]
1078 lappend ans [list unset FOOMINI]
1079 lappend ans [list unset _LMFILES_]
1080 lappend ans [list unset LOADEDMODULES]
1081 lappend ans [list unset __MODULES_LMSOURCESH]
1082 lappend ans [list unset FOOEM]
1083 lappend ans [list unset FOOSP]
1084 lappend ans [list unset __MODULES_SHARE_FOOESC]
1085 lappend ans [list unset FOOARG1]
1086 lappend ans [list unset FOOCB]
1087 lappend ans [list unset FOOPATH]
1088 lappend ans [list unset FOO]
1089 lappend ans [list unset __MODULES_LMREFRESH]
1090 lappend ans [list unset FOOWC]
1091 lappend ans [list unset FOOESC]
1092 lappend ans [list unalias almini]
1093 testouterr_cmd sh {unload source-sh/5.0} $ans {}
1094
1095 unsetenv_loaded_module
1096 unsetenv_var FOOMINI
1097 unsetenv_var FOOEM
1098 unsetenv_var FOOSP
1099 unsetenv_var FOOARG1
1100 unsetenv_var FOOCB
1101 unsetenv_var FOOWC
1102 unsetenv_path_var FOOPATH
1103 unsetenv_var FOO
1104 unsetenv_var __MODULES_LMREFRESH
1105 unsetenv_var __MODULES_LMSOURCESH
1106 unsetenv_path_var FOOESC
1107
1108
1109 # complete tests
1110
1111 unsetenv_var TESTSUITE_SHTOMOD_NOCOMP
1112 unsetenv_var TESTSUITE_SHTOMOD_NOVAR
1113 unsetenv_var TESTSUITE_SHTOMOD_NOPATH
1114 unsetenv_var TESTSUITE_SHTOMOD_NOALIAS
1115 unsetenv_var TESTSUITE_SHTOMOD_NOFUNC
1116 unsetenv_var TESTSUITE_SHTOMOD_NOCD
1117
1118 # tcsh
1119 if {[find_bin tcsh] ne {}} {
1120 set ans [list]
1121 lappend ans [list set _LMFILES_ $mp/source-sh/7.0]
1122 lappend ans [list set LOADEDMODULES source-sh/7.0]
1123 lappend ans [list set __MODULES_LMSOURCESH source-sh/7.0\&tcsh\ testsuite/example/sh-to-mod.csh\|chdir\ $mp\|complete\ tcsh\ cmd\ \{\}\|complete\ tcsh\ mycmd\ \{\}\|complete\ tcsh\ othercmd\ \{\}\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue]
1124 lappend ans [list set FOOPATHEM :/path/to/dir1:/path/to/dir2:/path/to/dir3]
1125 lappend ans [list set FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}]
1126 lappend ans [list set FOOPATHCB /path/to/dir1:/path/to/d\{r2:/path/to/dir3]
1127 lappend ans [list set FOOEM {}]
1128 lappend ans [list set FOOSP {value }]
1129 lappend ans [list set FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3]
1130 lappend ans [list set FOOCB va\{ue]
1131 lappend ans [list set __MODULES_SHARE_FOOPATHEM :1]
1132 lappend ans [list set FOOPATHWC /path/to/dir1:/path/to/d\*r2:/path/to/dir3]
1133 lappend ans [list set FOO value]
1134 lappend ans [list set __MODULES_LMREFRESH source-sh/7.0]
1135 lappend ans [list set FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }]
1136 lappend ans [list set FOOWC va\*ue]
1137 lappend ans [list alias alsp {echo f\"o; echo b\\\"r; echo f\'o}]
1138 lappend ans [list alias alfoo {echo `grep "report .Modules " ../../modulecmd.tcl | tr -d \\ | awk '{print $3}'`}]
1139 lappend ans [list alias alcb echo\ f\\\{o]
1140 lappend ans [list alias alem {}]
1141 lappend ans [list out {complete cmd 'n/-h/n/' 'n/--help/n/' 'n/-V/n/' 'n/--version/n/' 'p/1/(-h -V --help --version)/';}]
1142 lappend ans [list out {complete othercmd 'n/--help/n/';}]
1143 lappend ans [list out {complete mycmd 'n/help/`_module_avail`/' 'n/add/`_module_not_yet_loaded; echo "--auto --no-auto --force -f --icase -i --tag --tag="`/';}]
1144 lappend ans [list chdir $mp]
1145 testouterr_cmd tcsh {load source-sh/7.0} $ans {}
1146
1147 set tserr_disp70 "-------------------------------------------------------------------
1148 $mp/source-sh/7.0:
1149
1150 chdir\t\t$mp
1151 complete\ttcsh cmd {'n/-h/n/' 'n/--help/n/' 'n/-V/n/' 'n/--version/n/' 'p/1/(-h -V --help --version)/'}
1152 complete\ttcsh mycmd {'n/help/`_module_avail`/' 'n/add/`_module_not_yet_loaded; echo \"--auto --no-auto --force -f --icase -i --tag --tag=\"`/'}
1153 complete\ttcsh othercmd 'n/--help/n/'
1154 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
1155 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
1156 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
1157 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
1158 set-alias\talcb {echo f\\\{o}
1159 set-alias\talem {}
1160 set-alias\talfoo {echo `grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ | awk '{print \\\$3}'`}
1161 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
1162 setenv\t\tFOO value
1163 setenv\t\tFOOCB va\{ue
1164 setenv\t\tFOOEM {}
1165 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
1166 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
1167 setenv\t\tFOOSP {value }
1168 setenv\t\tFOOWC va*ue
1169 module-whatis\tsource-sh/7.0
1170 -------------------------------------------------------------------"
1171 testouterr_cmd sh {display source-sh/7.0} OK $tserr_disp70
1172 testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70
1173
1174 setenv_loaded_module [list source-sh/7.0] [list $mp/source-sh/7.0]
1175 setenv_var __MODULES_LMREFRESH source-sh/7.0
1176 setenv_var __MODULES_LMSOURCESH source-sh/7.0\&tcsh\ testsuite/example/sh-to-mod.csh\|chdir\ $mp\|complete\ tcsh\ cmd\ \{\}\|complete\ tcsh\ mycmd\ \{\}\|complete\ tcsh\ othercmd\ \{\}\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue
1177 set ans [list]
1178 lappend ans [list unset _LMFILES_]
1179 lappend ans [list unset LOADEDMODULES]
1180 lappend ans [list unset __MODULES_LMSOURCESH]
1181 lappend ans [list unset FOOPATHEM]
1182 lappend ans [list unset FOOPATHSP]
1183 lappend ans [list unset FOOPATHCB]
1184 lappend ans [list unset FOOEM]
1185 lappend ans [list unset FOOSP]
1186 lappend ans [list unset FOOPATH]
1187 lappend ans [list unset FOOCB]
1188 lappend ans [list unset FOOPATHWC]
1189 lappend ans [list unset FOO]
1190 lappend ans [list unset __MODULES_LMREFRESH]
1191 lappend ans [list unset FOOPATHSPEM]
1192 lappend ans [list unset FOOWC]
1193 lappend ans [list unalias alsp]
1194 lappend ans [list unalias alfoo]
1195 lappend ans [list unalias alcb]
1196 lappend ans [list unalias alem]
1197 lappend ans [list out {uncomplete cmd;}]
1198 lappend ans [list out {uncomplete othercmd;}]
1199 lappend ans [list out {uncomplete mycmd;}]
1200 testouterr_cmd tcsh {unload source-sh/7.0} $ans {}
1201
1202 set ans [list]
1203 lappend ans [list alias alsp {echo f\"o; echo b\\\"r; echo f\'o}]
1204 lappend ans [list alias alfoo {echo `grep "report .Modules " ../../modulecmd.tcl | tr -d \\ | awk '{print $3}'`}]
1205 lappend ans [list alias alcb echo\ f\\\{o]
1206 lappend ans [list alias alem {}]
1207 lappend ans [list out {complete cmd 'n/-h/n/' 'n/--help/n/' 'n/-V/n/' 'n/--version/n/' 'p/1/(-h -V --help --version)/';}]
1208 lappend ans [list out {complete othercmd 'n/--help/n/';}]
1209 lappend ans [list out {complete mycmd 'n/help/`_module_avail`/' 'n/add/`_module_not_yet_loaded; echo "--auto --no-auto --force -f --icase -i --tag --tag="`/';}]
1210 testouterr_cmd tcsh {refresh} $ans {}
1211
1212 testouterr_cmd tcsh {display source-sh/7.0} OK $tserr_disp70
1213
1214 unsetenv_loaded_module
1215 unsetenv_var __MODULES_LMREFRESH
1216 unsetenv_var __MODULES_LMSOURCESH
1217 }
1218
1219 # bash
1220 set ans [list]
1221 lappend ans [list set _LMFILES_ $mp/source-sh/7.1]
1222 lappend ans [list set LOADEDMODULES source-sh/7.1]
1223 lappend ans [list set __MODULES_LMSOURCESH source-sh/7.1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|complete\ bash\ cmd\ \{\}\|complete\ bash\ mycmd\ \{\}\|complete\ bash\ othercmd\ \{\}\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue]
1224 lappend ans [list set FOOPATHEM :/path/to/dir1:/path/to/dir2:/path/to/dir3]
1225 lappend ans [list set FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}]
1226 lappend ans [list set FOOPATHCB /path/to/dir1:/path/to/d\{r2:/path/to/dir3]
1227 lappend ans [list set FOOEM {}]
1228 lappend ans [list set FOOSP {value }]
1229 lappend ans [list set FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3]
1230 lappend ans [list set FOOCB va\{ue]
1231 lappend ans [list set __MODULES_SHARE_FOOPATHEM :1]
1232 lappend ans [list set FOOPATHWC /path/to/dir1:/path/to/d\*r2:/path/to/dir3]
1233 lappend ans [list set FOO value]
1234 lappend ans [list set __MODULES_LMREFRESH source-sh/7.1]
1235 lappend ans [list set FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }]
1236 lappend ans [list set FOOWC va\*ue]
1237 lappend ans [list alias alsp {echo f\"o; echo b\\\"r; echo f\'o}]
1238 lappend ans [list alias alfoo {echo $(grep "report .Modules " ../../modulecmd.tcl | tr -d \\ 2>/dev/null | awk '{print $3}')}]
1239 lappend ans [list alias alcb echo\ f\{o]
1240 lappend ans [list alias alem {}]
1241 lappend ans [list funcfoo "() { echo foo; }; export -f funcfoo;"]
1242 lappend ans [list funccb "() { echo f\{o; }; export -f funccb;"]
1243 lappend ans [list funcwc "() { echo sou*sh; }; export -f funcwc;"]
1244 lappend ans [list funcnl "() { echo foo;
1245 echo bar; }; export -f funcnl;"]
1246 lappend ans [list funcsp "() { echo f\\\"o;
1247 echo b\\\\\\\"r;
1248 echo f\\'o; }; export -f funcsp;"]
1249 lappend ans [list out {complete -o default -F _cmd cmd;}]
1250 lappend ans [list out {complete -u othercmd;}]
1251 lappend ans [list out {complete -j -P '"%' -S '"' mycmd;}]
1252 lappend ans [list chdir $mp]
1253 testouterr_cmd bash {load source-sh/7.1} $ans {}
1254
1255 set tserr_disp71 "-------------------------------------------------------------------
1256 $mp/source-sh/7.1:
1257
1258 chdir\t\t$mp
1259 complete\tbash cmd {-o default -F _cmd}
1260 complete\tbash mycmd {-j -P '\"%' -S '\"'}
1261 complete\tbash othercmd -u
1262 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
1263 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
1264 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
1265 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
1266 set-alias\talcb {echo\ f\{o}
1267 set-alias\talem {}
1268 set-alias\talfoo {echo \$(grep \"report .Modules \" ../../modulecmd.tcl | tr -d \\\\ 2>/dev/null | awk '\{print \$3\}')}
1269 set-alias\talsp {echo f\\\"o; echo b\\\\\\\"r; echo f\\'o}
1270 set-function\tfunccb {
1271 echo f\{o}
1272 set-function\tfuncfoo {
1273 echo foo}
1274 set-function\tfuncnl {
1275 echo foo;
1276 echo bar}
1277 set-function\tfuncsp {
1278 echo f\\\"o;
1279 echo b\\\\\\\"r;
1280 echo f\\'o}
1281 set-function\tfuncwc {
1282 echo sou*sh}
1283 setenv\t\tFOO value
1284 setenv\t\tFOOCB va\{ue
1285 setenv\t\tFOOEM {}
1286 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
1287 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
1288 setenv\t\tFOOSP {value }
1289 setenv\t\tFOOWC va*ue
1290 module-whatis\tsource-sh/7.1
1291 -------------------------------------------------------------------"
1292 testouterr_cmd sh {display source-sh/7.1} OK $tserr_disp71
1293 testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71
1294
1295 setenv_loaded_module [list source-sh/7.1] [list $mp/source-sh/7.1]
1296 setenv_var __MODULES_LMREFRESH source-sh/7.1
1297 setenv_var __MODULES_LMSOURCESH source-sh/7.1\&bash\ testsuite/example/sh-to-mod.sh\|chdir\ $mp\|complete\ bash\ cmd\ \{\}\|complete\ bash\ mycmd\ \{\}\|complete\ bash\ othercmd\ \{\}\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|set-alias\ alcb\ \{\}\|set-alias\ alem\ \{\}\|set-alias\ alfoo\ \{\}\|set-alias\ alsp\ \{\}\|set-function\ funccb\ \{\}\|set-function\ funcfoo\ \{\}\|set-function\ funcnl\ \{\}\|set-function\ funcsp\ \{\}\|set-function\ funcwc\ \{\}\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue
1298 set ans [list]
1299 lappend ans [list unset _LMFILES_]
1300 lappend ans [list unset LOADEDMODULES]
1301 lappend ans [list unset __MODULES_LMSOURCESH]
1302 lappend ans [list unset FOOPATHEM]
1303 lappend ans [list unset FOOPATHSP]
1304 lappend ans [list unset FOOPATHCB]
1305 lappend ans [list unset FOOEM]
1306 lappend ans [list unset FOOSP]
1307 lappend ans [list unset FOOPATH]
1308 lappend ans [list unset FOOCB]
1309 lappend ans [list unset FOOPATHWC]
1310 lappend ans [list unset FOO]
1311 lappend ans [list unset __MODULES_LMREFRESH]
1312 lappend ans [list unset FOOPATHSPEM]
1313 lappend ans [list unset FOOWC]
1314 lappend ans [list unalias alsp]
1315 lappend ans [list unalias alfoo]
1316 lappend ans [list unalias alcb]
1317 lappend ans [list unalias alem]
1318 lappend ans [list out {unset -f funcfoo 2>/dev/null || true;}]
1319 lappend ans [list out {unset -f funccb 2>/dev/null || true;}]
1320 lappend ans [list out {unset -f funcwc 2>/dev/null || true;}]
1321 lappend ans [list out {unset -f funcnl 2>/dev/null || true;}]
1322 lappend ans [list out {unset -f funcsp 2>/dev/null || true;}]
1323 lappend ans [list out {complete -r cmd;}]
1324 lappend ans [list out {complete -r othercmd;}]
1325 lappend ans [list out {complete -r mycmd;}]
1326 testouterr_cmd bash {unload source-sh/7.1} $ans {}
1327
1328 set ans [list]
1329 lappend ans [list alias alsp {echo f\"o; echo b\\\"r; echo f\'o}]
1330 lappend ans [list alias alfoo {echo $(grep "report .Modules " ../../modulecmd.tcl | tr -d \\ 2>/dev/null | awk '{print $3}')}]
1331 lappend ans [list alias alcb echo\ f\{o]
1332 lappend ans [list alias alem {}]
1333 lappend ans [list funcfoo "() { echo foo; }; export -f funcfoo;"]
1334 lappend ans [list funccb "() { echo f\{o; }; export -f funccb;"]
1335 lappend ans [list funcwc "() { echo sou*sh; }; export -f funcwc;"]
1336 lappend ans [list funcnl "() { echo foo;
1337 echo bar; }; export -f funcnl;"]
1338 lappend ans [list funcsp "() { echo f\\\"o;
1339 echo b\\\\\\\"r;
1340 echo f\\'o; }; export -f funcsp;"]
1341 lappend ans [list out {complete -o default -F _cmd cmd;}]
1342 lappend ans [list out {complete -u othercmd;}]
1343 lappend ans [list out {complete -j -P '"%' -S '"' mycmd;}]
1344 testouterr_cmd bash {refresh} $ans {}
1345
1346 testouterr_cmd bash {display source-sh/7.1} OK $tserr_disp71
1347
1348 unsetenv_loaded_module
1349 unsetenv_var __MODULES_LMREFRESH
1350 unsetenv_var __MODULES_LMSOURCESH
1351
1352 setenv_var TESTSUITE_SHTOMOD_NOALIAS 1
1353 setenv_var TESTSUITE_SHTOMOD_NOFUNC 1
1354
1355 # fish
1356 if {[find_bin fish] ne {}} {
1357 set ans [list]
1358 lappend ans [list set _LMFILES_ $mp/source-sh/7.2]
1359 lappend ans [list set LOADEDMODULES source-sh/7.2]
1360 lappend ans [list set __MODULES_LMSOURCESH source-sh/7.2\&fish\ testsuite/example/sh-to-mod.fish\|chdir\ $mp\|complete\ fish\ cmd\ \{\}\|complete\ fish\ mycmd\ \{\}\|complete\ fish\ othercmd\ \{\}\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue]
1361 lappend ans [list set FOOPATHEM :/path/to/dir1:/path/to/dir2:/path/to/dir3]
1362 lappend ans [list set FOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}]
1363 lappend ans [list set FOOPATHCB /path/to/dir1:/path/to/d\{r2:/path/to/dir3]
1364 lappend ans [list set FOOEM {}]
1365 lappend ans [list set FOOSP {value }]
1366 lappend ans [list set FOOPATH /path/to/dir1:/path/to/dir2:/path/to/dir3]
1367 lappend ans [list set FOOCB va\{ue]
1368 lappend ans [list set __MODULES_SHARE_FOOPATHEM :1]
1369 lappend ans [list set FOOPATHWC /path/to/dir1:/path/to/d\*r2:/path/to/dir3]
1370 lappend ans [list set FOO value]
1371 lappend ans [list set __MODULES_LMREFRESH source-sh/7.2]
1372 lappend ans [list set FOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }]
1373 lappend ans [list set FOOWC va\*ue]
1374 if {[info exists fish_version_ge31] && $fish_version_ge31} {
1375 lappend ans [list out {complete -e -c cmd;}]
1376 lappend ans [list out {complete -c cmd -l help -d 'Command help';}]
1377 lappend ans [list out {complete -c cmd -l version -d 'Command version';}]
1378 lappend ans [list out {complete -c cmd -s h -d 'Command help';}]
1379 lappend ans [list out {complete -c cmd -s V -d 'Command version';}]
1380 lappend ans [list out {complete -e -c othercmd;}]
1381 lappend ans [list out {complete -c othercmd --no-files -l help -d 'Command help';}]
1382 lappend ans [list out {complete -c othercmd --no-files -s h -d 'Command help';}]
1383 lappend ans [list out {complete -c othercmd -l version -d 'Command version';}]
1384 lappend ans [list out {complete -c othercmd -s V -d 'Command version';}]
1385 lappend ans [list out {complete -e -c mycmd;}]
1386 lappend ans [list out {complete -c mycmd --exclusive -s h -d 'Command help';}]
1387 } else {
1388 lappend ans [list out {complete -e -c cmd;}]
1389 lappend ans [list out {complete -c cmd --long-option help --description 'Command help';}]
1390 lappend ans [list out {complete -c cmd --long-option version --description 'Command version';}]
1391 lappend ans [list out {complete -c cmd --short-option 'h' --description 'Command help';}]
1392 lappend ans [list out {complete -c cmd --short-option 'V' --description 'Command version';}]
1393 lappend ans [list out {complete -e -c othercmd;}]
1394 lappend ans [list out {complete -c othercmd --long-option version --description 'Command version';}]
1395 lappend ans [list out {complete -c othercmd --no-files --long-option help --description 'Command help';}]
1396 lappend ans [list out {complete -c othercmd --no-files --short-option 'h' --description 'Command help';}]
1397 lappend ans [list out {complete -c othercmd --short-option 'V' --description 'Command version';}]
1398 lappend ans [list out {complete -e -c mycmd;}]
1399 lappend ans [list out {complete -c mycmd --exclusive --short-option 'h' --description 'Command help';}]
1400 }
1401 lappend ans [list chdir $mp]
1402 # following test is expected to fail on CYGWIN due to a packaging issue:
1403 # fish shell initialization script uses pgrep utility which is not available
1404 # see https://cygwin.com/pipermail/cygwin/2024-January/255154.html
1405 testouterr_cmd fish {load source-sh/7.2} $ans {} [expr {$os_name eq {cygwin} ? {xfail} : {}}]
1406
1407 if {[info exists fish_version_ge31] && $fish_version_ge31} {
1408 set tserr_disp72 "-------------------------------------------------------------------
1409 $mp/source-sh/7.2:
1410
1411 chdir\t\t$mp
1412 complete\tfish cmd {-l help -d 'Command help'}
1413 complete\tfish cmd {-l version -d 'Command version'}
1414 complete\tfish cmd {-s h -d 'Command help'}
1415 complete\tfish cmd {-s V -d 'Command version'}
1416 complete\tfish mycmd {--exclusive -s h -d 'Command help'}
1417 complete\tfish othercmd {--no-files -l help -d 'Command help'}
1418 complete\tfish othercmd {--no-files -s h -d 'Command help'}
1419 complete\tfish othercmd {-l version -d 'Command version'}
1420 complete\tfish othercmd {-s V -d 'Command version'}
1421 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
1422 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
1423 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
1424 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
1425 setenv\t\tFOO value
1426 setenv\t\tFOOCB va\{ue
1427 setenv\t\tFOOEM {}
1428 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
1429 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
1430 setenv\t\tFOOSP {value }
1431 setenv\t\tFOOWC va*ue
1432 module-whatis\tsource-sh/7.2
1433 -------------------------------------------------------------------"
1434 } else {
1435 set tserr_disp72 "-------------------------------------------------------------------
1436 $mp/source-sh/7.2:
1437
1438 chdir\t\t$mp
1439 complete\tfish cmd {--long-option help --description 'Command help'}
1440 complete\tfish cmd {--long-option version --description 'Command version'}
1441 complete\tfish cmd {--short-option 'h' --description 'Command help'}
1442 complete\tfish cmd {--short-option 'V' --description 'Command version'}
1443 complete\tfish mycmd {--exclusive --short-option 'h' --description 'Command help'}
1444 complete\tfish othercmd {--long-option version --description 'Command version'}
1445 complete\tfish othercmd {--no-files --long-option help --description 'Command help'}
1446 complete\tfish othercmd {--no-files --short-option 'h' --description 'Command help'}
1447 complete\tfish othercmd {--short-option 'V' --description 'Command version'}
1448 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
1449 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
1450 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
1451 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
1452 setenv\t\tFOO value
1453 setenv\t\tFOOCB va\{ue
1454 setenv\t\tFOOEM {}
1455 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
1456 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
1457 setenv\t\tFOOSP {value }
1458 setenv\t\tFOOWC va*ue
1459 module-whatis\tsource-sh/7.2
1460 -------------------------------------------------------------------"
1461 }
1462 testouterr_cmd sh {display source-sh/7.2} OK $tserr_disp72
1463 testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72
1464
1465 setenv_loaded_module [list source-sh/7.2] [list $mp/source-sh/7.2]
1466 setenv_var __MODULES_LMREFRESH source-sh/7.2
1467 setenv_var __MODULES_LMSOURCESH source-sh/7.2\&fish\ testsuite/example/sh-to-mod.fish\|chdir\ $mp\|complete\ fish\ cmd\ \{\}\|complete\ fish\ mycmd\ \{\}\|complete\ fish\ othercmd\ \{\}\|prepend-path\ FOOPATH\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHCB\ /path/to/dir1\ /path/to/d\\\{r2\ /path/to/dir3\|prepend-path\ FOOPATHEM\ \{\}\ /path/to/dir1\ /path/to/dir2\ /path/to/dir3\|prepend-path\ FOOPATHWC\ /path/to/dir1\ /path/to/d\*r2\ /path/to/dir3\|setenv\ FOO\ value\|setenv\ FOOCB\ va\\\{ue\|setenv\ FOOEM\ \{\}\|setenv\ FOOPATHSP\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\}\|setenv\ FOOPATHSPEM\ \{/path/to/dir1\ /path/to/dir2\ /path/to/dir3\ \}\|setenv\ FOOSP\ \{value\ \}\|setenv\ FOOWC\ va\*ue
1468 set ans [list]
1469 lappend ans [list unset _LMFILES_]
1470 lappend ans [list unset LOADEDMODULES]
1471 lappend ans [list unset __MODULES_LMSOURCESH]
1472 lappend ans [list unset FOOPATHEM]
1473 lappend ans [list unset FOOPATHSP]
1474 lappend ans [list unset FOOPATHCB]
1475 lappend ans [list unset FOOEM]
1476 lappend ans [list unset FOOSP]
1477 lappend ans [list unset FOOPATH]
1478 lappend ans [list unset FOOCB]
1479 lappend ans [list unset FOOPATHWC]
1480 lappend ans [list unset FOO]
1481 lappend ans [list unset __MODULES_LMREFRESH]
1482 lappend ans [list unset FOOPATHSPEM]
1483 lappend ans [list unset FOOWC]
1484 lappend ans [list out {complete -e -c cmd;}]
1485 lappend ans [list out {complete -e -c othercmd;}]
1486 lappend ans [list out {complete -e -c mycmd;}]
1487 testouterr_cmd fish {unload source-sh/7.2} $ans {}
1488
1489 set ans [list]
1490 if {[info exists fish_version_ge31] && $fish_version_ge31} {
1491 lappend ans [list out {complete -e -c cmd;}]
1492 lappend ans [list out {complete -c cmd -l help -d 'Command help';}]
1493 lappend ans [list out {complete -c cmd -l version -d 'Command version';}]
1494 lappend ans [list out {complete -c cmd -s h -d 'Command help';}]
1495 lappend ans [list out {complete -c cmd -s V -d 'Command version';}]
1496 lappend ans [list out {complete -e -c othercmd;}]
1497 lappend ans [list out {complete -c othercmd --no-files -l help -d 'Command help';}]
1498 lappend ans [list out {complete -c othercmd --no-files -s h -d 'Command help';}]
1499 lappend ans [list out {complete -c othercmd -l version -d 'Command version';}]
1500 lappend ans [list out {complete -c othercmd -s V -d 'Command version';}]
1501 lappend ans [list out {complete -e -c mycmd;}]
1502 lappend ans [list out {complete -c mycmd --exclusive -s h -d 'Command help';}]
1503 } else {
1504 lappend ans [list out {complete -e -c cmd;}]
1505 lappend ans [list out {complete -c cmd --long-option help --description 'Command help';}]
1506 lappend ans [list out {complete -c cmd --long-option version --description 'Command version';}]
1507 lappend ans [list out {complete -c cmd --short-option 'h' --description 'Command help';}]
1508 lappend ans [list out {complete -c cmd --short-option 'V' --description 'Command version';}]
1509 lappend ans [list out {complete -e -c othercmd;}]
1510 lappend ans [list out {complete -c othercmd --long-option version --description 'Command version';}]
1511 lappend ans [list out {complete -c othercmd --no-files --long-option help --description 'Command help';}]
1512 lappend ans [list out {complete -c othercmd --no-files --short-option 'h' --description 'Command help';}]
1513 lappend ans [list out {complete -c othercmd --short-option 'V' --description 'Command version';}]
1514 lappend ans [list out {complete -e -c mycmd;}]
1515 lappend ans [list out {complete -c mycmd --exclusive --short-option 'h' --description 'Command help';}]
1516 }
1517 if {!$is_modules_defined_fish} {
1518 testouterr_cmd fish {refresh} $ans {}
1519 }
1520
1521 if {[info exists fish_version_ge31] && $fish_version_ge31} {
1522 set tserr_disp72 "-------------------------------------------------------------------
1523 $mp/source-sh/7.2:
1524
1525 chdir\t\t$mp
1526 complete\tfish cmd {-l help -d 'Command help'}
1527 complete\tfish cmd {-s h -d 'Command help'}
1528 complete\tfish cmd {-l version -d 'Command version'}
1529 complete\tfish cmd {-s V -d 'Command version'}
1530 complete\tfish mycmd {--exclusive -s h -d 'Command help'}
1531 complete\tfish othercmd {-l version -d 'Command version'}
1532 complete\tfish othercmd {-s V -d 'Command version'}
1533 complete\tfish othercmd {--no-files -l help -d 'Command help'}
1534 complete\tfish othercmd {--no-files -s h -d 'Command help'}
1535 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
1536 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
1537 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
1538 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
1539 setenv\t\tFOO value
1540 setenv\t\tFOOCB va\{ue
1541 setenv\t\tFOOEM {}
1542 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
1543 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
1544 setenv\t\tFOOSP {value }
1545 setenv\t\tFOOWC va*ue
1546 module-whatis\tsource-sh/7.2
1547 -------------------------------------------------------------------"
1548 } else {
1549 set tserr_disp72 "-------------------------------------------------------------------
1550 $mp/source-sh/7.2:
1551
1552 chdir\t\t$mp
1553 complete\tfish cmd {--long-option help --description 'Command help'}
1554 complete\tfish cmd {--short-option 'h' --description 'Command help'}
1555 complete\tfish cmd {--long-option version --description 'Command version'}
1556 complete\tfish cmd {--short-option 'V' --description 'Command version'}
1557 complete\tfish mycmd {--exclusive --short-option 'h' --description 'Command help'}
1558 complete\tfish othercmd {--long-option version --description 'Command version'}
1559 complete\tfish othercmd {--short-option 'V' --description 'Command version'}
1560 complete\tfish othercmd {--no-files --long-option help --description 'Command help'}
1561 complete\tfish othercmd {--no-files --short-option 'h' --description 'Command help'}
1562 prepend-path\tFOOPATH /path/to/dir1 /path/to/dir2 /path/to/dir3
1563 prepend-path\tFOOPATHCB /path/to/dir1 /path/to/d\{r2 /path/to/dir3
1564 prepend-path\tFOOPATHEM {} /path/to/dir1 /path/to/dir2 /path/to/dir3
1565 prepend-path\tFOOPATHWC /path/to/dir1 /path/to/d\*r2 /path/to/dir3
1566 setenv\t\tFOO value
1567 setenv\t\tFOOCB va\{ue
1568 setenv\t\tFOOEM {}
1569 setenv\t\tFOOPATHSP {/path/to/dir1 /path/to/dir2 /path/to/dir3}
1570 setenv\t\tFOOPATHSPEM {/path/to/dir1 /path/to/dir2 /path/to/dir3 }
1571 setenv\t\tFOOSP {value }
1572 setenv\t\tFOOWC va*ue
1573 module-whatis\tsource-sh/7.2
1574 -------------------------------------------------------------------"
1575 }
1576 if {!$is_modules_defined_fish} {
1577 testouterr_cmd fish {display source-sh/7.2} OK $tserr_disp72
1578 }
1579
1580 unsetenv_loaded_module
1581 unsetenv_var __MODULES_LMREFRESH
1582 unsetenv_var __MODULES_LMSOURCESH
1583 }
1584
1585 setenv_var TESTSUITE_SHTOMOD_NOCOMP 1
1586 unsetenv_var TESTSUITE_SHTOMOD_NOALIAS
1587 unsetenv_var TESTSUITE_SHTOMOD_NOFUNC
1588
1589
1590 # test use of module command in script
1591 setenv_path_var MODULEPATH $modpath:$modpath.2
1592 setenv_var TESTSUITE_SHTOMOD_NOVAR 1
1593 setenv_var TESTSUITE_SHTOMOD_NOPATH 1
1594 setenv_var TESTSUITE_SHTOMOD_NOALIAS 1
1595 setenv_var TESTSUITE_SHTOMOD_NOFUNC 1
1596 setenv_var TESTSUITE_SHTOMOD_NOCD 1
1597 setenv_var TESTSUITE_SHTOMOD_MODULE 1
1598 # set things to trigger a module autoinit within test script in order to ensure
1599 # module is defined, then cleanup not to report this setup within the environment
1600 # changes made by the script
1601 setenv_var MODULES_SET_SHELL_STARTUP 0
1602 setenv_var MODULES_CMD [file normalize $env(TESTSUITEDIR)/../modulecmd.tcl]
1603
1604 set lmsourceshpath {}
1605 # setup simpler MANPATH value for tests if autoinit adds Modules man location to MANPATH
1606 if {$install_setmanpath eq {y}} {
1607 set default_manpath /usr/share/man:/usr/local/share/man
1608 setenv_var MANPATH $default_manpath
1609 if {[string first { } $install_mandir] != -1} {
1610 set mandirenc "{$install_mandir}"
1611 } else {
1612 set mandirenc $install_mandir
1613 }
1614 set updated_manpath_list [split $default_manpath :]
1615 set is_default_manpath_updated 0
1616 foreach install_manpath_elt [split $install_mandir :] {
1617 if {$install_manpath_elt ni $updated_manpath_list} {
1618 if {$install_appendmanpath eq {y}} {
1619 lappend updated_manpath_list $install_manpath_elt
1620 } else {
1621 set updated_manpath_list [linsert $updated_manpath_list 0 $install_manpath_elt]
1622 }
1623 set is_default_manpath_updated 1
1624 }
1625 }
1626 set updatedmanpath [join $updated_manpath_list :]
1627
1628 if {$is_default_manpath_updated} {
1629 if {$install_appendmanpath eq {y}} {
1630 set lmsourceshpath "append-path MANPATH $mandirenc|"
1631 } else {
1632 set lmsourceshpath "prepend-path MANPATH $mandirenc|"
1633 }
1634 }
1635 }
1636 # setup PATH without Modules bin location
1637 if {$install_setbinpath eq {y}} {
1638 set default_path [join [lsearch -all -inline -not [split $::env(PATH) :] $install_bindir] :]
1639 setenv_var PATH $default_path
1640 if {[string first { } $install_bindir] != -1} {
1641 set bindirenc "{$install_bindir}"
1642 } else {
1643 set bindirenc $install_bindir
1644 }
1645 if {$install_appendbinpath eq {y}} {
1646 set updatedpath $default_path:$install_bindir
1647 if {$install_appendmanpath eq {n}} {
1648 set lmsourceshpath "append-path PATH $bindirenc|$lmsourceshpath"
1649 } else {
1650 append lmsourceshpath "append-path PATH $bindirenc|"
1651 }
1652 } else {
1653 set updatedpath $install_bindir:$default_path
1654 append lmsourceshpath "prepend-path PATH $bindirenc|"
1655 }
1656 }
1657
1658 set ans [list]
1659 if {$install_versioning eq {y}} {
1660 lappend ans [list set MODULE_VERSION_STACK $install_version]
1661 }
1662 # MANPATH is set before PATH if the latter is appended and not the former
1663 if {$install_setmanpath eq {y} && $install_appendbinpath eq {y} && $install_appendmanpath eq {n} && $is_default_manpath_updated} {
1664 lappend ans [list set MANPATH $updatedmanpath]
1665 }
1666 if {$install_setbinpath eq {y}} {
1667 lappend ans [list set PATH $updatedpath]
1668 }
1669 if {$install_setmanpath eq {y} && ($install_appendbinpath eq {n} || $install_appendmanpath eq {y}) && $is_default_manpath_updated} {
1670 lappend ans [list set MANPATH $updatedmanpath]
1671 }
1672 lappend ans [list set _LMFILES_ $mp/source-sh/1]
1673 lappend ans [list set LOADEDMODULES source-sh/1]
1674 lappend ans [list set testsuite yes]
1675 lappend ans [list set MODULES_COLLECTION_TARGET bar]
1676 # if module was defined in environment prior test, the result of the source-sh evaluation
1677 # will be the unset of the module functions
1678 if {$is_modules_defined} {
1679 set extraans \|unset-function\ _module_raw\|unset-function\ ml\|unset-function\ module
1680 if {$is_mogui_defined} {
1681 append extraans \|unset-function\ mogui
1682 }
1683 } else {
1684 set extraans {}
1685 }
1686 if {$install_versioning eq {y}} {
1687 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULE_VERSION\ $install_version\|setenv\ MODULE_VERSION_STACK\ $install_version\|setenv\ MODULES_COLLECTION_TARGET\ bar\|setenv\ testsuite\ yes$extraans]
1688 } else {
1689 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULES_COLLECTION_TARGET\ bar\|setenv\ testsuite\ yes$extraans]
1690 }
1691 if {$install_versioning eq {y}} {
1692 lappend ans [list set MODULE_VERSION $install_version]
1693 }
1694 if {$is_modules_defined} {
1695 if {$is_mogui_defined} {
1696 lappend ans [list {unset -f mogui 2>/dev/null || true;}]
1697 }
1698 lappend ans [list {unset -f ml 2>/dev/null || true;}]
1699 lappend ans [list {unset -f module 2>/dev/null || true;}]
1700 lappend ans [list {unset -f _module_raw 2>/dev/null || true;}]
1701 }
1702 testouterr_cmd sh {load source-sh/1} $ans {}
1703
1704 if {$is_modules_defined} {
1705 set extratserr "
1706 unset-function\t_module_raw
1707 unset-function\tml
1708 unset-function\tmodule"
1709 if {$is_mogui_defined} {
1710 append extratserr "\nunset-function\tmogui"
1711 }
1712 } else {
1713 set extratserr {}
1714 }
1715
1716 set tserr "-------------------------------------------------------------------
1717 $mp/source-sh/1:\n\n"
1718 set tserr_path {}
1719 if {$install_setmanpath eq {y} && $is_default_manpath_updated} {
1720 if {$install_appendmanpath eq {y}} {
1721 append tserr_path "append-path\tMANPATH $mandirenc\n"
1722 } else {
1723 append tserr_path "prepend-path\tMANPATH $mandirenc\n"
1724 }
1725 }
1726 if {$install_setbinpath eq {y}} {
1727 if {$install_appendbinpath eq {y}} {
1728 if {$install_appendmanpath eq {n}} {
1729 set tserr_path "append-path\tPATH $bindirenc\n$tserr_path"
1730 } else {
1731 append tserr_path "append-path\tPATH $bindirenc\n"
1732 }
1733 } else {
1734 append tserr_path "prepend-path\tPATH $bindirenc\n"
1735 }
1736 }
1737 append tserr $tserr_path
1738 if {$install_versioning eq {y}} {
1739 append tserr "setenv\t\tMODULE_VERSION $install_version
1740 setenv\t\tMODULE_VERSION_STACK $install_version\n"
1741 }
1742 append tserr "setenv\t\tMODULES_COLLECTION_TARGET bar
1743 setenv\t\ttestsuite yes$extratserr
1744 module-whatis\tsource-sh/1
1745 -------------------------------------------------------------------"
1746 testouterr_cmd sh {display source-sh/1} OK $tserr
1747
1748 set tserr "$modlin
1749 Module Specific Help for $mpre/source-sh/1:
1750
1751 $warn_msgs: Unable to find ModulesHelp in $mpre/source-sh/1.
1752 $modlin"
1753 testouterr_cmd_re sh {help source-sh/1} OK $tserr
1754
1755 set tserr "$modlin
1756 Module Specific Test for $mpre/source-sh/1:
1757
1758 $warn_msgs: Unable to find ModulesTest in $mpre/source-sh/1.
1759 $modlin"
1760 testouterr_cmd_re sh {test source-sh/1} OK $tserr
1761
1762 # already set variable with equal or different value
1763 setenv_var MODULES_COLLECTION_TARGET foo
1764 setenv_var testsuite yes
1765 set ans [list]
1766 if {$install_versioning eq {y}} {
1767 lappend ans [list set MODULE_VERSION_STACK $install_version]
1768 }
1769 # MANPATH is set before PATH if the latter is appended and not the former
1770 if {$install_setmanpath eq {y} && $install_appendbinpath eq {y} && $install_appendmanpath eq {n} && $is_default_manpath_updated} {
1771 lappend ans [list set MANPATH $updatedmanpath]
1772 }
1773 if {$install_setbinpath eq {y}} {
1774 lappend ans [list set PATH $updatedpath]
1775 }
1776 if {$install_setmanpath eq {y} && ($install_appendbinpath eq {n} || $install_appendmanpath eq {y}) && $is_default_manpath_updated} {
1777 lappend ans [list set MANPATH $updatedmanpath]
1778 }
1779 lappend ans [list set _LMFILES_ $mp/source-sh/1]
1780 lappend ans [list set LOADEDMODULES source-sh/1]
1781 lappend ans [list set MODULES_COLLECTION_TARGET bar]
1782 if {$install_versioning eq {y}} {
1783 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULE_VERSION\ $install_version\|setenv\ MODULE_VERSION_STACK\ $install_version\|setenv\ MODULES_COLLECTION_TARGET\ bar$extraans]
1784 } else {
1785 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULES_COLLECTION_TARGET\ bar$extraans]
1786 }
1787 if {$install_versioning eq {y}} {
1788 lappend ans [list set MODULE_VERSION $install_version]
1789 }
1790 if {$is_modules_defined} {
1791 if {$is_mogui_defined} {
1792 lappend ans [list {unset -f mogui 2>/dev/null || true;}]
1793 }
1794 lappend ans [list {unset -f ml 2>/dev/null || true;}]
1795 lappend ans [list {unset -f module 2>/dev/null || true;}]
1796 lappend ans [list {unset -f _module_raw 2>/dev/null || true;}]
1797 }
1798 testouterr_cmd sh {load source-sh/1} $ans {}
1799
1800 # module is loaded prior sh-to-mod
1801 setenv_var testsuite no
1802 setenv_loaded_module [list setenv/1.0] [list $modpath/setenv/1.0]
1803 set ans [list]
1804 if {$install_versioning eq {y}} {
1805 lappend ans [list set MODULE_VERSION_STACK $install_version]
1806 }
1807 # MANPATH is set before PATH if the latter is appended and not the former
1808 if {$install_setmanpath eq {y} && $install_appendbinpath eq {y} && $install_appendmanpath eq {n} && $is_default_manpath_updated} {
1809 lappend ans [list set MANPATH $updatedmanpath]
1810 }
1811 if {$install_setbinpath eq {y}} {
1812 lappend ans [list set PATH $updatedpath]
1813 }
1814 if {$install_setmanpath eq {y} && ($install_appendbinpath eq {n} || $install_appendmanpath eq {y}) && $is_default_manpath_updated} {
1815 lappend ans [list set MANPATH $updatedmanpath]
1816 }
1817 lappend ans [list set _LMFILES_ $modpath/setenv/1.0:$mp/source-sh/1]
1818 lappend ans [list set LOADEDMODULES setenv/1.0:source-sh/1]
1819 lappend ans [list set MODULES_COLLECTION_TARGET bar]
1820 if {$install_versioning eq {y}} {
1821 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULE_VERSION\ $install_version\|setenv\ MODULE_VERSION_STACK\ $install_version\|setenv\ MODULES_COLLECTION_TARGET\ bar$extraans]
1822 } else {
1823 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULES_COLLECTION_TARGET\ bar$extraans]
1824 }
1825 if {$install_versioning eq {y}} {
1826 lappend ans [list set MODULE_VERSION $install_version]
1827 }
1828 if {$is_modules_defined} {
1829 if {$is_mogui_defined} {
1830 lappend ans [list {unset -f mogui 2>/dev/null || true;}]
1831 }
1832 lappend ans [list {unset -f ml 2>/dev/null || true;}]
1833 lappend ans [list {unset -f module 2>/dev/null || true;}]
1834 lappend ans [list {unset -f _module_raw 2>/dev/null || true;}]
1835 }
1836 testouterr_cmd sh {load source-sh/1} $ans {}
1837
1838
1839 setenv_loaded_module [list source-sh/1] [list $mp/source-sh/1]
1840 setenv_var testsuite yes
1841 setenv_var MODULES_COLLECTION_TARGET bar
1842 if {$install_setbinpath eq {y}} {
1843 setenv_var PATH $updatedpath
1844 }
1845 if {$install_setmanpath eq {y} && $is_default_manpath_updated} {
1846 setenv_var MANPATH $updatedmanpath
1847 }
1848 setenv_var __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|${lmsourceshpath}setenv\ MODULES_COLLECTION_TARGET\ bar\|setenv\ testsuite\ yes
1849 set ans [list]
1850 # MANPATH is set before PATH if the latter is appended and not the former
1851 if {$install_setmanpath eq {y} && $install_appendbinpath eq {y} && $install_appendmanpath eq {n} && $is_default_manpath_updated} {
1852 lappend ans [list set MANPATH $default_manpath]
1853 }
1854 if {$install_setbinpath eq {y}} {
1855 lappend ans [list set PATH $default_path]
1856 }
1857 if {$install_setmanpath eq {y} && ($install_appendbinpath eq {n} || $install_appendmanpath eq {y}) && $is_default_manpath_updated} {
1858 lappend ans [list set MANPATH $default_manpath]
1859 }
1860 lappend ans [list unset _LMFILES_]
1861 lappend ans [list unset LOADEDMODULES]
1862 lappend ans [list unset testsuite]
1863 lappend ans [list unset MODULES_COLLECTION_TARGET]
1864 lappend ans [list unset __MODULES_LMSOURCESH]
1865 testouterr_cmd sh {unload source-sh/1} $ans {}
1866 unsetenv_loaded_module
1867 unsetenv_var __MODULES_LMSOURCESH
1868 unsetenv_var MODULES_COLLECTION_TARGET
1869 unsetenv_var testsuite
1870 unsetenv_var TESTSUITE_SHTOMOD_MODULE
1871 if {$install_setbinpath eq {y}} {
1872 setenv_var PATH $ORIG_PATH
1873 }
1874
1875
1876 # check excepted siteconfig file is installed
1877 if {[siteconfig_isStderrTty]} {
1878
1879 # test removal of alias, function and completion from a source-sh script
1880 setenv_var TESTSUITE_SHTOMOD_UNSETALFUNCCOMP 1
1881
1882 setenv_var TESTSUITE_ENABLE_SITECONFIG_SOURCESHBASHUNSET 1
1883 set ans [list]
1884 lappend ans [list set _LMFILES_ $mp/source-sh/1]
1885 lappend ans [list set LOADEDMODULES source-sh/1]
1886 lappend ans [list set __MODULES_LMSOURCESH source-sh/1\&bash\ testsuite/example/sh-to-mod.sh\|uncomplete\ cmd\|unset-alias\ alfoo\|unset-function\ funcfoo]
1887 lappend ans [list unalias alfoo]
1888 lappend ans [list out {unset -f funcfoo 2>/dev/null || true;}]
1889 lappend ans [list out {complete -r cmd;}]
1890 testouterr_cmd bash {load source-sh/1} $ans {}
1891 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_SOURCESHBASHUNSET
1892
1893 if {[find_bin tcsh] ne {}} {
1894 setenv_var TESTSUITE_ENABLE_SITECONFIG_SOURCESHTCSHUNSET 1
1895 set ans [list]
1896 lappend ans [list set _LMFILES_ $mp/source-sh/7.0]
1897 lappend ans [list set LOADEDMODULES source-sh/7.0]
1898 lappend ans [list set __MODULES_LMSOURCESH source-sh/7.0\&tcsh\ testsuite/example/sh-to-mod.csh\|uncomplete\ cmd\|unset-alias\ alfoo]
1899 lappend ans [list unalias alfoo]
1900 lappend ans [list out {uncomplete cmd;}]
1901 testouterr_cmd tcsh {load source-sh/7.0} $ans {}
1902 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_SOURCESHTCSHUNSET
1903 }
1904
1905 if {[find_bin fish] ne {}} {
1906 setenv_var TESTSUITE_ENABLE_SITECONFIG_SOURCESHFISHUNSET 1
1907 set ans [list]
1908 lappend ans [list set _LMFILES_ $mp/source-sh/7.2]
1909 lappend ans [list set LOADEDMODULES source-sh/7.2]
1910 lappend ans [list set __MODULES_LMSOURCESH source-sh/7.2\&fish\ testsuite/example/sh-to-mod.fish\|uncomplete\ cmd\|unset-alias\ alfoo\|unset-function\ funcfoo]
1911 lappend ans [list unalias alfoo]
1912 lappend ans [list out {functions -e funcfoo;}]
1913 lappend ans [list out {complete -e -c cmd;}]
1914 testouterr_cmd fish {load source-sh/7.2} $ans {}
1915 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_SOURCESHFISHUNSET
1916 }
1917
1918 unsetenv_var TESTSUITE_SHTOMOD_UNSETALFUNCCOMP
1919
1920 } elseif {$verbose} {
1921 send_user "\tSkip tests relying on an excepted siteconfig file installed\n"
1922 }
1923
1924
1925 #
1926 # Cleanup
1927 #
1928
1929 reset_test_env