Skip to content

Commit e886416

Browse files
committed
ts: clean test code relative to Modules v3 "update" sub-cmd
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent 3dece64 commit e886416

File tree

8 files changed

+9
-213
lines changed

8 files changed

+9
-213
lines changed

doc/source/changes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,12 @@ The following module sub-commands appeared on Modules 5.
10161016
header indicates the oldest Modules version compatible with this cache file
10171017
(5.3), rather than the version that generated the cache file.
10181018

1019+
:subcmd:`update`
1020+
1021+
This sub-command is reintroduced (was part of Modules v3) as a simple alias
1022+
of :subcmd:`reload` sub-command. No more support from ``MODULESBEGINENV``,
1023+
initial environment handling now covers this use case.
1024+
10191025
Environment
10201026
"""""""""""
10211027

testsuite/config/base-config.exp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,6 @@
2121
#
2222
##############################################################################
2323

24-
#
25-
# some tests only apply if the configure option is enabled or not
26-
# look at ./modulecmd --version for examples
27-
# (e.g. version_test("XXX=undef") returns 0 or 1 if the string is found)
28-
# if { [ version_test "XXX=1" ] } {
29-
# } else {
30-
# }
31-
#
32-
proc version_test {which} {
33-
global comp_output
34-
global comp_error
35-
global verbose
36-
37-
if { $verbose > 1 } {
38-
send_user " ... version_test($which)\n"
39-
}
40-
set comp_output ""
41-
set comp_error ""
42-
43-
if { ![info exists which] } {
44-
unresolved "version_test ($which) internal error"
45-
}
46-
47-
modulecmd__ "--version"
48-
49-
if { ![regexp -- ".*$which.*" $comp_error] } {
50-
if { $verbose > 1 } {
51-
send_user "version_test: 0\n"
52-
}
53-
return 0
54-
} else {
55-
if { $verbose > 1 } {
56-
send_user "version_test: 1\n"
57-
}
58-
return 1
59-
}
60-
}
61-
6224
#
6325
# Shell conversion code subprocedures
6426
#

testsuite/config/unix.exp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,20 +265,6 @@ proc modulecmd_start {command {input noinput}} {
265265
unset no_verbose
266266
}
267267

268-
#
269-
# modulecmd__ -- start modulecmd running
270-
# (same as above but no verbose output)
271-
272-
proc modulecmd__ {command} {
273-
global shell
274-
global no_verbose
275-
276-
set shell "sh"
277-
set no_verbose 1
278-
modulecmd_xxx_ "$command"
279-
unset no_verbose
280-
}
281-
282268
#
283269
# modulecmd_version -- extract and print the version number of modulecmd
284270
#

testsuite/modules.00-init/010-environ.exp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,8 @@ catch {unset env(MODULESHOME)}
193193

194194
set ORIG_PATH $env(PATH)
195195

196+
setenv_var HOME $env(TESTSUITEDIR)
197+
set ORIG_HOME $env(HOME)
198+
196199
unsetenv_var testsuite
197200

testsuite/modules.00-init/080-begenv.exp

Lines changed: 0 additions & 71 deletions
This file was deleted.

testsuite/modules.10-use/070-unuse.exp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ testouterr_cmd_re "ALL" "$use $badpath" $ans {}
5353

5454
#
5555
# The tests ...
56-
# do these last so the .modulesbeginenv is left in a good state for 070-Maint
5756
#
5857

5958
set ans [list]

testsuite/modules.70-maint/020-update.exp

Lines changed: 0 additions & 86 deletions
This file was deleted.

testsuite/modules.95-version/999-cleanup.exp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ unset modulepath
4444
if { $verbose > 1 } {
4545
send_user "\tCleaning up after all tests ...\n"
4646
}
47-
if { [ version_test "BEGINENV=\[1-9\]" ] } {
48-
file delete $env(_MODULESBEGINENV_)
49-
}
5047

5148
# restore orig saved test env
5249
save_test_env

0 commit comments

Comments
 (0)