Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .hunspell.en.dic
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ autoload
automake
autopoint
autoreconf
autosym
autosym10
autosymbol
autotools
availabilities
avx
Expand Down Expand Up @@ -516,13 +519,15 @@ initdir
initializations
initlist
initprepend
initproc
initrc
initrm
initswitch
instopt
intbe
intelmpi
interp
intvallist
io
isExtraMatchSearchRequired
isModuleEvaluated
Expand Down Expand Up @@ -605,13 +610,15 @@ modEq
modEqStatic
modStartNb
modVariantCmp
modarg
modetype
modfile
modquar
modrc
modscan
modshare
modspec
moduleUnmetDep
moduleVersSpec
modulecache
modulecmd
Expand Down Expand Up @@ -657,6 +664,7 @@ netcdf
netlib
newfstatat
nglfar
ni
noLoadIntel
nocaseatall
noclobber
Expand Down Expand Up @@ -893,20 +901,24 @@ tweakable
txt
ubuntu
umask
ummod
un
unalias
uname
uncomplete
undef
unhide
unmetDepHash
unix
unixtime
unixtimestamp
unk
unkeyed
unlink
unloadable
unprefixed
unsetConf
unsetModuleDependency
unsetState
unsetenv
unsets
Expand All @@ -925,6 +937,7 @@ userlvl
usr
utitilies
va
validvallist
variantifspec
variantname
vectorization
Expand Down
15 changes: 5 additions & 10 deletions tcl/modfind.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -2490,13 +2490,11 @@ proc unsetModuleDependency {mod} {
# unset eventual registered unmet dependencies
if {[info exists ::g_moduleUnmetDep($mod)]} {
foreach ummod $::g_moduleUnmetDep($mod) {
if {[info exists ::g_unmetDepHash($ummod)]} {
set idx [lsearch -exact $::g_unmetDepHash($ummod) $mod]
set ::g_unmetDepHash($ummod) [lreplace $::g_unmetDepHash($ummod)\
$idx $idx+1]
if {![llength $::g_unmetDepHash($ummod)]} {
unset ::g_unmetDepHash($ummod)
}
set idx [lsearch -exact $::g_unmetDepHash($ummod) $mod]
set ::g_unmetDepHash($ummod) [lreplace $::g_unmetDepHash($ummod)\
$idx $idx+1]
if {![llength $::g_unmetDepHash($ummod)]} {
unset ::g_unmetDepHash($ummod)
}
}
reportDebug "unset unmet requirements for '$mod'"
Expand Down Expand Up @@ -3396,9 +3394,6 @@ proc getModules {dir {mod {}} {fetch_mtime 0} {search {}} {filter {}}} {

# build module symbol list
lappend versmod_list($versmod) $vers
# add global/user rc def to module symbol list in any cases
} elseif {!$add_rc_defs && [info exists g_rcVersion($vers)]} {
lappend versmod_list($versmod) $vers
}
}

Expand Down
3 changes: 0 additions & 3 deletions tcl/report.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -1598,9 +1598,6 @@ proc reportModules {search_queries header hsgrkey hstyle show_mtime show_idx\
if {$json} {
##nagelfar ignore Found constant
upvar 0 clean_list display_list
if {![info exists display_list]} {
set display_list {}
}
} else {
set display_list {}
foreach disp $clean_list {
Expand Down
2 changes: 1 addition & 1 deletion testsuite/example/.modulespath.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# # location of version files
@VERSIONING@@baseprefix@/$MODULE_VERSION/modulefiles # Module pkg modulefiles (if versioning)
@NOTVERSIONING@@modulefilesdir@ # Module pkg modulefiles (if no versioning)
@prefix@/test/modulefiles:@prefix@/test/etc # General module files
@prefix@/test/modulefiles:@prefix@/test/etc:@prefix@/test/absent # General module files, last one unresolved
#@prefix@/your_contribs # Edit for your requirements
56 changes: 56 additions & 0 deletions testsuite/example/siteconfig.tcl-1
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,44 @@ if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_REDEFONTHEFLYPROCS)]} {
report [modEq foo fOo equal]
}

# defineGetEqArrayKeyProc redefinition coverage test: the first two calls
# use the same implicit_default value in a row to exercise the no-op path
# where the currently active variant already matches what is being asked
# for; the following two calls switch value each time, to exercise the
# rename-the-previous-variant-back path in both directions
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_REDEFGETEQARRAYKEYPROC)]} {
array set arr {foo/1.0 {version foo/1.0}}
defineGetEqArrayKeyProc 0
report [getEqArrayKey arr foo/1.0]
defineGetEqArrayKeyProc 0
report [getEqArrayKey arr foo/1.0]
defineGetEqArrayKeyProc 1
report [getEqArrayKey arr foo/1.0]
defineGetEqArrayKeyProc 0
report [getEqArrayKey arr foo/1.0]
}

