Skip to content

Commit

Permalink
ts: remove adv vers spec deactivation for full path tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Jun 13, 2024
1 parent 14a6835 commit 39d3f74
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 141 deletions.
1 change: 0 additions & 1 deletion testsuite/install.00-init/005-init_ts.exp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ set autoinit_script "$install_libexecdir/modulecmd.tcl"
# where to find modulefiles for test
set contrib_modpath "$env(TESTSUITEDIR)/../contrib/modulefiles"
set testsuite_modpath "$env(TESTSUITEDIR)/modulefiles"
set plus_in_modpath [expr {[string first + $testsuite_modpath] != -1}]

# basic messages
set type_help " Try 'module --help' for more information."
Expand Down
6 changes: 0 additions & 6 deletions testsuite/install.00-init/020-module.exp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ foreach shell $shell_list {

# ensure tools used in complex shell alias definition are available
if {[find_bin grep] ne "" && [find_bin tr] ne "" && [find_bin awk] ne ""} {
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
foreach shell $shell_list {
if {$shell eq {csh} || $shell eq {tcsh}} {
# alias evaluation leads to a syntax error if wa_277 is enabled
Expand All @@ -54,9 +51,6 @@ if {[find_bin grep] ne "" && [find_bin tr] ne "" && [find_bin awk] ne ""} {
testall_cmd_re "$shell" "module load $testsuite_modpath/alias/3.0\; testsuite; ts2" "Release\nhttp://an.example.web\\?&param=one" ".*" 0
}
}
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}
} elseif {$verbose} {
send_user "\tSkipping shell alias definition tests\n"
}
Expand Down
6 changes: 0 additions & 6 deletions testsuite/install.00-init/024-ml.exp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ foreach shell $shell_list {

# ensure tools used in complex shell alias definition are available
if {[find_bin grep] ne "" && [find_bin tr] ne "" && [find_bin awk] ne ""} {
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
foreach shell $shell_list {
if {$shell eq {csh} || $shell eq {tcsh}} {
# alias evaluation leads to a syntax error if wa_277 is enabled
Expand All @@ -57,9 +54,6 @@ if {[find_bin grep] ne "" && [find_bin tr] ne "" && [find_bin awk] ne ""} {
testall_cmd_re "$shell" "ml $testsuite_modpath/alias/3.0\; testsuite; ts2" "Release\nhttp://an.example.web\\?&param=one" ".*" 0
}
}
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}
} elseif {$verbose} {
send_user "\tSkipping shell alias definition tests\n"
}
Expand Down
1 change: 0 additions & 1 deletion testsuite/modules.00-init/050-modpath.exp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
if [info exists env(TESTSUITEDIR)] {
set modpath "$env(TESTSUITEDIR)/modulefiles"
set modpathre [regsub -all "\(\[.+?\]\)" $modpath {\\\1}]
set plus_in_modpath [expr {[string first + $modpath] != -1}]
setenv_path_var MODULEPATH $modpath

set reldmodpath "./[file tail $env(TESTSUITEDIR)]/modulefiles"
Expand Down
6 changes: 0 additions & 6 deletions testsuite/modules.20-locate/140-hide-full-path.exp
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,11 @@ set tserr $err_path'tag/1.1'
testouterr_cmd sh {load -v tag/1.1} ERR $tserr

# full path module is loaded as .modulerc file is not evaluated in this case
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
set ans [list]
lappend ans [list set _LMFILES_ $mp/tag/1.0]
lappend ans [list set LOADEDMODULES $mp/tag/1.0]
set tserr [msg_load $mp/tag/1.0]
testouterr_cmd sh "load -v $mp/tag/1.0" $ans $tserr
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}


# hide virtual module name
Expand Down
8 changes: 0 additions & 8 deletions testsuite/modules.50-cmds/029-setenv-env.exp
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ unsetenv_loaded_module
# test appending variable after defining it with setenv
#

if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}

set module $env(TESTSUITEDIR)/modulefiles.2/setenv/0.1
set ans [list]
lappend ans [list set TS5 s\}ec\"a\{\\ok]
Expand All @@ -168,10 +164,6 @@ lappend ans [list set TS3 okok]
lappend ans [list set TS4 s\}ec\"a\{\\]
testouterr_cmd sh "load $module" $ans {}

if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}


#
# Test setenv command in a simulated Windows OS environment
Expand Down
6 changes: 0 additions & 6 deletions testsuite/modules.50-cmds/180-unload.exp
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,12 @@ lappend ans [list set _LMFILES_ $modulefile_2]
lappend ans [list set LOADEDMODULES $module_2]
lappend ans [list unset testsuite]

if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
# unload modulefile loaded as full pathname
testouterr_cmd "sh" "unload $module_3" $ans ""

# try with other full path name forms (./ and ../)
testouterr_cmd "sh" "unload $module_3_reld" $ans ""
testouterr_cmd "sh" "unload $module_3_reldd" $ans ""
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}


