mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
Rolled in the fix by Tyson Whitehead for the "module swap" with the
--delim option
This commit is contained in:
2
.cvsignore → .gitignore
vendored
2
.cvsignore → .gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
*.o
|
||||
.deps
|
||||
.spec
|
||||
po
|
||||
ABOUT-NLS
|
||||
Makefile
|
||||
Makefile.in
|
||||
12
NEWS
12
NEWS
@@ -37,6 +37,9 @@ modules 3.3.0
|
||||
* Fixed unload & load of same module problem.
|
||||
|
||||
**************************** Release 3.2 ******************************
|
||||
Modules 3.2.10
|
||||
* Fix the module swap with the --delim option (Tyson Whitehead)
|
||||
|
||||
Modules 3.2.9
|
||||
Nov 11, 2011 R.K. Owen (rk@owen.sj.ca.us)
|
||||
* Fix the coexistence of load/remove flags (Martin Siegert)
|
||||
@@ -46,7 +49,7 @@ Nov 11, 2011 R.K. Owen (rk@owen.sj.ca.us)
|
||||
* Crucial bug fix of same by (Orion Poplawski).
|
||||
* Fixed the "module purge" memory corruption (Poor Yorick)
|
||||
* Added support for Ruby (Tammo Tjarks)
|
||||
|
||||
* Fix the flags with regards to recursive load/unload
|
||||
|
||||
Modules 3.2.8
|
||||
Oct 1, 2010 R.K. Owen (rk@owen.sj.ca.us)
|
||||
@@ -89,14 +92,21 @@ Jul 30, 2009 R.K. Owen (rk@owen.sj.ca.us)
|
||||
- simplify (t)csh initialisation
|
||||
- Add bash auto-completion for the 'module' command
|
||||
- Adds new 'chdir' modulefile command (sets cwd on module load)
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
* versions a & b fixed some bugs
|
||||
>>>>>>> 8c6e4e6626f06f4b369de95e37046ed0579adbf7
|
||||
|
||||
Modules 3.2.6
|
||||
Oct 29, 2007 R.K. Owen (rk@owen.sj.ca.us)
|
||||
* Fixed the locate_module.c:realloc() calls which didn't properly
|
||||
take the element size into account (Fix thanks to Ron Isaacson).
|
||||
<<<<<<< HEAD
|
||||
* Fixed some valgrind errors found and resolved by Alan Morris.
|
||||
* Skip .git version control dirs in modulefile dirs.
|
||||
|
||||
=======
|
||||
>>>>>>> 8c6e4e6626f06f4b369de95e37046ed0579adbf7
|
||||
Modules 3.2.5
|
||||
Feb 14, 2007 R.K. Owen (rk@owen.sj.ca.us)
|
||||
* Wrapped all malloc() calls to make sure the size is never 0.
|
||||
|
||||
3
TODO
3
TODO
@@ -15,3 +15,6 @@ THINGS TODO
|
||||
|
||||
* Add RPM distribution creation to Makefile.
|
||||
|
||||
* fix order that and scope of .modulerc files are read in.
|
||||
|
||||
* fix the module-alias command.
|
||||
|
||||
12
cmdPath.c
12
cmdPath.c
@@ -415,12 +415,6 @@ int cmdRemovePath(
|
||||
if (!strncmp(Tcl_GetString(objv[0]), "pre", 3))
|
||||
sw_marker = PRE_SW_MARKER;
|
||||
|
||||
/**
|
||||
** For switch state3, we're looking to remove the markers.
|
||||
**/
|
||||
if (g_flags & M_SWSTATE3)
|
||||
Tcl_SetStringObj(objv[arg1 + 1], sw_marker, -1);
|
||||
|
||||
/**
|
||||
** Check for the delimiter option
|
||||
**/
|
||||
@@ -438,6 +432,12 @@ int cmdRemovePath(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
** For switch state3, we're looking to remove the markers.
|
||||
**/
|
||||
if (g_flags & M_SWSTATE3)
|
||||
Tcl_SetStringObj(objv[arg1 + 1], sw_marker, -1);
|
||||
|
||||
/**
|
||||
** Split the path into its components so each item can be removed
|
||||
** individually from the variable.
|
||||
|
||||
0
config/.cvsignore → config/.gitignore
vendored
0
config/.cvsignore → config/.gitignore
vendored
1
doc/.cvsignore → doc/.gitignore
vendored
1
doc/.cvsignore → doc/.gitignore
vendored
@@ -3,3 +3,4 @@ Makefile.in
|
||||
site.exp
|
||||
module.1
|
||||
modulefile.4
|
||||
*.html
|
||||
0
etc/.cvsignore → etc/.gitignore
vendored
0
etc/.cvsignore → etc/.gitignore
vendored
0
ext/.cvsignore → ext/.gitignore
vendored
0
ext/.cvsignore → ext/.gitignore
vendored
0
init/.cvsignore → init/.gitignore
vendored
0
init/.cvsignore → init/.gitignore
vendored
25
testsuite/modulefiles/append/1.1
Normal file
25
testsuite/modulefiles/append/1.1
Normal file
@@ -0,0 +1,25 @@
|
||||
#%Module1.0
|
||||
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: prepend/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2006/06/01
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: Testuite modulefile
|
||||
# Command:
|
||||
# Sub-Command: append-path --d { }
|
||||
#
|
||||
# Invocation: load @M@/@V@
|
||||
# Comment: %C{
|
||||
# Check prepending using a different delimiter
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
append-path -d { } testsuite {http://foobar.us}
|
||||
25
testsuite/modulefiles/prepend/1.1
Normal file
25
testsuite/modulefiles/prepend/1.1
Normal file
@@ -0,0 +1,25 @@
|
||||
#%Module1.0
|
||||
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: prepend/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2006/06/01
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: Testuite modulefile
|
||||
# Command:
|
||||
# Sub-Command: prepend-path --delim { }
|
||||
#
|
||||
# Invocation: load @M@/@V@
|
||||
# Comment: %C{
|
||||
# Check prepending using a different delimiter
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
prepend-path --delim { } testsuite {http://foobar.us}
|
||||
30
testsuite/modulefiles/recurs/modA
Normal file
30
testsuite/modulefiles/recurs/modA
Normal file
@@ -0,0 +1,30 @@
|
||||
#%Module1.0
|
||||
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: recurs/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/05/17
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K.Owen
|
||||
#
|
||||
# Description: Testuite modulefile
|
||||
# Command:
|
||||
#
|
||||
# Invocation:
|
||||
# Result: %R{
|
||||
# }R%
|
||||
# Comment: %C{
|
||||
# tests recursive loading/unloading
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
conflict modA
|
||||
puts stderr [ concat "modA " [module-info mode]]
|
||||
setenv MODA_LOADED 1
|
||||
module load recurs/modB
|
||||
|
||||
28
testsuite/modulefiles/recurs/modB
Normal file
28
testsuite/modulefiles/recurs/modB
Normal file
@@ -0,0 +1,28 @@
|
||||
#%Module1.0
|
||||
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: recurs/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/05/17
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K.Owen
|
||||
#
|
||||
# Description: Testuite modulefile
|
||||
# Command:
|
||||
#
|
||||
# Invocation:
|
||||
# Result: %R{
|
||||
# }R%
|
||||
# Comment: %C{
|
||||
# tests recursive loading/unloading
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
puts stderr [ concat "modB " [module-info mode]]
|
||||
setenv MODB_LOADED 1
|
||||
|
||||
@@ -56,7 +56,7 @@ set lin_help "\n----------- Module Specific Help for '$module' -----------------
|
||||
#
|
||||
|
||||
# test loading
|
||||
test_cmd "sh" "load $module" "32\n$lm_sh_ld$lmf_sh_ld"
|
||||
test_cmd "sh" "load $module" "32800\n$lm_sh_ld$lmf_sh_ld"
|
||||
|
||||
# test displaying
|
||||
testouterr_cmd "sh" "display $module" "2" "$modlin$modulefile:\n\n$modlin"
|
||||
@@ -66,7 +66,7 @@ set env(_LMFILES_) "$modulefile"
|
||||
set env(LOADEDMODULES) "$module"
|
||||
|
||||
# test unloading
|
||||
test_cmd "sh" "unload $module" "1\n$lm_sh_rm$lmf_sh_rm"
|
||||
test_cmd "sh" "unload $module" "32769\n$lm_sh_rm$lmf_sh_rm"
|
||||
|
||||
# test switching
|
||||
test_cmd "sh" "switch $module $module2" "$switches$lm_sh_sw$lmf_sh_sw"
|
||||
|
||||
110
testsuite/modules.50-cmds/172-swap-app-delim.exp
Normal file
110
testsuite/modules.50-cmds/172-swap-app-delim.exp
Normal file
@@ -0,0 +1,110 @@
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: modules.50-cmds/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/10/29
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: Testuite testsequence
|
||||
# Command: load
|
||||
# Modulefiles: append/1.0 append/1.1
|
||||
# Sub-Command:
|
||||
#
|
||||
# Comment: %C{
|
||||
# Tests the 'append-path' module subcommand with
|
||||
# an arbitrary delimiter and a module swap
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#
|
||||
# Variables. This test forces a module load command. It will result in the
|
||||
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
|
||||
# be set up
|
||||
#
|
||||
|
||||
set ts_1 "http://foobar.org"
|
||||
set ts_2 "http://foobar.net"
|
||||
set ts_3 "http://foobar.com"
|
||||
set ts_4 "http://foobar.us"
|
||||
set ts_new "$ts_1\\ $ts_2\\ $ts_4"
|
||||
set ts_perl "$ts_1 $ts_2 $ts_4"
|
||||
set env(testsuite) "$ts_1 $ts_2 $ts_3"
|
||||
set module "append/1.0"
|
||||
set module_new "append/1.1"
|
||||
set modulefile "$env(MODULEPATH)/$module"
|
||||
set modulefile_new "$env(MODULEPATH)/$module_new"
|
||||
|
||||
set env(_LMFILES_) "$modulefile"
|
||||
set env(LOADEDMODULES) "$module"
|
||||
|
||||
#
|
||||
# For the different shells ...
|
||||
#
|
||||
|
||||
set lmf_sh "_LMFILES_=$modulefile_new ;export _LMFILES_;"
|
||||
set lm_sh "LOADEDMODULES=$module_new ;export LOADEDMODULES;"
|
||||
set ts_sh "testsuite=$ts_new ;export testsuite;"
|
||||
|
||||
set lmf_csh "setenv _LMFILES_ $modulefile_new ;"
|
||||
set lm_csh "setenv LOADEDMODULES $module_new ;"
|
||||
set ts_csh "setenv testsuite $ts_new ;"
|
||||
|
||||
set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile_new';"
|
||||
set lm_perl "\$ENV{'LOADEDMODULES'} = '$module_new';"
|
||||
set ts_perl "\$ENV{'testsuite'} = '$ts_perl';"
|
||||
|
||||
set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile_new\")"
|
||||
set lm_cmake "set(ENV{LOADEDMODULES} \"$module_new\")"
|
||||
set ts_cmake "set(ENV{testsuite} \"$ts_1 $ts_2 $ts_4\")"
|
||||
|
||||
#
|
||||
# The tests
|
||||
#
|
||||
|
||||
test_cmd "sh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "ksh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "zsh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "csh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "tcsh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "perl" "swap $module_new" "$lm_perl$lmf_perl$ts_perl"
|
||||
test_cmd "cmake" "swap $module_new" "$lm_cmake\n$lmf_cmake\n$ts_cmake"
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
unset env(testsuite)
|
||||
unset env(_LMFILES_)
|
||||
unset env(LOADEDMODULES)
|
||||
|
||||
unset ts_new
|
||||
unset ts_4
|
||||
unset ts_3
|
||||
unset ts_2
|
||||
unset ts_1
|
||||
|
||||
unset ts_sh
|
||||
unset lm_sh
|
||||
unset lmf_sh
|
||||
|
||||
unset ts_csh
|
||||
unset lm_csh
|
||||
unset lmf_csh
|
||||
|
||||
unset ts_perl
|
||||
unset lm_perl
|
||||
unset lmf_perl
|
||||
|
||||
unset ts_cmake
|
||||
unset lm_cmake
|
||||
unset lmf_cmake
|
||||
|
||||
unset modulefile
|
||||
unset module
|
||||
unset modulefile_new
|
||||
unset module_new
|
||||
111
testsuite/modules.50-cmds/173-swap-app-delim.exp
Normal file
111
testsuite/modules.50-cmds/173-swap-app-delim.exp
Normal file
@@ -0,0 +1,111 @@
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: modules.50-cmds/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/10/29
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: Testuite testsequence
|
||||
# Command: load
|
||||
# Modulefiles: append/1.0 append/1.1
|
||||
# Sub-Command:
|
||||
#
|
||||
# Comment: %C{
|
||||
# Tests the 'append-path' module subcommand with
|
||||
# an arbitrary delimiter and a module swap
|
||||
# with a mid-path result
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#
|
||||
# Variables. This test forces a module load command. It will result in the
|
||||
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
|
||||
# be set up
|
||||
#
|
||||
|
||||
set ts_1 "http://foobar.org"
|
||||
set ts_2 "http://foobar.net"
|
||||
set ts_3 "http://foobar.com"
|
||||
set ts_4 "http://foobar.us"
|
||||
set ts_new "$ts_1\\ $ts_4\\ $ts_2"
|
||||
set ts_perl "$ts_1 $ts_4 $ts_2"
|
||||
set env(testsuite) "$ts_1 $ts_3 $ts_2"
|
||||
set module "append/1.0"
|
||||
set module_new "append/1.1"
|
||||
set modulefile "$env(MODULEPATH)/$module"
|
||||
set modulefile_new "$env(MODULEPATH)/$module_new"
|
||||
|
||||
set env(_LMFILES_) "$modulefile"
|
||||
set env(LOADEDMODULES) "$module"
|
||||
|
||||
#
|
||||
# For the different shells ...
|
||||
#
|
||||
|
||||
set lmf_sh "_LMFILES_=$modulefile_new ;export _LMFILES_;"
|
||||
set lm_sh "LOADEDMODULES=$module_new ;export LOADEDMODULES;"
|
||||
set ts_sh "testsuite=$ts_new ;export testsuite;"
|
||||
|
||||
set lmf_csh "setenv _LMFILES_ $modulefile_new ;"
|
||||
set lm_csh "setenv LOADEDMODULES $module_new ;"
|
||||
set ts_csh "setenv testsuite $ts_new ;"
|
||||
|
||||
set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile_new';"
|
||||
set lm_perl "\$ENV{'LOADEDMODULES'} = '$module_new';"
|
||||
set ts_perl "\$ENV{'testsuite'} = '$ts_perl';"
|
||||
|
||||
set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile_new\")"
|
||||
set lm_cmake "set(ENV{LOADEDMODULES} \"$module_new\")"
|
||||
set ts_cmake "set(ENV{testsuite} \"$ts_1 $ts_4 $ts_2\")"
|
||||
|
||||
#
|
||||
# The tests
|
||||
#
|
||||
|
||||
test_cmd "sh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "ksh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "zsh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "csh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "tcsh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "perl" "swap $module_new" "$lm_perl$lmf_perl$ts_perl"
|
||||
test_cmd "cmake" "swap $module_new" "$lm_cmake\n$lmf_cmake\n$ts_cmake"
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
unset env(testsuite)
|
||||
unset env(_LMFILES_)
|
||||
unset env(LOADEDMODULES)
|
||||
|
||||
unset ts_new
|
||||
unset ts_4
|
||||
unset ts_3
|
||||
unset ts_2
|
||||
unset ts_1
|
||||
|
||||
unset ts_sh
|
||||
unset lm_sh
|
||||
unset lmf_sh
|
||||
|
||||
unset ts_csh
|
||||
unset lm_csh
|
||||
unset lmf_csh
|
||||
|
||||
unset ts_perl
|
||||
unset lm_perl
|
||||
unset lmf_perl
|
||||
|
||||
unset ts_cmake
|
||||
unset lm_cmake
|
||||
unset lmf_cmake
|
||||
|
||||
unset modulefile
|
||||
unset module
|
||||
unset modulefile_new
|
||||
unset module_new
|
||||
110
testsuite/modules.50-cmds/177-swap-prep-delim.exp
Normal file
110
testsuite/modules.50-cmds/177-swap-prep-delim.exp
Normal file
@@ -0,0 +1,110 @@
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: modules.50-cmds/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/10/29
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: Testuite testsequence
|
||||
# Command: load
|
||||
# Modulefiles: prepend/1.0 prepend/1.1
|
||||
# Sub-Command:
|
||||
#
|
||||
# Comment: %C{
|
||||
# Tests the 'prepend-path' module subcommand with
|
||||
# an arbitrary delimiter and a module swap
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#
|
||||
# Variables. This test forces a module load command. It will result in the
|
||||
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
|
||||
# be set up
|
||||
#
|
||||
|
||||
set ts_1 "http://foobar.org"
|
||||
set ts_2 "http://foobar.net"
|
||||
set ts_3 "http://foobar.com"
|
||||
set ts_4 "http://foobar.us"
|
||||
set ts_new "$ts_4\\ $ts_1\\ $ts_2"
|
||||
set ts_perl "$ts_4 $ts_1 $ts_2"
|
||||
set env(testsuite) "$ts_3 $ts_1 $ts_2"
|
||||
set module "prepend/1.0"
|
||||
set module_new "prepend/1.1"
|
||||
set modulefile "$env(MODULEPATH)/$module"
|
||||
set modulefile_new "$env(MODULEPATH)/$module_new"
|
||||
|
||||
set env(_LMFILES_) "$modulefile"
|
||||
set env(LOADEDMODULES) "$module"
|
||||
|
||||
#
|
||||
# For the different shells ...
|
||||
#
|
||||
|
||||
set lmf_sh "_LMFILES_=$modulefile_new ;export _LMFILES_;"
|
||||
set lm_sh "LOADEDMODULES=$module_new ;export LOADEDMODULES;"
|
||||
set ts_sh "testsuite=$ts_new ;export testsuite;"
|
||||
|
||||
set lmf_csh "setenv _LMFILES_ $modulefile_new ;"
|
||||
set lm_csh "setenv LOADEDMODULES $module_new ;"
|
||||
set ts_csh "setenv testsuite $ts_new ;"
|
||||
|
||||
set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile_new';"
|
||||
set lm_perl "\$ENV{'LOADEDMODULES'} = '$module_new';"
|
||||
set ts_perl "\$ENV{'testsuite'} = '$ts_perl';"
|
||||
|
||||
set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile_new\")"
|
||||
set lm_cmake "set(ENV{LOADEDMODULES} \"$module_new\")"
|
||||
set ts_cmake "set(ENV{testsuite} \"$ts_4 $ts_1 $ts_2\")"
|
||||
|
||||
#
|
||||
# The tests
|
||||
#
|
||||
|
||||
test_cmd "sh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "ksh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "zsh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "csh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "tcsh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "perl" "swap $module_new" "$lm_perl$lmf_perl$ts_perl"
|
||||
test_cmd "cmake" "swap $module_new" "$lm_cmake\n$lmf_cmake\n$ts_cmake"
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
unset env(testsuite)
|
||||
unset env(_LMFILES_)
|
||||
unset env(LOADEDMODULES)
|
||||
|
||||
unset ts_new
|
||||
unset ts_4
|
||||
unset ts_3
|
||||
unset ts_2
|
||||
unset ts_1
|
||||
|
||||
unset ts_sh
|
||||
unset lm_sh
|
||||
unset lmf_sh
|
||||
|
||||
unset ts_csh
|
||||
unset lm_csh
|
||||
unset lmf_csh
|
||||
|
||||
unset ts_perl
|
||||
unset lm_perl
|
||||
unset lmf_perl
|
||||
|
||||
unset ts_cmake
|
||||
unset lm_cmake
|
||||
unset lmf_cmake
|
||||
|
||||
unset modulefile
|
||||
unset module
|
||||
unset modulefile_new
|
||||
unset module_new
|
||||
111
testsuite/modules.50-cmds/178-swap-prep-delim.exp
Normal file
111
testsuite/modules.50-cmds/178-swap-prep-delim.exp
Normal file
@@ -0,0 +1,111 @@
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: modules.50-cmds/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/10/29
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: Testuite testsequence
|
||||
# Command: load
|
||||
# Modulefiles: prepend/1.0 prepend/1.1
|
||||
# Sub-Command:
|
||||
#
|
||||
# Comment: %C{
|
||||
# Tests the 'prepend-path' module subcommand with
|
||||
# an arbitrary delimiter and a module swap
|
||||
# with a mid-path result
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#
|
||||
# Variables. This test forces a module load command. It will result in the
|
||||
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
|
||||
# be set up
|
||||
#
|
||||
|
||||
set ts_1 "http://foobar.org"
|
||||
set ts_2 "http://foobar.net"
|
||||
set ts_3 "http://foobar.com"
|
||||
set ts_4 "http://foobar.us"
|
||||
set ts_new "$ts_1\\ $ts_4\\ $ts_2"
|
||||
set ts_perl "$ts_1 $ts_4 $ts_2"
|
||||
set env(testsuite) "$ts_1 $ts_3 $ts_2"
|
||||
set module "prepend/1.0"
|
||||
set module_new "prepend/1.1"
|
||||
set modulefile "$env(MODULEPATH)/$module"
|
||||
set modulefile_new "$env(MODULEPATH)/$module_new"
|
||||
|
||||
set env(_LMFILES_) "$modulefile"
|
||||
set env(LOADEDMODULES) "$module"
|
||||
|
||||
#
|
||||
# For the different shells ...
|
||||
#
|
||||
|
||||
set lmf_sh "_LMFILES_=$modulefile_new ;export _LMFILES_;"
|
||||
set lm_sh "LOADEDMODULES=$module_new ;export LOADEDMODULES;"
|
||||
set ts_sh "testsuite=$ts_new ;export testsuite;"
|
||||
|
||||
set lmf_csh "setenv _LMFILES_ $modulefile_new ;"
|
||||
set lm_csh "setenv LOADEDMODULES $module_new ;"
|
||||
set ts_csh "setenv testsuite $ts_new ;"
|
||||
|
||||
set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile_new';"
|
||||
set lm_perl "\$ENV{'LOADEDMODULES'} = '$module_new';"
|
||||
set ts_perl "\$ENV{'testsuite'} = '$ts_perl';"
|
||||
|
||||
set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile_new\")"
|
||||
set lm_cmake "set(ENV{LOADEDMODULES} \"$module_new\")"
|
||||
set ts_cmake "set(ENV{testsuite} \"$ts_1 $ts_4 $ts_2\")"
|
||||
|
||||
#
|
||||
# The tests
|
||||
#
|
||||
|
||||
test_cmd "sh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "ksh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "zsh" "swap $module_new" "$lm_sh$lmf_sh$ts_sh"
|
||||
test_cmd "csh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "tcsh" "swap $module_new" "$lm_csh$lmf_csh$ts_csh"
|
||||
test_cmd "perl" "swap $module_new" "$lm_perl$lmf_perl$ts_perl"
|
||||
test_cmd "cmake" "swap $module_new" "$lm_cmake\n$lmf_cmake\n$ts_cmake"
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
unset env(testsuite)
|
||||
unset env(_LMFILES_)
|
||||
unset env(LOADEDMODULES)
|
||||
|
||||
unset ts_new
|
||||
unset ts_4
|
||||
unset ts_3
|
||||
unset ts_2
|
||||
unset ts_1
|
||||
|
||||
unset ts_sh
|
||||
unset lm_sh
|
||||
unset lmf_sh
|
||||
|
||||
unset ts_csh
|
||||
unset lm_csh
|
||||
unset lmf_csh
|
||||
|
||||
unset ts_perl
|
||||
unset lm_perl
|
||||
unset lmf_perl
|
||||
|
||||
unset ts_cmake
|
||||
unset lm_cmake
|
||||
unset lmf_cmake
|
||||
|
||||
unset modulefile
|
||||
unset module
|
||||
unset modulefile_new
|
||||
unset module_new
|
||||
152
testsuite/modules.50-cmds/195-load-recurs.exp
Normal file
152
testsuite/modules.50-cmds/195-load-recurs.exp
Normal file
@@ -0,0 +1,152 @@
|
||||
##############################################################################
|
||||
# Modules Revision 3.0
|
||||
# Providing a flexible user environment
|
||||
#
|
||||
# File: modules.50-cmds/%M%
|
||||
# Revision: %I%
|
||||
# First Edition: 2012/05/17
|
||||
# Last Mod.: %U%, %G%
|
||||
#
|
||||
# Authors: R.K. Owen, <rk@owen.sj.ca.us>
|
||||
#
|
||||
# Description: recursive load/unload test
|
||||
# Command: load
|
||||
# Modulefiles: recurs/modA
|
||||
# recurs/modA
|
||||
# Sub-Command:
|
||||
#
|
||||
# Comment: %C{
|
||||
# Recursive load a modulefile
|
||||
# }C%
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
set modA "recurs/modA"
|
||||
set modB "recurs/modB"
|
||||
|
||||
set modAp "$env(MODULEPATH)/$modA"
|
||||
set modBp "$env(MODULEPATH)/$modB"
|
||||
|
||||
#
|
||||
# set up an empty environment
|
||||
#
|
||||
set module ""
|
||||
set modulefile ""
|
||||
set env(_LMFILES_) "$modulefile"
|
||||
set env(LOADEDMODULES) "$module"
|
||||
|
||||
#
|
||||
# load
|
||||
# For the different shells ...
|
||||
#
|
||||
set module "$modB:$modA"
|
||||
set modulefile "$modBp:$modAp"
|
||||
set moderr "modA load\nmodB load";
|
||||
|
||||
set lmf_sh "_LMFILES_=$modulefile ;export _LMFILES_;"
|
||||
set lm_sh "LOADEDMODULES=$module ;export LOADEDMODULES;"
|
||||
set tsA_sh "MODA_LOADED=1 ;export MODA_LOADED;"
|
||||
set tsB_sh "MODB_LOADED=1 ;export MODB_LOADED;"
|
||||
|
||||
set lmf_csh "setenv _LMFILES_ $modulefile ;"
|
||||
set lm_csh "setenv LOADEDMODULES $module ;"
|
||||
set tsA_csh "setenv MODA_LOADED 1 ;"
|
||||
set tsB_csh "setenv MODB_LOADED 1 ;"
|
||||
|
||||
set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';"
|
||||
set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';"
|
||||
set tsA_perl "\$ENV{'MODA_LOADED'} = '1';"
|
||||
set tsB_perl "\$ENV{'MODB_LOADED'} = '1';"
|
||||
|
||||
set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")"
|
||||
set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")"
|
||||
set tsA_cmake "set(ENV{MODA_LOADED} \"1\")"
|
||||
set tsB_cmake "set(ENV{MODB_LOADED} \"1\")"
|
||||
|
||||
#
|
||||
# The load tests
|
||||
#
|
||||
testouterr_cmd "sh" "load $modA" "$lm_sh$tsA_sh$tsB_sh$lmf_sh" "$moderr"
|
||||
testouterr_cmd "ksh" "load $modA" "$lm_sh$tsA_sh$tsB_sh$lmf_sh" "$moderr"
|
||||
testouterr_cmd "zsh" "load $modA" "$lm_sh$tsA_sh$tsB_sh$lmf_sh" "$moderr"
|
||||
testouterr_cmd "csh" "load $modA" "$lm_csh$tsA_csh$tsB_csh$lmf_csh" "$moderr"
|
||||
testouterr_cmd "tcsh" "load $modA" "$lm_csh$tsA_csh$tsB_csh$lmf_csh" "$moderr"
|
||||
testouterr_cmd "perl" "load $modA" "$lm_perl$tsA_perl$tsB_perl$lmf_perl" "$moderr"
|
||||
testouterr_cmd "cmake" "load $modA" "$lm_cmake\n$tsA_cmake\n$tsB_cmake\n$lmf_cmake" "$moderr"
|
||||
|
||||
#
|
||||
# set-up a loaded environment
|
||||
#
|
||||
set env(_LMFILES_) "/some/path/foobar/1.0:$modulefile"
|
||||
set env(LOADEDMODULES) "foobar/1.0:$module"
|
||||
set module "foobar/1.0"
|
||||
set modulefile "/some/path/foobar/1.0"
|
||||
set moderr "modA remove\nmodB remove";
|
||||
|
||||
set lmf_sh "_LMFILES_=$modulefile ;export _LMFILES_;"
|
||||
set lm_sh "LOADEDMODULES=$module ;export LOADEDMODULES;"
|
||||
set tsA_sh "unset MODA_LOADED;"
|
||||
set tsB_sh "unset MODB_LOADED;"
|
||||
|
||||
set lmf_csh "setenv _LMFILES_ $modulefile ;"
|
||||
set lm_csh "setenv LOADEDMODULES $module ;"
|
||||
set tsA_csh "unsetenv MODA_LOADED;"
|
||||
set tsB_csh "unsetenv MODB_LOADED;"
|
||||
|
||||
set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';"
|
||||
set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';"
|
||||
set tsA_perl "delete \$ENV{'MODA_LOADED'};"
|
||||
set tsB_perl "delete \$ENV{'MODB_LOADED'};"
|
||||
|
||||
set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")"
|
||||
set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")"
|
||||
set tsA_cmake "unset(ENV{MODA_LOADED})"
|
||||
set tsB_cmake "unset(ENV{MODB_LOADED})"
|
||||
|
||||
#
|
||||
# The unload tests
|
||||
#
|
||||
testouterr_cmd "sh" "unload $modA" "$lm_sh$lmf_sh$tsA_sh$tsB_sh" "$moderr"
|
||||
testouterr_cmd "ksh" "unload $modA" "$lm_sh$lmf_sh$tsA_sh$tsB_sh" "$moderr"
|
||||
testouterr_cmd "zsh" "unload $modA" "$lm_sh$lmf_sh$tsA_sh$tsB_sh" "$moderr"
|
||||
testouterr_cmd "csh" "unload $modA" "$lm_csh$lmf_csh$tsA_csh$tsB_csh" "$moderr"
|
||||
testouterr_cmd "tcsh" "unload $modA" "$lm_csh$lmf_csh$tsA_csh$tsB_csh" "$moderr"
|
||||
testouterr_cmd "perl" "unload $modA" "$lm_perl$lmf_perl$tsA_perl$tsB_perl" "$moderr"
|
||||
testouterr_cmd "cmake" "unload $modA" "$lm_cmake\n$lmf_cmake\n$tsA_cmake\n$tsB_cmake" "$moderr"
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
||||
unset env(_LMFILES_)
|
||||
unset env(LOADEDMODULES)
|
||||
unset moderr
|
||||
|
||||
unset lm_sh
|
||||
unset lmf_sh
|
||||
unset tsA_sh
|
||||
unset tsB_sh
|
||||
|
||||
unset lm_csh
|
||||
unset lmf_csh
|
||||
unset tsA_csh
|
||||
unset tsB_csh
|
||||
|
||||
unset lm_perl
|
||||
unset lmf_perl
|
||||
unset tsA_perl
|
||||
unset tsB_perl
|
||||
|
||||
unset lm_cmake
|
||||
unset lmf_cmake
|
||||
unset tsA_cmake
|
||||
unset tsB_cmake
|
||||
|
||||
unset modulefile
|
||||
unset module
|
||||
|
||||
unset modA
|
||||
unset modB
|
||||
unset modAp
|
||||
unset modBp
|
||||
|
||||
Reference in New Issue
Block a user