diff --git a/cmdConflict.c b/cmdConflict.c index 5f691b3e..ff6cca1a 100644 --- a/cmdConflict.c +++ b/cmdConflict.c @@ -28,7 +28,7 @@ ** ** ** ************************************************************************ **/ -static char Id[] = "@(#)$Id: cmdConflict.c,v 1.22 2009/10/15 19:09:16 rkowen Exp $"; +static char Id[] = "@(#)$Id: cmdConflict.c,v 1.23 2010/10/04 22:06:43 rkowen Exp $"; static void *UseId[] = { &UseId, Id }; /** ************************************************************************ **/ @@ -268,6 +268,8 @@ int cmdConflict( for (j = 0; j < numpaths; j++) { modulelist = SortedDirList(ModulePath[j], Tcl_GetString(objv[i]), &nummodules); + if (!modulelist) + continue; /** no list to browse **/ if (modulelist && !uvec_number(modulelist)) { FreeList(&modulelist); continue; /** not browseable **/ diff --git a/doc/module.1.in b/doc/module.1.in index aab082e1..bec85276 100644 --- a/doc/module.1.in +++ b/doc/module.1.in @@ -93,8 +93,8 @@ where is the name of the sourcing shell. The sh, csh, tcsh, bash, ksh, and zsh shells are supported by .B modulecmd. -In addition, python and perl "shells" are supported, which writes -the environment changes to stdout as python or perl code. +In addition, python, perl, and cmake "shells" are supported, which writes +the environment changes to stdout as python, perl, or cmake code. .SS Modulecmd startup .LP diff --git a/init.c b/init.c index b0076fdd..708396f5 100644 --- a/init.c +++ b/init.c @@ -37,7 +37,7 @@ ** ** ** ************************************************************************ **/ -static char Id[] = "@(#)$Id: init.c,v 1.23 2009/10/15 20:32:51 rkowen Exp $"; +static char Id[] = "@(#)$Id: init.c,v 1.24 2010/10/04 22:06:43 rkowen Exp $"; static void *UseId[] = { &UseId, Id }; /** ************************************************************************ **/ @@ -140,6 +140,7 @@ static char *shellprops [][4] = { {"scheme", "scm", NULL, "\n"}, {"guile", "scm", NULL, "\n"}, {"mel", "mel", NULL, ";"}, + {"cmake", "cmake", "cmake", "\n"}, {NULL, NULL, NULL, NULL}, }; diff --git a/init/Makefile.am b/init/Makefile.am index 119c3049..aefbc00d 100644 --- a/init/Makefile.am +++ b/init/Makefile.am @@ -1,7 +1,7 @@ ########################################################################### ## ## File: init/Makefile.am -## Versions: $Id: Makefile.am,v 1.7 2009/09/22 18:59:31 rkowen Exp $ +## Versions: $Id: Makefile.am,v 1.8 2010/10/04 22:06:44 rkowen Exp $ ## Created: 2002/06/14 ## ########################################################################### @@ -9,8 +9,11 @@ AUTOMAKE_OPTIONS=foreign no-installinfo -EXTRA_SCRIPTS= \ - bash bash_completion csh ksh perl python sh tcsh zsh ksh .modulespath +EXTRA_SCRIPTS= \ + sh ksh zsh bash bash_completion \ + csh tcsh \ + perl.pm python.py cmake \ + .modulespath INIT_FILES=${EXTRA_SCRIPTS} diff --git a/init/cmake.in b/init/cmake.in new file mode 100644 index 00000000..64378da3 --- /dev/null +++ b/init/cmake.in @@ -0,0 +1,34 @@ +@VERSIONING@if(NOT ENV{MODULE_VERSION}) +@VERSIONING@ set(ENV{MODULE_VERSION_STACK} "@VERSION@") +@VERSIONING@ set(ENV{MODULE_VERSION} "@VERSION@") +@VERSIONING@else() +@VERSIONING@ set(ENV{MODULE_VERSION_STACK} $ENV{MODULE_VERSION}) +@VERSIONING@endif() + +function(module ARGS) +@VERSIONING@ set(exec_prefix "@BASEPREFIX@/Modules/$ENV{MODULE_VERSION}/bin") + +@NOTVERSIONING@ set(exec_prefix "@bindir@") + + execute_process(COMMAND mktemp -t moduleinit.cmake.XXXXXXXXXXXX + OUTPUT_VARIABLE tempfile_name) + execute_process(COMMAND ${exec_prefix}/modulecmd cmake ${ARGV} + OUTPUT_FILE ${tempfile_name}) + include(${tempfile_name}) +endfunction(module) + +set(ENV{MODULESHOME} "@prefix@") + +if(NOT ENV{MODULEPATH}) + file(STRINGS "$ENV{MODULESHOME}/init/.modulespath" cmi_mp1) + string(REGEX REPLACE ";[ \n]+" ";" cmi_mp2 "${cmi_mp1}") + string(REGEX REPLACE " *#[^;]*;" ";" cmi_mp3 "${cmi_mp2}") + string(REGEX REPLACE " *#[^;]*$" "" cmi_mp4 "${cmi_mp3}") + string(REPLACE ";;" ";" cmi_mp5 "${cmi_mp4}") + string(STRIP "${cmi_mp5}" cmi_mp6) + string(REPLACE ";" ":" ENV{MODULEPATH} "${cmi_mp6}") +endif() + +if(NOT ENV{LOADEDMODULES}) + set(ENV{LOADEDMODULES} "") +endif() diff --git a/init/perl.in b/init/perl.pm.in similarity index 56% rename from init/perl.in rename to init/perl.pm.in index 7ada7c7b..e835af9d 100644 --- a/init/perl.in +++ b/init/perl.pm.in @@ -6,24 +6,24 @@ @VERSIONING@} sub module { - local ($exec_prefix); -@VERSIONING@ $exec_prefix = "@BASEPREFIX@/Modules/".$ENV{"MODULE_VERSION"}; + local ($exec_prefix); +@VERSIONING@ $exec_prefix = "@BASEPREFIX@/Modules/".$ENV{"MODULE_VERSION"}; @VERSIONING@ eval `$exec_prefix/bin/modulecmd perl @_`; -@NOTVERSIONING@ $exec_prefix = "@bindir@"; +@NOTVERSIONING@ $exec_prefix = "@bindir@"; @NOTVERSIONING@ eval `$exec_prefix/modulecmd perl @_`; } $ENV{"MODULESHOME"} = "@prefix@"; if (! defined $ENV{"MODULEPATH"} ) { - open(IN, "$ENV{'MODULESHOME'}/init/.modulespath") || die "cannot open '.modulespath' file: $!\n"; - $ENV{"MODULEPATH"} = join(":", grep(/\S/, map { s/^\s*//g; s/[\s#].*$//g; $_ } )); - close IN; + open(IN, "$ENV{'MODULESHOME'}/init/.modulespath") || die "cannot open '.modulespath' file: $!\n"; + $ENV{"MODULEPATH"} = join(":", grep(/\S/, map { s/^\s*//g; s/[\s#].*$//g; $_ } )); + close IN; } if (! defined $ENV{"LOADEDMODULES"} ) { - $ENV{"LOADEDMODULES"} = ""; + $ENV{"LOADEDMODULES"} = ""; } 1; diff --git a/init/python.in b/init/python.in deleted file mode 100644 index 4199c210..00000000 --- a/init/python.in +++ /dev/null @@ -1,30 +0,0 @@ -import os, sys, string - -@VERSIONING@if not os.environ.has_key('MODULE_VERSION'): -@VERSIONING@ os.environ['MODULE_VERSION_STACK'] = '@VERSION@' -@VERSIONING@ os.environ['MODULE_VERSION'] = '@VERSION@' -@VERSIONING@else: -@VERSIONING@ os.environ['MODULE_VERSION_STACK'] = os.environ['MODULE_VERSION'] -@VERSIONING@os.environ['MODULESHOME'] = '@prefix@' - -if not os.environ.has_key('MODULEPATH'): - os.environ['MODULEPATH'] = os.popen("""sed -n 's/[ #].*$//; /./H; $ { x; s/^\\n//; s/\\n/:/g; p; }' ${MODULESHOME}/init/.modulespath""").readline() - -if not os.environ.has_key('LOADEDMODULES'): - os.environ['LOADEDMODULES'] = ''; - -def module(command, *arguments): -@VERSIONING@ commands = os.popen('@BASEPREFIX@/Modules/%s/bin/modulecmd python %s %s' % (os.environ['MODULE_VERSION'], command, string.join(arguments))).read() -@NOTVERSIONING@ commands = os.popen('@bindir@/modulecmd python %s %s' % (command, string.join(arguments))).read() - exec commands - - ###catch possible changes to PYTHONPATH environment variable - pp = [''] - pythonpath = os.environ['PYTHONPATH'].split(":") - pp.extend(pythonpath) - for p in sys.path: - if (p not in pp) and (p): - pp.append(p) - - sys.path = pp - diff --git a/init/python.py.in b/init/python.py.in new file mode 100644 index 00000000..dbdeb09a --- /dev/null +++ b/init/python.py.in @@ -0,0 +1,31 @@ +import os, re, subprocess + +@VERSIONING@if not os.environ.has_key('MODULE_VERSION'): +@VERSIONING@ os.environ['MODULE_VERSION_STACK'] = '@VERSION@' +@VERSIONING@ os.environ['MODULE_VERSION'] = '@VERSION@' +@VERSIONING@else: +@VERSIONING@ os.environ['MODULE_VERSION_STACK'] = os.environ['MODULE_VERSION'] +@VERSIONING@os.environ['MODULESHOME'] = '@prefix@' + +if not os.environ.has_key('MODULEPATH'): + f = open(os.environ['MODULESHOME'] + "/init/.modulespath", "r") + path = [] + for line in f.readlines(): + line = re.sub("#.*$", '', line) + if line is not '': + path.append(line) + os.environ['MODULEPATH'] = ':'.join(path) + +if not os.environ.has_key('LOADEDMODULES'): + os.environ['LOADEDMODULES'] = '' + +def module(*args): + if type(args[0]) == type([]): + args = args[0] + else: + args = list(args) +@VERSIONING@ (output, error) = subprocess.Popen(['@BASEPREFIX@/Modules/%s/bin/modulecmd' % os.environ['MODULE_VERSION'], 'python'] + +@NOTVERSIONING@ (output, error) = subprocess.Popen(['@bindir@/modulecmd', 'python'] + + args, stdout=subprocess.PIPE).communicate() + exec output + diff --git a/testsuite/modulefiles/info/shellsexp b/testsuite/modulefiles/info/shellsexp index 612014a8..6dbdec3c 100644 --- a/testsuite/modulefiles/info/shellsexp +++ b/testsuite/modulefiles/info/shellsexp @@ -56,6 +56,8 @@ if { [module-info shell sh] } { set sh "tcsh" } elseif { [module-info shell perl] } { set sh "perl" +} elseif { [module-info shell cmake] } { + set sh "cmake" } else { set sh "unknown" } @@ -73,6 +75,8 @@ if { [module-info shelltype sh] } { set sht "csh" } elseif { [module-info shelltype perl] } { set sht "perl" +} elseif { [module-info shelltype cmake] } { + set sht "cmake" } else { set sht "unknown" } diff --git a/testsuite/modules.00-init/030-shells.exp b/testsuite/modules.00-init/030-shells.exp index 136042e4..3a2322f7 100644 --- a/testsuite/modules.00-init/030-shells.exp +++ b/testsuite/modules.00-init/030-shells.exp @@ -44,6 +44,7 @@ testerr_cmd_re "zsh" "avail" $mod_path testerr_cmd_re "csh" "avail" $mod_path testerr_cmd_re "tcsh" "avail" $mod_path testerr_cmd_re "perl" "avail" $mod_path +testerr_cmd_re "cmake" "avail" $mod_path testerr_cmd_re "abc" "avail" $bad_shell # diff --git a/testsuite/modules.00-init/080-begenv.exp b/testsuite/modules.00-init/080-begenv.exp index 83a5efb8..e1571031 100644 --- a/testsuite/modules.00-init/080-begenv.exp +++ b/testsuite/modules.00-init/080-begenv.exp @@ -48,6 +48,8 @@ testouterr_cmd "tcsh" "--long list" \ "setenv _MODULESBEGINENV_ $beg_env ;" "$not_load" testouterr_cmd "perl" "--long list" \ "\$ENV{'_MODULESBEGINENV_'} = '$beg_env';" "$not_load" +testouterr_cmd "cmake" "--long list" \ + "set(ENV{_MODULESBEGINENV_} \"$beg_env\")\n" "$not_load" } elseif { [ version_test "BEGINENV=99" ] } { testerr_cmd_re "sh" "update" \ ".*Invalid update subcommand - No MODULESBEGINENV.*" @@ -67,6 +69,8 @@ testouterr_cmd "tcsh" "--long list" \ "setenv _MODULESBEGINENV_ $beg_envx ;" "$not_load" testouterr_cmd "perl" "--long list" \ "\$ENV{'_MODULESBEGINENV_'} = '$beg_envx';" "$not_load" +testouterr_cmd "cmake" "--long list" \ + "set(ENV{_MODULESBEGINENV_} \"$beg_envx\")" "$not_load" } else { send_user "skipping .modulesbeginenv tests\n" } diff --git a/testsuite/modules.10-use/030-use.exp b/testsuite/modules.10-use/030-use.exp index e729de80..2b133ffb 100644 --- a/testsuite/modules.10-use/030-use.exp +++ b/testsuite/modules.10-use/030-use.exp @@ -42,6 +42,7 @@ test_cmd "zsh" "$use $path" "MODULEPATH=$mod_path ;export MODULEPATH;" test_cmd "csh" "$use $path" "setenv MODULEPATH $mod_path ;" test_cmd "tcsh" "$use $path" "setenv MODULEPATH $mod_path ;" test_cmd "perl" "$use $path" "\$ENV{'MODULEPATH'} = '$mod_path';" +test_cmd "cmake" "$use $path" "set(ENV{MODULEPATH} \"$mod_path\")" # # test if use non-existent modulefile directory @@ -53,6 +54,7 @@ testerr_cmd_re "zsh" "$use $badpath" "$bad_use" testerr_cmd_re "csh" "$use $badpath" "$bad_use" testerr_cmd_re "tcsh" "$use $badpath" "$bad_use" testerr_cmd_re "perl" "$use $badpath" "$bad_use" +testerr_cmd_re "cmake" "$use $badpath" "$bad_use" # # Cleanup diff --git a/testsuite/modules.10-use/031-append.exp b/testsuite/modules.10-use/031-append.exp index b8497caa..7d43a70b 100644 --- a/testsuite/modules.10-use/031-append.exp +++ b/testsuite/modules.10-use/031-append.exp @@ -41,6 +41,7 @@ test_cmd "zsh" "$use $path" "MODULEPATH=$mod_path ;export MODULEPATH;" test_cmd "csh" "$use $path" "setenv MODULEPATH $mod_path ;" test_cmd "tcsh" "$use $path" "setenv MODULEPATH $mod_path ;" test_cmd "perl" "$use $path" "\$ENV{'MODULEPATH'} = '$mod_path';" +test_cmd "cmake" "$use $path" "set(ENV{MODULEPATH} \"$mod_path\")" # # test if use non-existent modulefile directory @@ -52,6 +53,7 @@ testerr_cmd_re "zsh" "$use $badpath" "$bad_use" testerr_cmd_re "csh" "$use $badpath" "$bad_use" testerr_cmd_re "tcsh" "$use $badpath" "$bad_use" testerr_cmd_re "perl" "$use $badpath" "$bad_use" +testerr_cmd_re "cmake" "$use $badpath" "$bad_use" # # Cleanup diff --git a/testsuite/modules.10-use/070-unuse.exp b/testsuite/modules.10-use/070-unuse.exp index 5b09babd..f36429cb 100644 --- a/testsuite/modules.10-use/070-unuse.exp +++ b/testsuite/modules.10-use/070-unuse.exp @@ -52,6 +52,7 @@ testerr_cmd "zsh" "$use $badpath" "$bad_use" testerr_cmd "csh" "$use $badpath" "$bad_use" testerr_cmd "tcsh" "$use $badpath" "$bad_use" testerr_cmd "perl" "$use $badpath" "$bad_use" +testerr_cmd "cmake" "$use $badpath" "$bad_use" # # The tests ... @@ -64,6 +65,7 @@ test_cmd "zsh" "$use $path" "MODULEPATH=$mod_path ;export MODULEPATH;" test_cmd "csh" "$use $path" "setenv MODULEPATH $mod_path ;" test_cmd "tcsh" "$use $path" "setenv MODULEPATH $mod_path ;" test_cmd "perl" "$use $path" "\$ENV{'MODULEPATH'} = '$mod_path';" +test_cmd "cmake" "$use $path" "set(ENV{MODULEPATH} \"$mod_path\")" # # Cleanup # diff --git a/testsuite/modules.50-cmds/015-use.exp b/testsuite/modules.50-cmds/015-use.exp index 605eeadd..db85a1e7 100644 --- a/testsuite/modules.50-cmds/015-use.exp +++ b/testsuite/modules.50-cmds/015-use.exp @@ -54,6 +54,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile1';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module1';" set mp_perl "\$ENV{'MODULEPATH'} = '$path2:$path1';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile1\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module1\")" +set mp_cmake "set(ENV{MODULEPATH} \"$path2:$path1\")" + # # The tests (use) # @@ -64,6 +68,7 @@ test_cmd "zsh" "load $module1" "$lm_sh$mp_sh$lmf_sh" test_cmd "csh" "load $module1" "$lm_csh$mp_csh$lmf_csh" test_cmd "tcsh" "load $module1" "$lm_csh$mp_csh$lmf_csh" test_cmd "perl" "load $module1" "$lm_perl$mp_perl$lmf_perl" +test_cmd "cmake" "load $module1" "$lm_cmake\n$mp_cmake\n$lmf_cmake" # # For the different shells ... @@ -81,6 +86,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile2';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module2';" set mp_perl "\$ENV{'MODULEPATH'} = '$path1:$path2';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile2\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module2\")" +set mp_cmake "set(ENV{MODULEPATH} \"$path1:$path2\")" + # # The tests (use --append) # @@ -91,6 +100,7 @@ test_cmd "zsh" "load $module2" "$lm_sh$mp_sh$lmf_sh" test_cmd "csh" "load $module2" "$lm_csh$mp_csh$lmf_csh" test_cmd "tcsh" "load $module2" "$lm_csh$mp_csh$lmf_csh" test_cmd "perl" "load $module2" "$lm_perl$mp_perl$lmf_perl" +test_cmd "cmake" "load $module2" "$lm_cmake\n$mp_cmake\n$lmf_cmake" # # For the different shells ... @@ -105,6 +115,9 @@ set lm_csh "setenv LOADEDMODULES $module3 ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile3';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module3';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile3\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module3\")" + # # The tests (use -a) # @@ -115,6 +128,7 @@ test_cmd "zsh" "load $module3" "$lm_sh$mp_sh$lmf_sh" test_cmd "csh" "load $module3" "$lm_csh$mp_csh$lmf_csh" test_cmd "tcsh" "load $module3" "$lm_csh$mp_csh$lmf_csh" test_cmd "perl" "load $module3" "$lm_perl$mp_perl$lmf_perl" +test_cmd "cmake" "load $module3" "$lm_cmake\n$mp_cmake\n$lmf_cmake" # # For the different shells ... @@ -129,6 +143,9 @@ set lm_csh "setenv LOADEDMODULES $module4 ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile4';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module4';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile4\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module4\")" + # # The tests (use -append) # for backward compatibility @@ -140,6 +157,7 @@ test_cmd "zsh" "load $module4" "$lm_sh$mp_sh$lmf_sh" test_cmd "csh" "load $module4" "$lm_csh$mp_csh$lmf_csh" test_cmd "tcsh" "load $module4" "$lm_csh$mp_csh$lmf_csh" test_cmd "perl" "load $module4" "$lm_perl$mp_perl$lmf_perl" +test_cmd "cmake" "load $module4" "$lm_cmake\n$mp_cmake\n$lmf_cmake" # # Cleanup @@ -157,6 +175,10 @@ unset mp_perl unset lm_perl unset lmf_perl +unset mp_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile4 unset modulefile3 unset modulefile2 diff --git a/testsuite/modules.50-cmds/017-use-undo.exp b/testsuite/modules.50-cmds/017-use-undo.exp index b451f441..8eb28ca4 100644 --- a/testsuite/modules.50-cmds/017-use-undo.exp +++ b/testsuite/modules.50-cmds/017-use-undo.exp @@ -66,6 +66,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set mp_perl "\$ENV{'MODULEPATH'} = '$path1';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set mp_cmake "set(ENV{MODULEPATH} \"$path1\")" + # # The tests (use - unload) # @@ -76,6 +80,7 @@ test_cmd "zsh" "unload $module1" "$mp_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module1" "$mp_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module1" "$mp_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module1" "$mp_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module1" "$mp_cmake\n$lm_cmake\n$lmf_cmake" # # Set up the environment for reversal ... @@ -94,6 +99,7 @@ test_cmd "zsh" "unload $module2" "$mp_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module2" "$mp_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module2" "$mp_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module2" "$mp_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module2" "$mp_cmake\n$lm_cmake\n$lmf_cmake" # # Set up the environment for reversal ... @@ -112,6 +118,7 @@ test_cmd "zsh" "unload $module3" "$mp_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module3" "$mp_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module3" "$mp_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module3" "$mp_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module3" "$mp_cmake\n$lm_cmake\n$lmf_cmake" # # Set up the environment for reversal ... @@ -131,6 +138,7 @@ test_cmd "zsh" "unload $module4" "$mp_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module4" "$mp_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module4" "$mp_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module4" "$mp_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module4" "$mp_cmake\n$lm_cmake\n$lmf_cmake" # # Cleanup @@ -152,6 +160,10 @@ unset mp_perl unset lm_perl unset lmf_perl +unset mp_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile4 unset modulefile3 unset modulefile2 diff --git a/testsuite/modules.50-cmds/020-setenv.exp b/testsuite/modules.50-cmds/020-setenv.exp index 07bd2887..cb0bfe9f 100644 --- a/testsuite/modules.50-cmds/020-setenv.exp +++ b/testsuite/modules.50-cmds/020-setenv.exp @@ -46,6 +46,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'testsuite'} = 'yes';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{testsuite} \"yes\")" + # # The tests # @@ -56,6 +60,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -73,5 +78,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/022-setenv-eschars.exp b/testsuite/modules.50-cmds/022-setenv-eschars.exp index 26c5d3cd..131957df 100644 --- a/testsuite/modules.50-cmds/022-setenv-eschars.exp +++ b/testsuite/modules.50-cmds/022-setenv-eschars.exp @@ -46,6 +46,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'pathelogical'} = 'abc : {}|<>!#$^&\\\'\"()@x%y\\\\z:sh*';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{pathelogical} \"abc : {}|<>!#$^&'\\\"()@x%y\\\\z:sh*\")" + # # The tests # @@ -56,6 +60,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -73,5 +78,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/025-setenv-undo.exp b/testsuite/modules.50-cmds/025-setenv-undo.exp index 318b06b1..c5311b98 100644 --- a/testsuite/modules.50-cmds/025-setenv-undo.exp +++ b/testsuite/modules.50-cmds/025-setenv-undo.exp @@ -54,6 +54,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "delete \$ENV{'testsuite'};" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "unset(ENV{testsuite})" + # # The tests # @@ -64,6 +68,7 @@ test_cmd "zsh" "unload $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "unload $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "unload $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "unload $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "unload $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -81,6 +86,10 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/030-unsetenv.exp b/testsuite/modules.50-cmds/030-unsetenv.exp index 5c0e71a9..e6072305 100644 --- a/testsuite/modules.50-cmds/030-unsetenv.exp +++ b/testsuite/modules.50-cmds/030-unsetenv.exp @@ -52,6 +52,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "delete \$ENV{'testsuite'};" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "unset(ENV{testsuite})" + # # The tests # @@ -62,6 +66,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -79,6 +84,10 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/035-unsetenv-undo.exp b/testsuite/modules.50-cmds/035-unsetenv-undo.exp index 2d4a2b2f..71c443f7 100644 --- a/testsuite/modules.50-cmds/035-unsetenv-undo.exp +++ b/testsuite/modules.50-cmds/035-unsetenv-undo.exp @@ -84,6 +84,11 @@ set lm_perl "delete \$ENV{'LOADEDMODULES'};" # set ts_perl "\$ENV{'testsuite'} = 'yes';" set ts_perl "delete \$ENV{'testsuite'};" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +# set ts_cmake "set(ENV{testsuite} YES)" +set ts_cmake "unset(ENV{testsuite})" + # # The tests # @@ -94,6 +99,7 @@ test_cmd "zsh" "unload $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "unload $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "unload $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "unload $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "unload $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -111,6 +117,10 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/036-unsetenv-x.exp b/testsuite/modules.50-cmds/036-unsetenv-x.exp index efdf16ed..42859e41 100644 --- a/testsuite/modules.50-cmds/036-unsetenv-x.exp +++ b/testsuite/modules.50-cmds/036-unsetenv-x.exp @@ -52,6 +52,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "delete \$ENV{'testsuite'};" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "unset(ENV{testsuite})" + # # The tests # @@ -63,6 +67,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # unload # set up the environment @@ -81,12 +86,17 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'testsuite'} = 'UNSET';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{testsuite} \"UNSET\")" + test_cmd "sh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "ksh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # Cleanup @@ -104,6 +114,10 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/040-append.exp b/testsuite/modules.50-cmds/040-append.exp index 9991fe4c..4b51c6d4 100644 --- a/testsuite/modules.50-cmds/040-append.exp +++ b/testsuite/modules.50-cmds/040-append.exp @@ -50,6 +50,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$new_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$new_path\")" + # # The tests # @@ -60,6 +64,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Try one empty string @@ -88,6 +93,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$new_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$new_path\")" + # # The tests # @@ -98,6 +107,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Try the bare colon @@ -126,6 +136,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$new_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$new_path\")" + # # The tests # @@ -136,6 +150,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Cleanup @@ -157,5 +172,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/042-append-delim.exp b/testsuite/modules.50-cmds/042-append-delim.exp index 5353fa29..df6d5bc7 100644 --- a/testsuite/modules.50-cmds/042-append-delim.exp +++ b/testsuite/modules.50-cmds/042-append-delim.exp @@ -52,6 +52,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'testsuite'} = '$ts_perl';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{testsuite} \"$ts_1 $ts_2 $ts_3\")" + # # The tests # @@ -62,6 +66,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -86,5 +91,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/045-append-undo.exp b/testsuite/modules.50-cmds/045-append-undo.exp index 3207af93..de83ed3c 100644 --- a/testsuite/modules.50-cmds/045-append-undo.exp +++ b/testsuite/modules.50-cmds/045-append-undo.exp @@ -58,6 +58,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -68,6 +72,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # try the empty string @@ -102,6 +107,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -112,6 +121,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # try it again with : @@ -147,6 +157,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -157,6 +171,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # Clean up the environment @@ -186,5 +201,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/047-app-del-undo.exp b/testsuite/modules.50-cmds/047-app-del-undo.exp index 2c5aff33..e19944d7 100644 --- a/testsuite/modules.50-cmds/047-app-del-undo.exp +++ b/testsuite/modules.50-cmds/047-app-del-undo.exp @@ -59,6 +59,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'testsuite'} = '$ts_perl';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{testsuite} \"$ts_1 $ts_2\")" + # # The tests # @@ -69,6 +73,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # Cleanup @@ -95,5 +100,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/050-prepend.exp b/testsuite/modules.50-cmds/050-prepend.exp index ac1f50b4..b5d6561b 100644 --- a/testsuite/modules.50-cmds/050-prepend.exp +++ b/testsuite/modules.50-cmds/050-prepend.exp @@ -50,6 +50,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$new_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$new_path\")" + # # The tests # @@ -60,6 +64,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Try prepending an empty string @@ -88,6 +93,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$new_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$new_path\")" + # # The tests # @@ -98,6 +107,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Try prepending a colon ':' @@ -125,6 +135,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$new_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$new_path\")" + # # The tests # @@ -135,6 +149,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Cleanup @@ -156,5 +171,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/052-prepend-delim.exp b/testsuite/modules.50-cmds/052-prepend-delim.exp index 1f2414ea..29f4256f 100644 --- a/testsuite/modules.50-cmds/052-prepend-delim.exp +++ b/testsuite/modules.50-cmds/052-prepend-delim.exp @@ -52,6 +52,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'testsuite'} = '$ts_perl';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{testsuite} \"$ts_3 $ts_1 $ts_2\")" + # # The tests # @@ -62,6 +66,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -86,5 +91,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/055-prepend-undo.exp b/testsuite/modules.50-cmds/055-prepend-undo.exp index e9a34d5e..cbb1fb36 100644 --- a/testsuite/modules.50-cmds/055-prepend-undo.exp +++ b/testsuite/modules.50-cmds/055-prepend-undo.exp @@ -58,6 +58,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -68,6 +72,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # Try the empty string @@ -103,6 +108,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -113,6 +122,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # Try just the colon @@ -148,6 +158,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -158,9 +172,10 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # -# Clen up the environment +# Clean up the environment # set env(PATH) "$old_path" @@ -187,5 +202,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/057-pre-del-undo.exp b/testsuite/modules.50-cmds/057-pre-del-undo.exp index 81d70900..4e0535ad 100644 --- a/testsuite/modules.50-cmds/057-pre-del-undo.exp +++ b/testsuite/modules.50-cmds/057-pre-del-undo.exp @@ -59,6 +59,10 @@ set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" set ts_perl "\$ENV{'testsuite'} = '$ts_perl';" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +set ts_cmake "set(ENV{testsuite} \"$ts_1 $ts_2\")" + # # The tests # @@ -69,6 +73,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake\n$lm_cmake\n$lmf_cmake" # # Cleanup @@ -95,5 +100,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/060-remove.exp b/testsuite/modules.50-cmds/060-remove.exp index ab0e1e89..41f62586 100644 --- a/testsuite/modules.50-cmds/060-remove.exp +++ b/testsuite/modules.50-cmds/060-remove.exp @@ -56,6 +56,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'PATH'} = '$old_path';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{PATH} \"$old_path\")" + # # The tests # @@ -66,6 +70,7 @@ test_cmd "zsh" "load $module" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $module" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $module" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Clean up the environment @@ -93,5 +98,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/065-remove-undo.exp b/testsuite/modules.50-cmds/065-remove-undo.exp index bf9c7374..a13c0bc4 100644 --- a/testsuite/modules.50-cmds/065-remove-undo.exp +++ b/testsuite/modules.50-cmds/065-remove-undo.exp @@ -71,6 +71,11 @@ set lm_perl "delete \$ENV{'LOADEDMODULES'};" # set ts_perl "\$ENV{'PATH'} = '$new_path';" set ts_perl "" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" +# set ts_cmake "set(ENV{PATH} \"$new_path\")" +set ts_cmake "" + # # The tests # @@ -81,6 +86,7 @@ test_cmd "zsh" "unload $module" "$ts_sh$lm_sh$lmf_sh" test_cmd "csh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "tcsh" "unload $module" "$ts_csh$lm_csh$lmf_csh" test_cmd "perl" "unload $module" "$ts_perl$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$ts_cmake$lm_cmake\n$lmf_cmake" # # Clen up the environment @@ -109,5 +115,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/077-alias-undo.exp b/testsuite/modules.50-cmds/077-alias-undo.exp index 7189af26..790c4344 100644 --- a/testsuite/modules.50-cmds/077-alias-undo.exp +++ b/testsuite/modules.50-cmds/077-alias-undo.exp @@ -55,6 +55,9 @@ set ts_csh "unsetenv testsuite;" set lmf_perl "delete \$ENV{'_LMFILES_'};" set lm_perl "delete \$ENV{'LOADEDMODULES'};" +set lmf_cmake "unset(ENV{_LMFILES_})" +set lm_cmake "unset(ENV{LOADEDMODULES})" + # # The tests # @@ -70,6 +73,7 @@ test_cmd "zsh" "unload $module" "$lm_sh$lmf_sh$ts_alias" test_cmd "csh" "unload $module" "$lm_csh$lmf_csh$ts_alias" test_cmd "tcsh" "unload $module" "$lm_csh$lmf_csh$ts_alias" test_cmd "perl" "unload $module" "$lm_perl$lmf_perl" +test_cmd "cmake" "unload $module" "$lm_cmake\n$lmf_cmake" # # Cleanup @@ -78,6 +82,9 @@ test_cmd "perl" "unload $module" "$lm_perl$lmf_perl" unset lmf_perl unset lm_perl +unset lmf_cmake +unset lm_cmake + unset ts_sh unset lm_sh unset lmf_sh diff --git a/testsuite/modules.50-cmds/080-info-name.exp b/testsuite/modules.50-cmds/080-info-name.exp index c36acc12..00fcd080 100644 --- a/testsuite/modules.50-cmds/080-info-name.exp +++ b/testsuite/modules.50-cmds/080-info-name.exp @@ -46,6 +46,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'testsuite'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{testsuite} \"$module\")" + # # The tests # @@ -56,6 +60,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -73,5 +78,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/086-info-shells.exp b/testsuite/modules.50-cmds/086-info-shells.exp index 3d230541..6a056932 100644 --- a/testsuite/modules.50-cmds/086-info-shells.exp +++ b/testsuite/modules.50-cmds/086-info-shells.exp @@ -52,6 +52,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'testsuite'} = 'perl/perl';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{testsuite} \"cmake/cmake\")" + # # The tests # @@ -62,6 +66,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_zsh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_tcsh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -82,6 +87,10 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/087-info-shells-exp.exp b/testsuite/modules.50-cmds/087-info-shells-exp.exp index 309ea201..f586162c 100644 --- a/testsuite/modules.50-cmds/087-info-shells-exp.exp +++ b/testsuite/modules.50-cmds/087-info-shells-exp.exp @@ -52,6 +52,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'testsuite'} = 'perl/perl';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{testsuite} \"cmake/cmake\")" + # # The tests # @@ -62,6 +66,7 @@ test_cmd "zsh" "load $module" "$lm_sh$lmf_sh$ts_zsh" test_cmd "csh" "load $module" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $module" "$lm_csh$lmf_csh$ts_tcsh" test_cmd "perl" "load $module" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $module" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -82,6 +87,9 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake unset modulefile unset module diff --git a/testsuite/modules.50-cmds/088-info-isloaded.exp b/testsuite/modules.50-cmds/088-info-isloaded.exp index a156647c..bab83588 100644 --- a/testsuite/modules.50-cmds/088-info-isloaded.exp +++ b/testsuite/modules.50-cmds/088-info-isloaded.exp @@ -60,6 +60,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefiles';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$modules';" set ts_perl "\$ENV{'testsuite'} = '1';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefiles\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$modules\")" +set ts_cmake "set(ENV{testsuite} \"1\")" + # # The tests # @@ -70,6 +74,7 @@ test_cmd "zsh" "load $modulex" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $modulex" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $modulex" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $modulex" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $modulex" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Test the case when the given module is not loaded @@ -97,6 +102,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefilex';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$modulex';" set ts_perl "\$ENV{'testsuite'} = '0';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefilex\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$modulex\")" +set ts_cmake "set(ENV{testsuite} \"0\")" + # # The tests # @@ -107,6 +116,7 @@ test_cmd "zsh" "load $modulex" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "load $modulex" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "load $modulex" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "load $modulex" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "load $modulex" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -124,6 +134,10 @@ unset ts_perl unset lm_perl unset lmf_perl +unset ts_cmake +unset lm_cmake +unset lmf_cmake + unset modulefile unset module unset modulefilex diff --git a/testsuite/modules.50-cmds/170-swap.exp b/testsuite/modules.50-cmds/170-swap.exp index 3dd86853..99ab4cc6 100644 --- a/testsuite/modules.50-cmds/170-swap.exp +++ b/testsuite/modules.50-cmds/170-swap.exp @@ -63,6 +63,9 @@ set lm_csh "setenv LOADEDMODULES $module ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" + # # The tests # @@ -73,6 +76,7 @@ test_cmd "zsh" "swap $mod11 $mod12" "$lm_sh$lmf_sh" test_cmd "csh" "swap $mod11 $mod12" "$lm_csh$lmf_csh" test_cmd "tcsh" "swap $mod11 $mod12" "$lm_csh$lmf_csh" test_cmd "perl" "swap $mod11 $mod12" "$lm_perl$lmf_perl" +test_cmd "cmake" "swap $mod11 $mod12" "$lm_cmake\n$lmf_cmake" # # Test the one argument form. @@ -84,6 +88,7 @@ test_cmd "zsh" "swap $mod12" "$lm_sh$lmf_sh" test_cmd "csh" "swap $mod12" "$lm_csh$lmf_csh" test_cmd "tcsh" "swap $mod12" "$lm_csh$lmf_csh" test_cmd "perl" "swap $mod12" "$lm_perl$lmf_perl" +test_cmd "cmake" "swap $mod12" "$lm_cmake\n$lmf_cmake" # # Swap the 2nd in list @@ -102,6 +107,9 @@ set lm_csh "setenv LOADEDMODULES $module ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" + # # The tests # @@ -112,6 +120,7 @@ test_cmd "zsh" "swap $mod21 $mod22" "$lm_sh$lmf_sh" test_cmd "csh" "swap $mod21 $mod22" "$lm_csh$lmf_csh" test_cmd "tcsh" "swap $mod21 $mod22" "$lm_csh$lmf_csh" test_cmd "perl" "swap $mod21 $mod22" "$lm_perl$lmf_perl" +test_cmd "cmake" "swap $mod21 $mod22" "$lm_cmake\n$lmf_cmake" # # Test the one argument form. @@ -123,6 +132,7 @@ test_cmd "zsh" "swap $mod22" "$lm_sh$lmf_sh" test_cmd "csh" "swap $mod22" "$lm_csh$lmf_csh" test_cmd "tcsh" "swap $mod22" "$lm_csh$lmf_csh" test_cmd "perl" "swap $mod22" "$lm_perl$lmf_perl" +test_cmd "cmake" "swap $mod22" "$lm_cmake\n$lmf_cmake" # # Swap the last in list @@ -141,6 +151,9 @@ set lm_csh "setenv LOADEDMODULES $module ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" + # # The tests # @@ -151,6 +164,7 @@ test_cmd "zsh" "swap $mod31 $mod32" "$lm_sh$lmf_sh" test_cmd "csh" "swap $mod31 $mod32" "$lm_csh$lmf_csh" test_cmd "tcsh" "swap $mod31 $mod32" "$lm_csh$lmf_csh" test_cmd "perl" "swap $mod31 $mod32" "$lm_perl$lmf_perl" +test_cmd "cmake" "swap $mod31 $mod32" "$lm_cmake\n$lmf_cmake" # # Test the one argument form. @@ -162,6 +176,7 @@ test_cmd "zsh" "swap $mod32" "$lm_sh$lmf_sh" test_cmd "csh" "swap $mod32" "$lm_csh$lmf_csh" test_cmd "tcsh" "swap $mod32" "$lm_csh$lmf_csh" test_cmd "perl" "swap $mod32" "$lm_perl$lmf_perl" +test_cmd "cmake" "swap $mod32" "$lm_cmake\n$lmf_cmake" # # Cleanup @@ -179,6 +194,9 @@ unset lmf_csh unset lm_perl unset lmf_perl +unset lm_cmake +unset lmf_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/175-swap2.exp b/testsuite/modules.50-cmds/175-swap2.exp index 3e042146..0e19b76a 100644 --- a/testsuite/modules.50-cmds/175-swap2.exp +++ b/testsuite/modules.50-cmds/175-swap2.exp @@ -64,6 +64,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set p_perl "\$ENV{'PATH'} = '$pathpre:$path22:$path2222:$pathpost';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set p_cmake "set(ENV{PATH} \"$pathpre:$path22:$path2222:$pathpost\")" + # # The tests # @@ -74,6 +78,7 @@ test_cmd "zsh" "swap $mod21 $mod22" "$lm_sh$p_sh$lmf_sh" test_cmd "csh" "swap $mod21 $mod22" "$lm_csh$p_csh$lmf_csh" test_cmd "tcsh" "swap $mod21 $mod22" "$lm_csh$p_csh$lmf_csh" test_cmd "perl" "swap $mod21 $mod22" "$lm_perl$p_perl$lmf_perl" +test_cmd "cmake" "swap $mod21 $mod22" "$lm_cmake\n$p_cmake\n$lmf_cmake" # # Append test @@ -114,6 +119,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set p_perl "\$ENV{'PATH'} = '$pathpre:$path22:$path2222:$pathpost';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set p_cmake "set(ENV{PATH} \"$pathpre:$path22:$path2222:$pathpost\")" + # # The tests # @@ -124,6 +133,7 @@ test_cmd "zsh" "swap $mod21 $mod22" "$lm_sh$p_sh$lmf_sh" test_cmd "csh" "swap $mod21 $mod22" "$lm_csh$p_csh$lmf_csh" test_cmd "tcsh" "swap $mod21 $mod22" "$lm_csh$p_csh$lmf_csh" test_cmd "perl" "swap $mod21 $mod22" "$lm_perl$p_perl$lmf_perl" +test_cmd "cmake" "swap $mod21 $mod22" "$lm_cmake\n$p_cmake\n$lmf_cmake" # # clean up @@ -145,6 +155,10 @@ unset lm_perl unset lmf_perl unset p_perl +unset lm_cmake +unset lmf_cmake +unset p_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/190-load.exp b/testsuite/modules.50-cmds/190-load.exp index 65b51be7..fe7cb9f0 100644 --- a/testsuite/modules.50-cmds/190-load.exp +++ b/testsuite/modules.50-cmds/190-load.exp @@ -60,6 +60,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl "\$ENV{'TESTSUITE'} = '1.1';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake "set(ENV{TESTSUITE} \"1.1\")" + # # The tests # @@ -69,6 +73,7 @@ test_cmd "zsh" "load $mod31" "$lm_sh$lmf_sh" test_cmd "csh" "load $mod31" "$lm_csh$lmf_csh" test_cmd "tcsh" "load $mod31" "$lm_csh$lmf_csh" test_cmd "perl" "load $mod31" "$lm_perl$lmf_perl" +test_cmd "cmake" "load $mod31" "$lm_cmake\n$lmf_cmake" # # set up a single environment @@ -94,6 +99,9 @@ set lm_csh "setenv LOADEDMODULES $module ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" + # # The tests # @@ -103,6 +111,7 @@ test_cmd "zsh" "load $mod31" "$lm_sh$lmf_sh" test_cmd "csh" "load $mod31" "$lm_csh$lmf_csh" test_cmd "tcsh" "load $mod31" "$lm_csh$lmf_csh" test_cmd "perl" "load $mod31" "$lm_perl$lmf_perl" +test_cmd "cmake" "load $mod31" "$lm_cmake\n$lmf_cmake" # # set up a double environment @@ -128,6 +137,9 @@ set lm_csh "setenv LOADEDMODULES $module ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" + # # The tests # @@ -137,6 +149,7 @@ test_cmd "zsh" "load $mod31" "$lm_sh$lmf_sh" test_cmd "csh" "load $mod31" "$lm_csh$lmf_csh" test_cmd "tcsh" "load $mod31" "$lm_csh$lmf_csh" test_cmd "perl" "load $mod31" "$lm_perl$lmf_perl" +test_cmd "cmake" "load $mod31" "$lm_cmake\n$lmf_cmake" # # reference a module not in the path @@ -162,6 +175,9 @@ set lm_csh "setenv LOADEDMODULES $module ;" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" + # # The tests # @@ -171,6 +187,7 @@ test_cmd "zsh" "load $oth11p" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load $oth11p" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load $oth11p" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load $oth11p" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load $oth11p" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Cleanup @@ -191,6 +208,10 @@ unset lm_perl unset lmf_perl unset ts_perl +unset lm_cmake +unset lmf_cmake +unset ts_cmake + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/200-break.exp b/testsuite/modules.50-cmds/200-break.exp index 4d3a5c43..17bd5f3e 100644 --- a/testsuite/modules.50-cmds/200-break.exp +++ b/testsuite/modules.50-cmds/200-break.exp @@ -61,6 +61,11 @@ set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl1 "\$ENV{'testsuite1'} = 'yes';" set ts_perl3 "\$ENV{'testsuite3'} = 'yes';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake1 "set(ENV{testsuite1} \"yes\")" +set ts_cmake3 "set(ENV{testsuite3} \"yes\")" + # # The tests # @@ -70,6 +75,7 @@ test_cmd "zsh" "load $mod1 $mod2 $mod3" "$lm_sh$lmf_sh$ts_sh1$ts_sh3" test_cmd "csh" "load $mod1 $mod2 $mod3" "$lm_csh$lmf_csh$ts_csh1$ts_csh3" test_cmd "tcsh" "load $mod1 $mod2 $mod3" "$lm_csh$lmf_csh$ts_csh1$ts_csh3" test_cmd "perl" "load $mod1 $mod2 $mod3" "$lm_perl$lmf_perl$ts_perl1$ts_perl3" +test_cmd "cmake" "load $mod1 $mod2 $mod3" "$lm_cmake\n$lmf_cmake\n$ts_cmake1\n$ts_cmake3" # # Cleanup @@ -93,6 +99,11 @@ unset lmf_perl unset ts_perl1 unset ts_perl3 +unset lm_cmake +unset lmf_cmake +unset ts_cmake1 +unset ts_cmake3 + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/210-exit.exp b/testsuite/modules.50-cmds/210-exit.exp index 0fcf50ed..401513e3 100644 --- a/testsuite/modules.50-cmds/210-exit.exp +++ b/testsuite/modules.50-cmds/210-exit.exp @@ -63,6 +63,11 @@ set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl1 "\$ENV{'testsuite1'} = 'yes';" set ts_perl3 "\$ENV{'testsuite3'} = 'yes';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake1 "set(ENV{testsuite1} \"yes\")" +set ts_cmake3 "set(ENV{testsuite3} \"yes\")" + set test01 " test 0 = 1;" # @@ -74,6 +79,7 @@ test_cmd "zsh" "load $mod1 $mod2 $mod3" "$lm_sh$lmf_sh$ts_sh1" test_cmd "csh" "load $mod1 $mod2 $mod3" "$lm_csh$lmf_csh$ts_csh1" test_cmd "tcsh" "load $mod1 $mod2 $mod3" "$lm_csh$lmf_csh$ts_csh1" test_cmd "perl" "load $mod1 $mod2 $mod3" "$lm_perl$lmf_perl$ts_perl1" +test_cmd "cmake" "load $mod1 $mod2 $mod3" "$lm_cmake\n$lmf_cmake\n$ts_cmake1" test_cmd "sh" "load $mod1 $mod3 $mod2" "$lm_sh$lmf_sh$ts_sh1$test01" 7 test_cmd "ksh" "load $mod1 $mod3 $mod2" "$lm_sh$lmf_sh$ts_sh1$test01" 7 @@ -81,6 +87,7 @@ test_cmd "zsh" "load $mod1 $mod3 $mod2" "$lm_sh$lmf_sh$ts_sh1$test01" 7 test_cmd "csh" "load $mod1 $mod3 $mod2" "$lm_csh$lmf_csh$ts_csh1$test01" 7 test_cmd "tcsh" "load $mod1 $mod3 $mod2" "$lm_csh$lmf_csh$ts_csh1$test01" 7 test_cmd "perl" "load $mod1 $mod3 $mod2" "$lm_perl$lmf_perl$ts_perl1" 7 +test_cmd "cmake" "load $mod1 $mod3 $mod2" "$lm_cmake\n$lmf_cmake\n$ts_cmake1" 7 # # Cleanup @@ -106,6 +113,11 @@ unset lmf_perl unset ts_perl1 unset ts_perl3 +unset lm_cmake +unset lmf_cmake +unset ts_cmake1 +unset ts_cmake3 + unset test01 unset modulefile diff --git a/testsuite/modules.50-cmds/220-continue.exp b/testsuite/modules.50-cmds/220-continue.exp index bda75bde..5c252565 100644 --- a/testsuite/modules.50-cmds/220-continue.exp +++ b/testsuite/modules.50-cmds/220-continue.exp @@ -65,6 +65,12 @@ set ts_perl1 "\$ENV{'testsuite1'} = 'yes';" set ts_perl2 "\$ENV{'testsuite2'} = 'yes';" set ts_perl3 "\$ENV{'testsuite3'} = 'yes';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake1 "set(ENV{testsuite1} \"yes\")" +set ts_cmake2 "set(ENV{testsuite2} \"yes\")" +set ts_cmake3 "set(ENV{testsuite3} \"yes\")" + # # The tests # @@ -74,6 +80,7 @@ test_cmd "zsh" "load $mod1 $mod2 $mod3" "$lm_sh$lmf_sh$ts_sh1$ts_sh2$ts_sh3" test_cmd "csh" "load $mod1 $mod2 $mod3" "$lm_csh$lmf_csh$ts_csh1$ts_csh2$ts_csh3" test_cmd "tcsh" "load $mod1 $mod2 $mod3" "$lm_csh$lmf_csh$ts_csh1$ts_csh2$ts_csh3" test_cmd "perl" "load $mod1 $mod2 $mod3" "$lm_perl$lmf_perl$ts_perl1$ts_perl2$ts_perl3" +test_cmd "cmake" "load $mod1 $mod2 $mod3" "$lm_cmake\n$lmf_cmake\n$ts_cmake1\n$ts_cmake2\n$ts_cmake3" # # Cleanup @@ -100,6 +107,12 @@ unset ts_perl1 unset ts_perl2 unset ts_perl3 +unset lm_cmake +unset lmf_cmake +unset ts_cmake1 +unset ts_cmake2 +unset ts_cmake3 + unset modulefile unset module diff --git a/testsuite/modules.50-cmds/230-loop.exp b/testsuite/modules.50-cmds/230-loop.exp index e597e456..d00225f9 100644 --- a/testsuite/modules.50-cmds/230-loop.exp +++ b/testsuite/modules.50-cmds/230-loop.exp @@ -55,6 +55,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl4 "\$ENV{'testsuite4'} = '9';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake4 "set(ENV{testsuite4} \"9\")" + # # The tests # @@ -64,6 +68,7 @@ test_cmd "zsh" "load $break4" "$lm_sh$lmf_sh$ts_sh4" test_cmd "csh" "load $break4" "$lm_csh$lmf_csh$ts_csh4" test_cmd "tcsh" "load $break4" "$lm_csh$lmf_csh$ts_csh4" test_cmd "perl" "load $break4" "$lm_perl$lmf_perl$ts_perl4" +test_cmd "cmake" "load $break4" "$lm_cmake\n$lmf_cmake\n$ts_cmake4" # # load (continue) @@ -84,6 +89,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" set ts_perl4 "\$ENV{'testsuite4'} = '9';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module\")" +set ts_cmake4 "set(ENV{testsuite4} \"9\")" + # # The tests # @@ -93,6 +102,7 @@ test_cmd "zsh" "load $cont4" "$lm_sh$lmf_sh$ts_sh4" test_cmd "csh" "load $cont4" "$lm_csh$lmf_csh$ts_csh4" test_cmd "tcsh" "load $cont4" "$lm_csh$lmf_csh$ts_csh4" test_cmd "perl" "load $cont4" "$lm_perl$lmf_perl$ts_perl4" +test_cmd "cmake" "load $cont4" "$lm_cmake\n$lmf_cmake\n$ts_cmake4" # # Cleanup @@ -113,6 +123,10 @@ unset lm_perl unset lmf_perl unset ts_perl4 +unset lm_cmake +unset lmf_cmake +unset ts_cmake4 + unset modulefile unset module diff --git a/testsuite/modules.90-avail/030-multiple.exp b/testsuite/modules.90-avail/030-multiple.exp index d3f49ade..b23986a7 100644 --- a/testsuite/modules.90-avail/030-multiple.exp +++ b/testsuite/modules.90-avail/030-multiple.exp @@ -38,8 +38,8 @@ set ts_csh "$header$module/$version1\($sym\)\n$module/$version2" # The tests # -testerr_cmd "csh" "--terse avail $module" "$ts_csh" -testerr_cmd "csh" "--terse avail $module $module" "$ts_csh\n$ts_csh" +testerr_cmd "csh" "--us=exp --terse avail $module" "$ts_csh" +testerr_cmd "csh" "--us=exp --terse avail $module $module" "$ts_csh\n$ts_csh" # # Cleanup diff --git a/testsuite/modules.95-version/020-load.exp b/testsuite/modules.95-version/020-load.exp index bb9a3bb1..5e58ad8d 100644 --- a/testsuite/modules.95-version/020-load.exp +++ b/testsuite/modules.95-version/020-load.exp @@ -46,6 +46,11 @@ set mv_perl "\$ENV{'MODULE_VERSION'} = '$version2';" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile2';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module2';" +set mvs_cmake "set(ENV{MODULE_VERSION_STACK} \"$module_version_stack2\")" +set mv_cmake "set(ENV{MODULE_VERSION} \"$version2\")" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile2\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module2\")" + # # The tests # @@ -57,6 +62,7 @@ test_cmd "zsh" "load $module2" "$lm_sh$mv_sh$mvs_sh$lmf_sh" test_cmd "csh" "load $module2" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "tcsh" "load $module2" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "perl" "load $module2" "$lm_perl$mv_perl$mvs_perl$lmf_perl" +test_cmd "cmake" "load $module2" "$lm_cmake\n$mv_cmake\n$mvs_cmake\n$lmf_cmake" # # Cleanup @@ -77,6 +83,11 @@ unset lmf_perl unset mv_perl unset mvs_perl +unset lm_cmake +unset lmf_cmake +unset mv_cmake +unset mvs_cmake + # # Clean up the environment, too # diff --git a/testsuite/modules.95-version/020-unload.exp b/testsuite/modules.95-version/020-unload.exp index 92ea97c6..38881543 100644 --- a/testsuite/modules.95-version/020-unload.exp +++ b/testsuite/modules.95-version/020-unload.exp @@ -49,6 +49,11 @@ set mv_perl "\$ENV{'MODULE_VERSION'} = '$version1';" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile1';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module1';" +set mvs_cmake "set(ENV{MODULE_VERSION_STACK} \"$module_version_stack1\")" +set mv_cmake "set(ENV{MODULE_VERSION} \"$version1\")" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile1\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module1\")" + # # The tests # @@ -59,6 +64,7 @@ test_cmd "zsh" "unload $module2" "$lm_sh$mv_sh$mvs_sh$lmf_sh" test_cmd "csh" "unload $module2" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "tcsh" "unload $module2" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "perl" "unload $module2" "$lm_perl$mv_perl$mvs_perl$lmf_perl" +test_cmd "cmake" "unload $module2" "$lm_cmake\n$mv_cmake\n$mvs_cmake\n$lmf_cmake" # # Remove a version that is not on top of the stack @@ -78,6 +84,10 @@ set mvs_perl "\$ENV{'MODULE_VERSION_STACK'} = '$version2';" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile2';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module2';" +set mvs_cmake "set(ENV{MODULE_VERSION_STACK} \"$version2\")" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile2\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module2\")" + # # The tests # @@ -88,6 +98,8 @@ test_cmd "zsh" "unload $module1" "$lm_sh$mvs_sh$lmf_sh" test_cmd "csh" "unload $module1" "$lm_csh$mvs_csh$lmf_csh" test_cmd "tcsh" "unload $module1" "$lm_csh$mvs_csh$lmf_csh" test_cmd "perl" "unload $module1" "$lm_perl$mvs_perl$lmf_perl" +test_cmd "cmake" "unload $module1" "$lm_cmake\n$mvs_cmake\n$lmf_cmake" + # # Cleanup # @@ -107,6 +119,11 @@ unset lmf_perl unset mv_perl unset mvs_perl +unset lm_cmake +unset lmf_cmake +unset mv_cmake +unset mvs_cmake + # # Clean up the environment, too # diff --git a/testsuite/modules.95-version/022-load2.exp b/testsuite/modules.95-version/022-load2.exp index 50076b7e..f58f9176 100644 --- a/testsuite/modules.95-version/022-load2.exp +++ b/testsuite/modules.95-version/022-load2.exp @@ -49,6 +49,11 @@ set mv_perl "\$ENV{'MODULE_VERSION'} = '$version3';" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile2:$modulefile3';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module2:$module3';" +set mvs_cmake "set(ENV{MODULE_VERSION_STACK} \"$module_version_stack3\")" +set mv_cmake "set(ENV{MODULE_VERSION} \"$version3\")" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile2:$modulefile3\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module2:$module3\")" + # # The tests # @@ -60,6 +65,7 @@ test_cmd "zsh" "load $module3" "$lm_sh$mv_sh$mvs_sh$lmf_sh" test_cmd "csh" "load $module3" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "tcsh" "load $module3" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "perl" "load $module3" "$lm_perl$mv_perl$mvs_perl$lmf_perl" +test_cmd "cmake" "load $module3" "$lm_cmake\n$mv_cmake\n$mvs_cmake\n$lmf_cmake" # # Cleanup @@ -80,6 +86,11 @@ unset lmf_perl unset mv_perl unset mvs_perl +unset lm_cmake +unset lmf_cmake +unset mv_cmake +unset mvs_cmake + # # Clean up the environment, too # diff --git a/testsuite/modules.95-version/022-unload2.exp b/testsuite/modules.95-version/022-unload2.exp index 18c04091..adbecff9 100644 --- a/testsuite/modules.95-version/022-unload2.exp +++ b/testsuite/modules.95-version/022-unload2.exp @@ -49,6 +49,11 @@ set mv_perl "\$ENV{'MODULE_VERSION'} = '$version2';" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile1:$modulefile2';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module1:$module2';" +set mvs_cmake "set(ENV{MODULE_VERSION_STACK} \"$module_version_stack2\")" +set mv_cmake "set(ENV{MODULE_VERSION} \"$version2\")" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile1:$modulefile2\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module1:$module2\")" + # # The tests # @@ -59,6 +64,7 @@ test_cmd "zsh" "unload $module3" "$lm_sh$mv_sh$mvs_sh$lmf_sh" test_cmd "csh" "unload $module3" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "tcsh" "unload $module3" "$lm_csh$mv_csh$mvs_csh$lmf_csh" test_cmd "perl" "unload $module3" "$lm_perl$mv_perl$mvs_perl$lmf_perl" +test_cmd "cmake" "unload $module3" "$lm_cmake\n$mv_cmake\n$mvs_cmake\n$lmf_cmake" # # Remove a version that is not on top of the stack @@ -78,6 +84,10 @@ set mvs_perl "\$ENV{'MODULE_VERSION_STACK'} = '$version3:$version1';" set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile1:$modulefile3';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module1:$module3';" +set mvs_cmake "set(ENV{MODULE_VERSION_STACK} \"$version3:$version1\")" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile1:$modulefile3\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module1:$module3\")" + # # The tests # @@ -88,6 +98,7 @@ test_cmd "zsh" "unload $module2" "$lm_sh$mvs_sh$lmf_sh" test_cmd "csh" "unload $module2" "$lm_csh$mvs_csh$lmf_csh" test_cmd "tcsh" "unload $module2" "$lm_csh$mvs_csh$lmf_csh" test_cmd "perl" "unload $module2" "$lm_perl$mvs_perl$lmf_perl" +test_cmd "cmake" "unload $module2" "$lm_cmake\n$mvs_cmake\n$lmf_cmake" # # Cleanup @@ -108,6 +119,11 @@ unset lmf_perl unset mv_perl unset mvs_perl +unset lm_cmake +unset lmf_cmake +unset mv_cmake +unset mvs_cmake + # # Clean up the environment, too # diff --git a/testsuite/modules.95-version/040-xgetenv.exp b/testsuite/modules.95-version/040-xgetenv.exp index 0458a323..f851e5b3 100644 --- a/testsuite/modules.95-version/040-xgetenv.exp +++ b/testsuite/modules.95-version/040-xgetenv.exp @@ -46,6 +46,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile1:$modulefile2:$modulefile3:$path set lm_perl "\$ENV{'LOADEDMODULES'} = '$module1:$module2:$module3:version';" set ts_perl "\$ENV{'TESTSUITE'} = '1.3';" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile1:$modulefile2:$modulefile3:$path3/version\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module1:$module2:$module3:version\")" +set ts_cmake "set(ENV{TESTSUITE} \"1.3\")" + # # The tests # @@ -56,6 +60,7 @@ test_cmd "zsh" "load version" "$lm_sh$ts_sh$lmf_sh" test_cmd "csh" "load version" "$lm_csh$ts_csh$lmf_csh" test_cmd "tcsh" "load version" "$lm_csh$ts_csh$lmf_csh" test_cmd "perl" "load version" "$lm_perl$ts_perl$lmf_perl" +test_cmd "cmake" "load version" "$lm_cmake\n$ts_cmake\n$lmf_cmake" # # Remove a module @@ -79,6 +84,10 @@ set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile1:$modulefile2:$modulefile3';" set lm_perl "\$ENV{'LOADEDMODULES'} = '$module1:$module2:$module3';" set ts_perl "delete \$ENV{'TESTSUITE'};" +set lmf_cmake "set(ENV{_LMFILES_} \"$modulefile1:$modulefile2:$modulefile3\")" +set lm_cmake "set(ENV{LOADEDMODULES} \"$module1:$module2:$module3\")" +set ts_cmake "unset(ENV{TESTSUITE})" + # # The tests # @@ -89,6 +98,7 @@ test_cmd "zsh" "unload version" "$lm_sh$lmf_sh$ts_sh" test_cmd "csh" "unload version" "$lm_csh$lmf_csh$ts_csh" test_cmd "tcsh" "unload version" "$lm_csh$lmf_csh$ts_csh" test_cmd "perl" "unload version" "$lm_perl$lmf_perl$ts_perl" +test_cmd "cmake" "unload version" "$lm_cmake\n$lmf_cmake\n$ts_cmake" # # Cleanup @@ -106,6 +116,10 @@ unset lm_perl unset lmf_perl unset ts_perl +unset lm_cmake +unset lmf_cmake +unset ts_cmake + # # Clean up the environment, too # diff --git a/utility.c b/utility.c index 7211d9f5..b2ed91c4 100644 --- a/utility.c +++ b/utility.c @@ -52,7 +52,7 @@ ** ** ** ************************************************************************ **/ -static char Id[] = "@(#)$Id: utility.c,v 1.35 2009/10/15 19:09:35 rkowen Exp $"; +static char Id[] = "@(#)$Id: utility.c,v 1.36 2010/10/04 22:06:43 rkowen Exp $"; static void *UseId[] = { &UseId, Id }; /** ************************************************************************ **/ @@ -130,6 +130,8 @@ static void EscapeShString(const char* in, char* out); static void EscapePerlString(const char* in, char* out); +static void EscapeCmakeString(const char* in, + char* out); @@ -1108,6 +1110,16 @@ static int output_set_variable( shell_cmd_separator); null_free((void *)&escaped); + } else if( !strcmp((char*) shell_derelict, "cmake")) { + /** + ** CMAKE + **/ + char* escaped = stringer(NULL, strlen(val)*2+1,NULL); + EscapeCmakeString(val,escaped); + fprintf(stdout, "set(ENV{%s} \"%s\")%s", var, escaped, + shell_cmd_separator); + null_free((void *) &escaped); + } else if (!strcmp((char *)shell_derelict, "python")) { /** ** PYTHON @@ -1186,6 +1198,8 @@ static int output_unset_variable( } else if (!strcmp(shell_derelict, "python")) { fprintf(stdout, "os.environ['%s'] = ''\ndel os.environ['%s']\n", var, var); + } else if( !strcmp( shell_derelict, "cmake")) { + fprintf( stdout, "unset(ENV{%s})%s", var, shell_cmd_separator); } else if (!strcmp(shell_derelict, "scm")) { fprintf(stdout, "(putenv \"%s\")\n", var); } else if (!strcmp(shell_derelict, "mel")) { @@ -2580,6 +2594,19 @@ void EscapePerlString( *out = 0; } +/* I think this needs a bunch of work --NJW */ +void EscapeCmakeString(const char* in, + char* out) { + for(;*in;in++) { + if (*in == '\\'|| + *in == '"') { + *out++ = '\\'; + } + *out++ = *in; + } + *out = 0; +} + /*++++ ** ** Function-Header ***************************************************** ** ** **