# getMatchingTagList coverage test: force a duplicate tag entry directly in
# the global tag structures (setModspecTag itself always dedupes by tag
# name, so this shape cannot occur through module-tag/module-hide/
# module-forbid) to exercise the "tag already seen earlier in this same
# call" skip path, which normal usage never reaches
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_DUPTAGROOT)]} {
defineModEqProc 0 0
set ::g_moduleTagRoot(duptagtest) [list sometag sometag]
set ::g_moduleTagRootSpec(duptagtest) [list [list duptagtest/1.0 {}]\
[list duptagtest/1.0 {}]]
report [getMatchingTagList duptagtest/1.0]
}

# getAvailListFromVersSpec coverage test: its only caller (the extra-match
# search dispatch in modscan.tcl) always passes a modarg already registered
# through parseModuleSpecification, so the unregistered-modarg path is
# exercised directly here instead
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_AVAILLISTUNREG)]} {
report [string length [getAvailListFromVersSpec neverregisteredmodarg]]
}

# specific tests to improve formatErrStackTrace proc coverage
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_FORMATERRSTACKTRACE)]} {
set errmsg {error message
Expand Down Expand Up @@ -360,6 +398,24 @@ if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_BADVARIANTSHORTCUTDFLVALUE)]} {
set g_config_defs(variant_shortcut) {MODULES_VARIANT_SHORTCUT {foo} 0 l {} {} initConfVariantShortcut}
}

# exercise the single-element validvallist "string is" class check path in
# getConf, not used by any current config option, by superseding an existing
# lockable option's definition with that shape
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_VALIDVALLISTSTRINGIS)]} {
set ::g_config_defs(run_quarantine) {MODULES_RUN_QUARANTINE default 0 s\
integer}
set env(MODULES_RUN_QUARANTINE) 42
report [getConf run_quarantine]
}

# exercise the generic intvallist conversion path in getConf when no initproc
# is set, not used by any current config option (the only option using
# intvallist, color, has an initproc superseding this path)
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_INTVALLISTCONV)]} {
set ::g_config_defs(csh_limit) {{} val2 0 s {val1 val2} {10 20}}
report [getConf csh_limit]
}