# set up the environment
Expand Down
25 changes: 0 additions & 25 deletions testsuite/modules.50-cmds/190-load.exp
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,11 @@ lappend ans [list set TESTSUITE "1.1"]
#
# The tests
#
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
test_cmd_re "ALL" "load $oth11p" $ans

# try with other full path name forms (./ and ../)
test_cmd_re "sh" "load $oth11pd" $ans
test_cmd_re "sh" "load $oth11pdd" $ans
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

#
# error when loading non existent module
Expand Down Expand Up @@ -235,17 +229,11 @@ unsetenv_var MODULES_IMPLICIT_DEFAULT
}

# try with other full path name forms (./ and ../)
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
set badmod "$reldmodpath/bad/before"
set out_interr [msg_load $modpath/bad/before [msg_moderr "$msg_invcmdname \"bad-command\"" {bad-command} $modpath/bad/before 26]]
testouterr_cmd "sh" "load $badmod" "ERR" $out_interr
set badmod "$relddmodpath/bad/before"
testouterr_cmd "sh" "load $badmod" "ERR" $out_interr
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

#
# test with file given as full path which is not a modulefile
Expand All @@ -266,15 +254,9 @@ testouterr_cmd "sh" "load $badmod" "ERR" $out_interr
#
setenv_loaded_module $module $modulefile

if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
test_cmd_re "ALL" "load $oth11p" "OK"
test_cmd_re "sh" "load $oth11pd" "OK"
test_cmd_re "sh" "load $oth11pdd" "OK"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}


#
Expand All @@ -294,9 +276,6 @@ unsetenv_var MODULES_IMPLICIT_DEFAULT
#
# test to load full path a modulefile already loaded with short name
#
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
setenv_loaded_module $mod11 $mod11p

test_cmd_re "sh" "load $mod11p" "OK"
Expand All @@ -310,10 +289,6 @@ test_cmd_re "sh" "load $mod11p" "OK"
test_cmd_re "sh" "load $mod11pd" "OK"
test_cmd_re "sh" "load $mod11pdd" "OK"

if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}


#
# test module already loaded as full path, try to load again with short name
Expand Down
6 changes: 0 additions & 6 deletions testsuite/modules.50-cmds/321-is-used.exp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ lappend ans [list set testsuite5 0]
lappend ans [list unset MODULEPATH]
lappend ans [list set testsuite1 0]

if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd "sh" "load $modulefile" $ans ""
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# modulerc usage
setenv_var TESTSUITE_INFO isused-rc1
Expand Down
4 changes: 0 additions & 4 deletions testsuite/modules.50-cmds/370-deps-fullpath.exp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ set mpre "$modpathre.deps"
# setup specific environment
setenv_path_var MODULEPATH $mp

if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}


# reflexive conflict
set ans [list]
Expand Down
6 changes: 0 additions & 6 deletions testsuite/modules.50-cmds/372-deps3.exp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ setenv_path_var MODULEPATH $mp
testouterr_cmd "sh" "load mt" "ERR" [msg_load ms [err_conloi mt]]\n\n[msg_load mt [err_reqlo ms]]

# is-loading conflict check with fully qualified modulefile
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd "sh" "load mtf" "ERR" [msg_load $mp/msf [err_conloi mtf]]\n\n[msg_load mtf [err_reqlo $mp/msf]]
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# conflict consistency check
set ans [list]
Expand Down
12 changes: 0 additions & 12 deletions testsuite/modules.50-cmds/441-module-tag-full-path.exp
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,12 @@ set tserr [msg_load {tag/1.0 <barrc:foorc>}]
testouterr_cmd sh {load -v tag/1.0} $ans $tserr

# short name tag is missed when module is loaded as full path name
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
set ans [list]
lappend ans [list set _LMFILES_ $mp/tag/1.0]
lappend ans [list set LOADEDMODULES $mp/tag/1.0]
lappend ans [list set __MODULES_LMTAG $mp/tag/1.0&foorc]
set tserr [msg_load "$mp/tag/1.0 <foorc>"]
testouterr_cmd sh "load -v $mp/tag/1.0" $ans $tserr
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

setenv_var TESTSUITE_FPMOD_TAG rc3

Expand All @@ -384,17 +378,11 @@ set tserr [msg_load {tag/1.0 <bar:foorc>}]
testouterr_cmd sh {load -v tag/1.0} $ans $tserr

# short name tag is missed when module is loaded as full path name
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
set ans [list]
lappend ans [list set _LMFILES_ $modpath.3/tag/1.0]
lappend ans [list set LOADEDMODULES $modpath.3/tag/1.0]
set tserr [msg_load "$modpath.3/tag/1.0"]
testouterr_cmd sh "load -v $modpath.3/tag/1.0" $ans $tserr
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}
setenv_var MODULERCFILE $ORIG_MODULERCFILE


Expand Down
6 changes: 0 additions & 6 deletions testsuite/modules.61-coll/040-restore.exp
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,7 @@ lappend ans [list set _LMFILES_ $c2lmf:$modpath.2/restore]
lappend ans [list set LOADEDMODULES $c2lm:$modpath.2/restore]
lappend ans [list set MODULEPATH $modpath:$modpath.2]

