Debian Codegraph @

testsuite/modules.90-avail/030-multiple.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.90-avail/%M%
6 # Revision: %I%
7 # First Edition: 95/12/06
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Jens Hamisch, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: avail
14 # Modulefiles: loc_rc1/1.0, loc_rc1/2.0, loc_rc3/1.0, loc_rc3/2.0,
15 # loc_rc3/3.0, loc_rc6, averssort, sym_foo, bad
16 # Sub-Command:
17 #
18 # Comment: %C{
19 # Check the module 'avail' command for a category
20 # module name in terse output mode.
21 # }C%
22 #
23 ##############################################################################
24
25 # ensure avail tests are made using in depth mode
26 setenv_var MODULES_AVAIL_INDEPTH 1
27
28 # ensure regular avail search match is set for these tests
29 setenv_var MODULES_SEARCH_MATCH starts_with
30
31 setenv_var MODULES_TERM_WIDTH 211
32
33 set module1 "loc_rc1"
34 set mod1vers1 "1.0"
35 set mod1vers2 "2.0"
36 set mod1sym "foo"
37 set module2 "loc_rc3"
38 set mod2vers1 "1.0"
39 set mod2vers2 "2.0"
40 set mod2vers3 "3.0"
41 set mod2sym1 "default"
42 set mod2sym2 "cur:stable"
43 set mod2sym3 "chk:exp:new:test"
44 set module3 "averssort"
45 set mod3vers1 "1"
46 set mod3vers2 "1.2.4"
47 set mod3vers3 "1.10"
48 set module4 "sym_foo"
49 set module5 "bad"
50 set mod5vers1 "after"
51 set mod5vers2 "before"
52 set mod5vers3 "body"
53 set mod5vers4 "proc"
54 set mod5sym1 "good"
55 set module6 "loc_rc6"
56 set mod6vers1 "0.9"
57 set mod6vers2 "1.2"
58 set mod6sym1 "default"
59 set mod6sym2 "new"
60 set mod6alias1 "1"
61 set mod6alias2 "bar"
62 set module7 "modalias/1.0"
63 set header "$modlin $modpathre $modlin\n"
64 set header2 "$modlin global/user modulerc $modlin\n"
65
66 set key_sym "Key:
67 \\(symbolic-version\\) "
68 set key_al "Key:
69 \\(@\\)=module-alias "
70 set key_al_sym "Key:
71 \\(@\\)=module-alias \\(symbolic-version\\) "
72
73 #
74 # tests on a module with single symbol
75 #
76
77 # Check this only for the /bin/csh
78 set ts_csh "$header$module1/$mod1vers1\\($mod1sym\\)\\s+$module1/$mod1vers2\\s+"
79
80 testouterr_cmd_re "csh" "avail $module1" "OK" "$ts_csh\n\n$key_sym"
81 testouterr_cmd_re "csh" "avail $module1 $module1" "OK" "$ts_csh\n\n$key_sym"
82
83 skip_if_quick_mode
84
85
86 #
87 # tests on a module with multiple symbols
88 #
89
90 set ts_csh "$header$module2/$mod2vers1\\($mod2sym1\\)\\s+$module2/$mod2vers2\\($mod2sym2\\)\\s+$module2/$mod2vers3\\($mod2sym3\\)\\s+"
91
92 testouterr_cmd_re "csh" "avail $module2" "OK" "$ts_csh\n\n$key_sym"
93 testouterr_cmd_re "csh" "avail $module2 $module2" "OK" "$ts_csh\n\n$key_sym"
94
95
96 #
97 # tests on a module alias
98 #
99
100 set ts_csh "$header$module3/$mod3vers1\\(@\\)\\s+$module3/$mod3vers2\\(@\\)\\s+$module3/$mod3vers3\\(@\\)\\s+"
101
102 testouterr_cmd_re "csh" "avail $module3" "OK" "$ts_csh\n\n$key_al"
103 testouterr_cmd_re "csh" "avail $module3 $module3" "OK" "$ts_csh\n\n$key_al"
104
105
106 #
107 # tests on a module alias set from a global modulerc
108 #
109
110 set env(MODULERCFILE) "$env(TESTSUITEDIR)/etc/modulerc"
111 set ts_csh "$header2$module4\\(special:@\\)\\s+"
112
113 testouterr_cmd_re "csh" "avail $module4" "OK" "$ts_csh\n\n$key_al_sym"
114 testouterr_cmd_re "csh" "avail $module4 $module4" "OK" "$ts_csh\n\n$key_al_sym"
115
116
117 #
118 # tests on a erroneous module with symbols
119 # no error should be displayed
120 #
121
122 set ts_csh "$header$module5/$mod5vers1\\($mod5sym1\\)\\s+$module5/$mod5vers2\\s+${module5}2/$mod5vers3\\s+${module5}2/$mod5vers4\\s+"
123
124 testouterr_cmd_re "csh" "avail $module5" "OK" "$ts_csh\n\n$key_sym"
125 testouterr_cmd_re "csh" "avail $module5 $module5" "OK" "$ts_csh\n\n$key_sym"
126
127
128 #
129 # tests on a module mixing aliases, symbols and regular modulefile
130 #
131
132 set ts_csh "$header$module6/$mod6vers1\\s+$module6/$mod6alias1\\(@\\)\\s+$module6/$mod6vers2\\($mod6sym1:$mod6sym2\\)\\s+$module6/$mod6alias2\\(@\\)\\s+"
133
134 testouterr_cmd_re "csh" "avail $module6" "OK" "$ts_csh\n\n$key_al_sym"
135 testouterr_cmd_re "csh" "avail $module6 $module6" "OK" "$ts_csh\n\n$key_al_sym"
136
137 # no match for first pattern
138 testouterr_cmd_re csh "avail unk $module6" OK $ts_csh\n\n$key_al_sym
139 # no match for second pattern
140 testouterr_cmd_re csh "avail $module6 unk" OK $ts_csh\n\n$key_al_sym
141 # no match on both pattern
142 testouterr_cmd_re csh "avail unk knu" OK {}
143
144
145 #
146 # mix different search patterns
147 #
148
149 set ts_csh "$header$module1/$mod1vers1\\($mod1sym:special\\)\\s+$module1/$mod1vers2\\s+"
150 append ts_csh "$module6/$mod6vers1\\s+$module6/$mod6alias1\\(@\\)\\s+$module6/$mod6vers2\\($mod6sym1:$mod6sym2\\)\\s+$module6/$mod6alias2\\(@\\)\\s+"
151
152 testouterr_cmd_re csh "avail $module1 $module6" OK $ts_csh\n\n$key_al_sym
153
154
155 #
156 # tess on a module alias when multiple paths set
157 #
158
159 # save the former modulepath setup
160 setenv_path_var MODULEPATH "$modpath.deep" $modpath
161 set header "$modlin $modpathre.deep $modlin\n"
162 set ts_csh "$header$module7\\(@\\)\\s+"
163
164 testouterr_cmd_re "csh" "avail $module7" "OK" "$ts_csh\n\n$key_al"
165 testouterr_cmd_re "csh" "avail $module7 $module7" "OK" "$ts_csh\n\n$key_al"
166
167
168 #
169 # mix different search patterns found in different modulepaths
170 #
171
172 append ts_csh "\n\n$modlin $modpathre $modlin\n"
173 append ts_csh "$module1/$mod1vers1\\($mod1sym:special\\)\\s+$module1/$mod1vers2\\s+"
174
175 testouterr_cmd_re csh "avail $module1 $module7" OK $ts_csh\n\n$key_al_sym
176
177
178 #
179 # Cleanup
180 #
181
182 reset_test_env