Skip to content

Commit

Permalink
ts: add test to demonstrate issue envmodules#509 in 50/377
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Sep 10, 2023
1 parent 25f35c6 commit 39c7cdc
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testsuite/modulefiles.deps/vmod1/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
conflict vmod1
2 changes: 2 additions & 0 deletions testsuite/modulefiles.deps/vmod1/2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
conflict vmod1
2 changes: 2 additions & 0 deletions testsuite/modulefiles.deps/vmod2/.modulerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
module-version vmod2/1 default
2 changes: 2 additions & 0 deletions testsuite/modulefiles.deps/vmod2/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
conflict vmod2
3 changes: 3 additions & 0 deletions testsuite/modulefiles.deps/vmod2/2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#%Module
prereq vmod1/2
conflict vmod2
3 changes: 3 additions & 0 deletions testsuite/modulefiles.deps/vmod3/1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#%Module
prereq vmod2/2 vmod2
conflict vmod3
3 changes: 3 additions & 0 deletions testsuite/modulefiles.deps/vmod3/2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#%Module
prereq vmod2/2
conflict vmod3
23 changes: 23 additions & 0 deletions testsuite/modules.50-cmds/377-error.exp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,29 @@ testouterr_cmd_re sh {reload} ERR [join $tserr \n]
testouterr_cmd_re sh {reload --force} ERR [join $tserr \n]


#
# Error message test of failed dependency load, which is solved by the load
# of an alternative requirement (issue #509)
#

unsetenv_var __MODULES_LMTAG
unsetenv_var __MODULES_LMALTNAME
unsetenv_var __MODULES_LMPREREQ
setenv_loaded_module [list vmod1/1] [list $mp/vmod1/1]
setenv_var __MODULES_LMCONFLICT vmod1/1&vmod1

set ans [list]
lappend ans [list set __MODULES_LMALTNAME vmod2/1&vmod2/default&vmod2]
lappend ans [list set __MODULES_LMCONFLICT vmod1/1&vmod1:vmod2/1&vmod2:vmod3/1&vmod3]
lappend ans [list set __MODULES_LMPREREQ vmod3/1&vmod2/2|vmod2]
lappend ans [list set _LMFILES_ $mp/vmod1/1:$mp/vmod2/1:$mp/vmod3/1]
lappend ans [list set LOADEDMODULES vmod1/1:vmod2/1:vmod3/1]
lappend ans [list set __MODULES_LMTAG vmod2/1&auto-loaded]
#FIXME: as requirement is satisfied in the end, there should not be an error
lappend ans [list ERR]
testouterr_cmd sh {load --auto vmod3/1} $ans $tserr


#
# Cleanup
#
Expand Down

0 comments on commit 39c7cdc

Please sign in to comment.