if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re sh "load $modpath.2/restore" $ans "unload coll/a\nload coll/c\nload coll/a\nload coll/b"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}


#
Expand Down
12 changes: 0 additions & 12 deletions testsuite/modules.70-maint/070-display.exp
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,9 @@ testouterr_cmd_re "csh" "di $module_1" "OK" "$out_pat"


# test with module passed as full path
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re "csh" "display $modulefile_1" "OK" "$out_pat"
testouterr_cmd_re "csh" "display $modulefile_1_reld" "OK" "$out_pat"
testouterr_cmd_re "csh" "display $modulefile_1_reldd" "OK" "$out_pat"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# setup MODULEPATH with a trailing slash and an empty dir element
setenv_path_var MODULEPATH {} "$modpath/"
Expand Down Expand Up @@ -235,15 +229,9 @@ testouterr_cmd_re "csh" "display $module_4" "OK" "$out_pat_4"
testouterr_cmd_re "csh" "display $module_5" "ERR" "$out_interr_5"

# test with module passed as full path
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re "csh" "display $modulefile_5" "ERR" "$out_interr_5"
testouterr_cmd_re "csh" "display $modulefile_5_reld" "ERR" "$out_interr_5"
testouterr_cmd_re "csh" "display $modulefile_5_reldd" "ERR" "$out_interr_5"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# test small width terminal
set test_cols 60
Expand Down
12 changes: 0 additions & 12 deletions testsuite/modules.70-maint/080-help.exp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,9 @@ testouterr_cmd_re "sh" "help $module" "OK" "$err_help"
skip_if_quick_mode

# test with module passed as full path
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re "sh" "help $modulefile" "OK" "$err_help"
testouterr_cmd_re "sh" "help $modulefile_reld" "OK" "$err_help"
testouterr_cmd_re "sh" "help $modulefile_reldd" "OK" "$err_help"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# test debug mode
testouterr_cmd_re "sh" "-D help $module" "OK" "$err_debug_help"
Expand All @@ -145,15 +139,9 @@ testouterr_cmd_re "sh" "help $module_2" "ERR" "$out_interr"
# test with erroneous ModulesHelp proc in modulefile
testouterr_cmd_re "sh" "help $module_3" "ERR" "$out_interr_3"
# test with module passed as full path
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re "sh" "help $modulefile_3" "ERR" "$out_interr_3"
testouterr_cmd_re "sh" "help $modulefile_3_reld" "ERR" "$out_interr_3"
testouterr_cmd_re "sh" "help $modulefile_3_reldd" "ERR" "$out_interr_3"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# test on unexistant modulefile
testouterr_cmd "sh" "help $module_4" "ERR" "$out_err_4"
Expand Down
12 changes: 0 additions & 12 deletions testsuite/modules.70-maint/085-test.exp
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,9 @@ testouterr_cmd_re "sh" "test $module" "OK" "$modlin\n$lin_test$modulefile:\n\n$m
skip_if_quick_mode

# test with module passed as full path
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re "sh" "test $modulefile_full" "OK" "$modlin\n$lin_test$modulefile:\n\n$missing_test$modulefile.\n$modlin"
testouterr_cmd_re "sh" "test $modulefile_reld" "OK" "$modlin\n$lin_test$modulefile:\n\n$missing_test$modulefile.\n$modlin"
testouterr_cmd_re "sh" "test $modulefile_reldd" "OK" "$modlin\n$lin_test$modulefile:\n\n$missing_test$modulefile.\n$modlin"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# missing return value
testouterr_cmd_re "sh" "test $module2" "ERR" "$modlin\n$lin_test$modulefile2:\n\nTest_err\n$fail_test\n$modlin"
Expand All @@ -107,15 +101,9 @@ testouterr_cmd_re "sh" "test $module4" "ERR" "$mod4_interr"
# test with erroneous ModulesTest proc in modulefile
testouterr_cmd_re "sh" "test $module5" "ERR" "$modlin\n$lin_test$modulefile5/proc:\n\n$mod5_interr\n$modlin"
# test with module passed as full path
if {$plus_in_modpath && $install_advversspec eq {y}} {
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd_re "sh" "test $modulefile5_full" "ERR" "$modlin\n$lin_test$modulefile5/proc:\n\n$mod5_interr\n$modlin"
testouterr_cmd_re "sh" "test $modulefile5_reld" "ERR" "$modlin\n$lin_test$modulefile5/proc:\n\n$mod5_interr\n$modlin"
testouterr_cmd_re "sh" "test $modulefile5_reldd" "ERR" "$modlin\n$lin_test$modulefile5/proc:\n\n$mod5_interr\n$modlin"
if {$plus_in_modpath && $install_advversspec eq {y}} {
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# test on unexistant modulefile
testouterr_cmd "sh" "test $module6" "ERR" "$mod6_err"
Expand Down
Loading

0 comments on commit 39d3f74

Please sign in to comment.