Skip to content

Commit

Permalink
ts: test --glob option on append/prepend-path
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Oct 3, 2023
1 parent 3f4d6f7 commit 0235002
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testsuite/modulefiles.4/append/1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
append-path --glob FOO /tmp*
1 change: 1 addition & 0 deletions testsuite/modulefiles.4/append/2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#%Module
2 changes: 2 additions & 0 deletions testsuite/modulefiles.4/prepend/1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#%Module
prepend-path --glob FOO /tmp*
1 change: 1 addition & 0 deletions testsuite/modulefiles.4/prepend/2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#%Module
16 changes: 16 additions & 0 deletions testsuite/modules.50-cmds/040-append.exp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,22 @@ lappend ans [list unset LOADEDMODULES]
testouterr_cmd "sh" "unload $module" $ans {}


#
# --glob option
#

unsetenv_loaded_module
unsetenv_path_var FOO
setenv_var MODULEPATH $modpath.4

set ans [list]
lappend ans [list set FOO /tmp*]
lappend ans [list set _LMFILES_ $modpath.4/append/1.0]
lappend ans [list set LOADEDMODULES append/1.0]
set tserr [msg_load append/1.0 "$warn_msgs: --glob option has no effect on append-path"]
testouterr_cmd sh {load append/1.0} $ans $tserr


#
# Cleanup
#
Expand Down
16 changes: 16 additions & 0 deletions testsuite/modules.50-cmds/050-prepend.exp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ lappend ans [list set LOADEDMODULES $module]
testouterr_cmd "sh" "load $module" $ans ""


#
# --glob option
#

unsetenv_loaded_module
unsetenv_path_var FOO
setenv_var MODULEPATH $modpath.4

set ans [list]
lappend ans [list set FOO /tmp*]
lappend ans [list set _LMFILES_ $modpath.4/prepend/1.0]
lappend ans [list set LOADEDMODULES prepend/1.0]
set tserr [msg_load prepend/1.0 "$warn_msgs: --glob option has no effect on prepend-path"]
testouterr_cmd sh {load prepend/1.0} $ans $tserr


#
# Cleanup
#
Expand Down
10 changes: 10 additions & 0 deletions testsuite/modules.70-maint/150-append-path.exp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ testouterr_cmd sh {append-path FOO /tmp --prepend-on-unload /tmp} ERR [err_invop
testouterr_cmd sh {append-path FOO /tmp --noop-on-unload /tmp} ERR [err_invopt --noop-on-unload]


#
# test --glob option usage
#

set ans [list]
lappend ans [list set FOO $path1:/tmp*]
set tserr "$warn_msgs: --glob option has no effect on append-path"
testouterr_cmd sh {append-path --glob FOO /tmp*} $ans $tserr


#
# Cleanup
#
Expand Down
13 changes: 13 additions & 0 deletions testsuite/modules.70-maint/151-prepend-path.exp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ testouterr_cmd sh {prepend-path FOO --prepend-on-unload /tmp} ERR [err_invopt --
testouterr_cmd sh {prepend-path FOO --noop-on-unload /tmp} ERR [err_invopt --noop-on-unload]


#
# test --glob option usage
#

setenv_var FOO $path1
unsetenv_var __MODULES_SHARE_FOO

set ans [list]
lappend ans [list set FOO /tmp*:$path1]
set tserr "$warn_msgs: --glob option has no effect on prepend-path"
testouterr_cmd sh {prepend-path --glob FOO /tmp*} $ans $tserr


#
# Cleanup
#
Expand Down

0 comments on commit 0235002

Please sign in to comment.