Commit Graph

36 Commits

Author SHA1 Message Date
Xavier Delaruelle
145462a864 ts/doc: add stashpop test/doc on 'module-info command' 2022-09-28 07:20:54 +02:00
Xavier Delaruelle
ec835353b2 ts/doc: add stash test/doc on 'module-info command' 2022-09-28 06:42:59 +02:00
Xavier Delaruelle
d391d31d57 ts/doc: add reset test/doc on 'module-info command' 2022-08-25 08:10:01 +02:00
Xavier Delaruelle
6f9928f3bf ts/doc: add mod-to-sh test/doc on 'module-info command' 2022-07-30 16:07:28 +02:00
Dimitri Papadopoulos
e9a6678eec Fix typos found by codespell 2022-02-15 05:54:03 +01:00
Xavier Delaruelle
a18618ff94 ts/doc: add load-any test/doc on 'module-info command' 2021-12-24 16:04:16 +01:00
Xavier Delaruelle
9598a480ac Enable is-used mfcmd in modulerc
Make is-used modulefile command available from a modulerc evaluation
context.
2021-08-19 06:49:28 +02:00
Xavier Delaruelle
7a516a8ad9 ts: add tests for 'refresh' subcmd 2021-08-14 19:36:22 +02:00
Xavier Delaruelle
237755f9fb ts/doc: add try-load test/doc on 'module-info command' 2021-08-13 07:53:54 +02:00
Xavier Delaruelle
cbb4b7c611 ts: add modulefiles.2 test modulepath repository
And make it a repository for additional test modulefiles that do not
need to take part in the global avail tests made over the main
repository (modulefiles) and who could mixed with others (like other and
other2).
2019-08-27 21:07:55 +02:00
Xavier Delaruelle
44e8fe2fd7 testsuite: add 'cmd' to the test shell list 2018-03-15 06:00:57 +01:00
Xavier Delaruelle
dcef37bb09 Clean MODULEPATH content before using it
Improve getModulePathList procedure to pass each directory element part
of the MODULEPATH env variable through getAbsolutePath. Ensure this way
each directory has correct form to work with afterward.

A 'set_abs' argument is added to getModulePathList procedure, enabled by
default, to apply this new cleanup behavior. Not applied for
cmdModuleUse and cmdModuleUnuse who will need extra work to detect
relative/full paths already set in MODULEPATH.

Add bunch of tests to check the various commands when modulepath
directory has trailing slash at its end.

Fixes #152
2018-02-08 06:22:11 +01:00
Xavier Delaruelle
7c0e21bc95 Cwd during interp corresponds to modfile dir
Now getAbsolutePath procedure, which make a path passed as argument an
absolute path, check the current path of the interpreted modulefile or
modulerc rather always taking the current path of the module command
execution.

So a modulefile or modulerc can use relative paths based on a
determistic way as it is now based on their location. Previously it was
not possible as relative paths were dependent of the location from where
the module command was executed.

If ModulesCurrentModulefile variable is not empty, getAbsolutePath nows
it is called during a modulefile/modulerc interpretation, so it takes
the directory name of this ModulesCurrentModulefile as current working
directory.
2018-01-13 14:04:35 +01:00
Xavier Delaruelle
c6405dce2d testsuite: improve coverage of 'is-loaded' tests 2017-12-01 08:07:53 +01:00
Xavier Delaruelle
2dcd8da58d Introduce 'module-info loaded' modulefile command
Add 'loaded' sub-command to the 'module-info' modulefile Tcl command.
This new sub-command returns name of the modules currently loaded
corresponding to the name passed as argument. May return multiple
modules if passed name matches more than one loaded modules.

Document new command in modulefile.4 and test it with a 285-info-loaded
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-30 17:16:24 +01:00
Xavier Delaruelle
1b9420b500 Add 'is-avail' modulefile command
Introduce 'is-avail' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed modulefiles exists in
enabled in MODULEPATH.

Document new command in modulefile.4 and test it with a 322-is-avail
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 07:27:04 +01:00
Xavier Delaruelle
24cb3d86e2 Add 'is-used' modulefile command
Introduce 'is-used' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed directories has been
enabled in MODULEPATH.

Document new command in modulefile.4 and test it with a 321-is-used
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 07:26:49 +01:00
Xavier Delaruelle
db9b86632e Add 'is-saved' modulefile command
Introduce 'is-saved' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed collections exists.

Document new command in modulefile.4 and test it with a 320-is-saved
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-27 06:57:15 +01:00
Xavier Delaruelle
a625d685da Support for R "shell"
And adapt documentation, installation and testsuite.
2017-08-09 15:32:45 +02:00
Xavier Delaruelle
6ce8fda40a Support for Ruby "shell"
And adapt documentation, installation and testsuite.
2017-08-09 00:19:31 +02:00
Xavier Delaruelle
1d5232c55c Support for CMake "shell"
And adapt documentation, installation and testsuite.
2017-08-07 16:11:55 +02:00
Xavier Delaruelle
842839eafe Add tests for bad or deprecated 'module-info' cmds 2017-05-22 07:01:58 +02:00
Xavier Delaruelle
20093d7218 Introduce 'test' command and mode
Add 'module test' command to trigger when called execution of a
ModulesTest procedure in target modulefile following same kind of
mechanism than 'module help'.

