Commit Graph

943 Commits

Author SHA1 Message Date
Xavier Delaruelle
87f8e51823 ts/lib: test tcl ext lib against a zero res getgroups call
Add an utility library that supersedes the getgroups function from libc.
The getgroups function from this added library always returns an empty
result (0). It is used for coverage test of the getgroups call made
within the Envmodules_InitStateUsergroupsObjCmd function of the Tcl
extension library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
1675363e0e ts/lib: test tcl ext lib against a failed getgrgid call
Add an utility library that supersedes the getgrgid function from libc.
The getgrgid function from this added library always returns an error
(NULL). It is used for coverage test of the getgrgid call made within the
Envmodules_InitStateUsergroupsObjCmd function of the Tcl extension
library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
166096f4d8 ts/lib: test tcl ext lib against a failed getgroups call
Add an utility library that supersedes the getgroups function from libc.
The getgroups function from this added library always returns an error
(-1). It is used for coverage test of the getgroups call made within the
Envmodules_InitStateUsergroupsObjCmd function of the Tcl extension
library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
4542008335 ts/lib: test tcl ext lib against a failed getpwuid call
Add an utility library that supersedes the getpwuid function from libc.
The getpwuid function from this added library always returns an error
(NULL). It is used for coverage test of the getpwuid call made within
the Envmodules_InitStateUsernameObjCmd function of the Tcl extension
library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
88b77b7a5d ts: adapt stack trace msgs to tcl vers in 50/{286,287} 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
9cda3f0dbb ts: test module-info user{name,groups} on win platform 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
1e319459ad ts: test 'module-info usergroups' in 50/287 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
d3276559c5 ts: test 'module-info username' in 50/286 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
efb64c83a5 ts: fix install quar test when LD_PRELOAD is set 2020-07-07 15:09:42 +02:00
Xavier Delaruelle
38fa4a3356 ts: fix result order on 50/400 tests 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
01a89ccc92 ts: adapt 50/400 err stack trace msg to Tcl version used 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
03f5dd9af8 ts: test var relying on source-sh script defined var 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
33d4db3ec1 ts: add 'display' mode test for source-sh cmd 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
71d48f03c0 ts: test 'source-sh' modulefile command 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
6beaaff9ef ts: add tests for 'trace' verbosity level 2020-06-01 21:02:32 +02:00
Xavier Delaruelle
20b28d1091 ts: add test for path-like variable in 70/310 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
1c3fd35338 No support of BSD sh shell on sh-to-mod currently
sh shell on BSD platform outputs alias definition with different
character escaping than regular sh or dash on Linux platform.

Disable test for this shell on this platform currently. Will see later
on if a need to support this shell is needed.
2020-06-01 20:59:50 +02:00
Xavier Delaruelle
f5991f09c6 ts: rework FOOSHELL var test in 70/310
Prefer BASH environment variable to SHELL to check bash binary location
used for current shell session.
2020-06-01 20:59:50 +02:00
Xavier Delaruelle
3dd6e43836 Add support for csh/tcsh shells on sh-to-mod sub-cmd 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
4439741f95 ts: mksh not supported on sh-to-mod currently 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
5f5bfafcf7 ts: fix install 00/090 when quarantine is disabled
With quarantine mechanism disabled, no specific IFS is set when
modulecmd.tcl output is evaluated with zsh and ksh shells, sh-to-mod
does not output ';' character at end of each function line, thus when
evaluated with default IFS the multiple lines are treated as a single
command line.
2020-06-01 20:59:50 +02:00
Xavier Delaruelle
49b9717130 Add support for fish shell on sh-to-mod sub-cmd 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
8eb4ae85c9 ts: prepare 70/310 for non-sh shells 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
d039eb40a1 Add support for ksh93 shell on sh-to-mod sub-cmd 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
b995368580 Add support for dash shell on sh-to-mod sub-cmd
dash has some limitations for this task:
- there is no mechanism to report shell functions set, so no shell
  function will be defined or unset with this shell through sh-to-mod