# specific tests to improve getModuleDesignation procs coverage
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_GETMODULEDESIGNATION)]} {
# test disabled sgr mode
Expand Down
2 changes: 1 addition & 1 deletion testsuite/id
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# fake id output

echo "uid=1000(user) gid=1000(user) groups=1000(user),10(wheel),135(mock)"
echo "uid=1000(user) gid=1000(user) groups=1000(user),10(wheel),135(mock) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023"
exit 0
4 changes: 4 additions & 0 deletions testsuite/modulefiles.4/autosym10/.modulerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#%Module
module-version /2 latest
module-forbid autosym10/latest
module-hide --hard autosym10/latest
2 changes: 2 additions & 0 deletions testsuite/modulefiles.4/autosym10/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
module-whatis [module-info name]
2 changes: 2 additions & 0 deletions testsuite/modulefiles.4/autosym10/2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
module-whatis [module-info name]
3 changes: 3 additions & 0 deletions testsuite/modulefiles.4/loc_edm1/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#%Module

module-version ./1.0.1 default
2 changes: 2 additions & 0 deletions testsuite/modulefiles.4/loc_edm1/1.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
module-whatis loc_edm1/1.0.1
2 changes: 2 additions & 0 deletions testsuite/modulefiles.4/loc_edm1/1.0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
module-whatis loc_edm1/1.0.2
3 changes: 3 additions & 0 deletions testsuite/modulefiles.4/warn/.modulerc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ if {[info exists env(TESTSUITE_WARN)]} {
rc_bad4 {
module-warn --message text --unk warn/1
}
rc_bad5 {
module-warn --message
}
user1 {
module-warn --message text --user [module-info username] warn/1
}
Expand Down
3 changes: 3 additions & 0 deletions testsuite/modulefiles.4/warn/1
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ if {[info exists env(TESTSUITE_WARN)]} {
mf_bad4 {
module-warn --message text --unk warn/1
}
mf_bad5 {
module-warn --message
}
}
}
51 changes: 50 additions & 1 deletion testsuite/modules.00-init/120-siteconfig.exp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,55 @@ lappend ans $vers_reportre
testouterr_cmd_re sh -V OK [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFONTHEFLYPROCS

# test redefinition of defineGetEqArrayKeyProc: the same implicit_default
# value called twice in a row is a no-op (the currently active variant
# already matches), then a different value each time demonstrates renaming
# the previously active variant back before renaming the new one in
setenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFGETEQARRAYKEYPROC 1
set ans [list]
lappend ans foo/1.0 foo/1.0 foo/1.0 foo/1.0
lappend ans $vers_reportre
testouterr_cmd_re sh -V OK [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFGETEQARRAYKEYPROC

# test getMatchingTagList's "tag already seen earlier in this same call"
# skip path, forced through a duplicate tag entry directly in the global tag
# structures since normal module-tag usage always dedupes by tag name
setenv_var TESTSUITE_ENABLE_SITECONFIG_DUPTAGROOT 1
set ans [list]
lappend ans sometag
lappend ans $vers_reportre
testouterr_cmd_re sh -V OK [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_DUPTAGROOT

# test getAvailListFromVersSpec's unregistered-modarg path, not reachable
# through its only real caller since every modarg reaching it there is
# already registered through parseModuleSpecification
setenv_var TESTSUITE_ENABLE_SITECONFIG_AVAILLISTUNREG 1
set ans [list]
lappend ans 0
lappend ans $vers_reportre
testouterr_cmd_re sh -V OK [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_AVAILLISTUNREG

# test the single-element validvallist "string is" class check path in
# getConf, not exercised by any current config option's own shape
setenv_var TESTSUITE_ENABLE_SITECONFIG_VALIDVALLISTSTRINGIS 1
set ans [list]
lappend ans 42
lappend ans $vers_reportre
testouterr_cmd_re sh -V OK [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_VALIDVALLISTSTRINGIS

# test the generic intvallist conversion path in getConf when no initproc is
# set, not exercised by any current config option's own shape
setenv_var TESTSUITE_ENABLE_SITECONFIG_INTVALLISTCONV 1
set ans [list]
lappend ans 20
lappend ans $vers_reportre
testouterr_cmd_re sh -V OK [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_INTVALLISTCONV

# specific tests to improve formatErrStackTrace proc coverage
setenv_var TESTSUITE_ENABLE_SITECONFIG_FORMATERRSTACKTRACE 1
set ans [list]
Expand Down Expand Up @@ -716,7 +765,7 @@ lappend ans { "displaySeparatorLine $header $sgrkey $extra"}
lappend ans { (procedure "displayElementList" line 19)}
lappend ans { invoked from within}
lappend ans { "displayElementList $header $hsgrkey $hstyle $one_per_line $show_idx 1 $display_list $len_list $via_list"}
lappend ans { (procedure "reportModules" line 151)}
lappend ans { (procedure "reportModules" line 148)}
lappend ans { invoked from within}
lappend ans { "reportModules $args $dir mp $hstyle $show_mtime 0 $one_per_line $theader_cols hidden-loaded"}
lappend ans { (procedure "cmdModuleAvail" line 43)}
Expand Down
8 changes: 8 additions & 0 deletions testsuite/modules.00-init/140-color.exp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ if {$install_color eq {y}} {
color_test_case {} 0 $sgr
}

#
# ensure Modules-specific color config env var override and its internal
# representation conversion get exercised regardless of quick test mode
#
setenv_var MODULES_COLOR always
color_test_case {} 2 $sgr
unsetenv_var MODULES_COLOR

skip_if_quick_mode

# environment variable or/and command-line switch override
Expand Down
2 changes: 2 additions & 0 deletions testsuite/modules.20-locate/140-hide-full-path.exp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ set tserr "$modlin Aliases $modlin
tag/1.1.al -> tag/1.0

$modlin Versions $modlin
loc_edm1/default -> loc_edm1/1.0.1
loc_fdv2/default -> loc_fdv2/1.2
tag/1.1.sym -> tag/1.0"

Expand Down Expand Up @@ -168,6 +169,7 @@ set tserr "$modlin Aliases $modlin
tag/1.1.al -> tag/1.0

$modlin Versions $modlin
loc_edm1/default -> loc_edm1/1.0.1
loc_fdv2/default -> loc_fdv2/1.2
tag/1.1.sym -> tag/1.0"

Expand Down
Loading
Loading