If ModulesTest procedure is missing from modulefile, a 'Unable to find
ModulesTest proc' message is displayed but no error code is set. If
ModulesTest procedure returns 1 (true), test is considered successful and
message 'Test result: PASS' is displayed. If ModulesTest returns no or
any other value, test is considered failed and message 'Test result:
FAIL' is displayed. In this case, module command exit in error.

Adapt bash and tcsh completion scripts for the new command. Describe new
command and new mode in docs.

Adapt existing non-regression tests and relative test modulefiles for
new command and new mode in 00-init, 50-cmds and 70-maint suites. Add
085-test tests in 70-maint to check coherent behavior of new command.
2017-04-30 19:00:18 +02:00
Xavier Delaruelle
344e386d06 Add module-info mode check against 'remove' and switch' value
For compatibility with C-version, enable to check current 'module-info
mode' against the 'remove' and 'switch' value. To achieve this change
'remove' is considered an alias of the 'unload' value. 'switch' is
checked against the current 'module-info command'.

084-info-mode-exp tests of 50-cmds suite have been adapted. In addition
020-unload and 022-unload2 tests of 95-version suite have also been
adapted as the modulefiles they check are using a 'module-info mode
remove' test.
2017-02-02 06:41:18 +01:00
Xavier Delaruelle
df5b995726 Introduce 'module-info command'
Introduce g_commandNameStack variable, currentCommandName,
pushCommandName and popCommandName procedures to implement a
'module-info command' that returns the name of the currently running
module command.

This new mechanism enables to distinguish complex 'load' or 'unload'
commands that cannot be determined with 'module-info mode' alone. For
instance a modulefile can now be aware that a 'switch', a 'restore' or
a 'purge' command is currently being run.

Add description of this new command to the modulefile documentation.

Add 282-info-command and 283-info-command-exp tests in 50-cmds and adapt
281-info-modulerc in 50-cmds and 020-savelist in 61-coll.
2017-02-02 06:40:56 +01:00
Xavier Delaruelle
e51b6c845f Fix 'module-info specified'
Introduce g_specifiedNameStack variable, currentSpecifiedName,
pushSpecifiedName and popSpecifiedName procedures to implement a
'module-info specified' that returns the modulefile name as specified on
the command-line.

Add 280-info-specified tests to the 50-cmds suite.
2017-02-02 06:40:35 +01:00
Xavier Delaruelle
cff0768143 Clarify module-info 'mode' option
Fix mode setup during a 'help' command and import info-mode relative
tests in 50-cmds suite.

module-info non-regression tests have been adapted to match behavior of
Tcl-version:
* during a 'help' command, stdout output of ModulesHelp procedure is not
redirected to stderr as done on C-version
* on an 'unload' command, module-info mode is equal to 'unload' and not
'remove'
* on a 'switch' command, module-info mode is equal to 'unload' then
'load' and not 'switch1', 'switch2' and 'switch3'
* on a 'switch' command, module-info mode never equals to 'switch'
2017-01-04 08:57:13 -06:00
Xavier Delaruelle
cd75b9fdfd Clarify module-info 'flags' and 'user' options
'flags' and 'user' are C-version specific options and they are not
relevant for Tcl-version. So they are present on Tcl-version to avoid
breaking modulefile using them but always return false or an empty
string to reflect the fact that these options are unmanaged here.

Import and adapt info-user and info-flags non-regression tests in
50-cmds suite.
2017-01-04 08:57:07 -06:00
Xavier Delaruelle
817cd60b7b testsuite: add tests for fish shell 2016-08-13 05:23:01 -05:00
Xavier Delaruelle
511cd53e5d testsuite: adapt 50-cmds/info-shells and 50-cmds/121-prereq tests 2016-08-13 05:22:29 -05:00
Xavier Delaruelle
9460d943b0 testsuite: import tests recently added to C-version 2016-08-13 05:22:17 -05:00
Kent Mein
bd4a515a7d Moved things out of the tcl directory.
Kent
2013-01-10 15:48:30 -06:00
Kent Mein
76adb1c7e3 Removed all of the non tcl version stuff. Or most of it anyway.
Kent
2013-01-10 15:44:49 -06:00
rkowen
7aea93b75a Rolled in the cmake addition from version 3.2.8,
and the new perl.pm & python.py init files.
2010-10-04 22:06:44 +00:00
rkowen
d24fbc7379 * Fixed "module swap" to put the substituted module in the
same path location as the old.  Also added a number of tests
  for this feature.
  (Bug was pointed out by Leo Butler <lbutler@brocade.com>)
* Added tests for the "is-loaded" modulefile command introduced
  back in 3.0.8-rko.
2001-07-26 04:59:25 +00:00
rk
e816ab15b5 modules is a shell tool for setting-up the user environment on the
fly, as it were.  It's a powerful mechanism for dynamically changing
environment variables, aliases, X11 resources, etc.
It uses an embedded Tcl intrepretor, with a few extensions.  Therefore,
it has a well defined language syntax.
Version 3.1 is GPL, and includes many improvements over the 3.0beta.
2000-06-28 00:17:34 +00:00