- arguments cannot be passed to a sourced script
2020-06-01 20:59:50 +02:00
Xavier Delaruelle
a7de829af9 Add support for sh shell on sh-to-mod sub-cmd 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
37def4d0c1 ts: add install tests for sh-to-mod sub-cmd 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
14d3fcaa8f Add support for ksh shell on sh-to-mod sub-cmd
Specific code is required to retrieve defined functions in environment
as `typeset -f` may output function definition with no clear separation
between each other.
2020-06-01 20:59:50 +02:00
Xavier Delaruelle
1e520138e3 Add support for zsh shell on sh-to-mod sub-cmd 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
2c68a96e11 ts: add tests for 'sh-to-mod' sub-command 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
2bcb6a75fb ts: update existing tests to check 'sh-to-mod' 2020-06-01 20:59:50 +02:00
Xavier Delaruelle
76e9e16427 Optionally catch error when initializing a state
Ensure, when dumping all states that an error occuring during a state
initialiaztion will not break the whole report.
2020-06-01 20:59:14 +02:00
Xavier Delaruelle
ed2533b8ef ts: adapt tests to new state mngt 2020-06-01 20:58:04 +02:00
Xavier Delaruelle
b06dcb3fc3 Migrate 'is_stderr_tty' state retrieval to getState 2020-06-01 20:58:04 +02:00
Xavier Delaruelle
dbcb53ef6a Migrate 'term_columns' state retrieval to getState 2020-06-01 20:58:04 +02:00
Roy Storey
df1cdab19c Use absolute path to load tcl_ext_lib
Fixes #344
2020-05-15 08:48:36 +02:00
Xavier Delaruelle
fe23209539 Sync env var changes across Tcl sub-interpreters
Ensure environment variable change at the Tcl interpreter level is
propagated to every sub-interpreters used to evaluate modulefiles or
modulercs.

Tcl by default maintain the `::env` array in sync across all started
interpreters. But in some cases, it appears a change occuring in master
interpreter is not correctly propagated when the variable is later on
updated in sub-interpreter.

Fixes #342
2020-05-10 15:54:16 +02:00
Xavier Delaruelle
8436c77a52 Keep link with env vars when restoring settings after breakage
In case a modulefile evaluation fails, environment context prior this
failed evaluation is restored. Fix environment variable restoration
mechanism to keep the link that monitors and updates environment
variable array `env` in every Tcl sub-interpreters.

Unsetting the whole `env` array makes Tcl stop monitoring env accesses
and stop updating environment variables. Environment context restoration
is now done by updating the `env` array (unsetting keys in the array and
setting value for new or existing keys).

Fixes #340
2020-05-08 19:06:12 +02:00
Xavier Delaruelle
e84652f198 Disable pager when clear sub-cmd called with ml cmd
To ensure a proper prompt message output on clear sub-command, no pager
is started. This commit also turns off pager when clear sub-command is
called through the ml shortcut command.

Fixes #338
2020-05-08 19:05:55 +02:00
Xavier Delaruelle
6d4af95bfe ts: add 70/274 tests to validate auto symbols 2020-04-07 15:11:24 +02:00
Xavier Delaruelle
f5b8905ff7 Honor default when version list is composed of symvers
When an advanced version specifier list contains symbolic version
references, fix resolving to honor default version if part of the
specified list.

Fixes #334.
2020-04-07 15:11:24 +02:00
Xavier Delaruelle
3e74b96d54 ts: adapt existing tests for auto symbols 2020-04-07 15:11:12 +02:00
Xavier Delaruelle
af8594bb55 Perform noplaindir filter within getModules
Rather applying a filter that removes the directory entries with no tag
attached to them, except if search is performed in a no-indepth manner,
perform this filter directly withing getModules procedure.
2020-04-04 16:57:21 +02:00
Xavier Delaruelle
ed111723b9 Perform onlydefaults/onlylatest filter within getModules
Rather re-filtering result from getModules procedure within listModules
procedure, perform the onlydefaults/onlylatest (-d/-L) avail filters
directly within getModules.
2020-04-04 16:57:21 +02:00
Xavier Delaruelle
ff748f86ac ts: fix 70/220 when MODULES_ICASE is externally set 2020-04-04 16:55:25 +02:00
Xavier Delaruelle
a77022e5d1 Rework version target inclusion in getModules result
Rework loop walking the symbolic version target to include all elements
recursively contained in directory targeted by symbolic version. Now
using dir_list structure to walk path rather querying the whole
found_list with modEq test procedure.
2020-03-29 18:48:56 +02:00
Xavier Delaruelle
3452897d22 ts: fix indepth-dependent test in 80/068
For 3 tests, result depends on indepth option, not implicit_default
option.
2020-03-29 13:32:02 +02:00
Xavier Delaruelle
2273640cd5 Add ref in res to version target not in res but not searched
Enable resolution of default module in module sub-directory when this
default symbol targets an hidden directory (whose name starts with a dot
character).

Adapt getModules procedure to add reference, in the directory description
returned as result, for symbolic version targets that are hidden, not
included in returned result but excluded from search made.

Fixes #331
2020-03-29 08:20:49 +02:00
Xavier Delaruelle
e9bd27d928 Filter hidden sym/alias/module from aliases output
Filter-out from the output of the `aliases` sub-command all hidden
aliases, symbolic versions or hidden modules targeted by a non-hidden
symbolic version.

Fixes #330
2020-03-29 08:20:16 +02:00
Xavier Delaruelle
d8a58feeeb ts: test alias/symver/virtual hidden modules in 20/067 2020-03-29 08:20:16 +02:00