Commit Graph

10 Commits

Author SHA1 Message Date
Xavier Delaruelle
8aea89634a ts: no ref count on most Modules-specific env var 2021-08-07 13:34:53 +02:00
Xavier Delaruelle
155a3194cc ts: adapt tests for __MODULES_LMNOTUASKED removal 2021-08-07 13:34:21 +02:00
Xavier Delaruelle
1f75963064 ts: update reference to renamed __MODULES_LM* vars 2021-07-24 14:06:09 +02:00
Xavier Delaruelle
91bb6f7dcb ts: adapt existing interp tests now variant are checked 2021-06-21 20:43:10 +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
27a447aa24 Dedicate a modfile interp for each evaluation mode 2018-04-18 11:31:37 +02:00
Xavier Delaruelle
3425d25b06 Correctly handle list var when reset interp
When restoring an initial interpreter variable which was a list, issue
occured as the 'slave eval set' was given more than one value argument.
Passing values enclosed in a 'list' fixes the issue.

Improve non-regression tests to ensure expected handling will persist
over times.

Closes #145
2018-01-05 07:45:51 +01:00
Xavier Delaruelle
6caba52740 Dedicate an interp per interpretation level
Have a separate interpreter per level of interpretation in case of
nested interpretations. By doing so a module loaded by another does not
influence the interpretation of the module loading it.

Non-regression tests 302-interp-cascaded have been added to 50-cmds
suite.
2017-06-24 08:54:58 +02:00
Xavier Delaruelle
82c7368056 Renew interp when command list is altered
Delete/recreate the interpreter when a native Tcl command is altered by
a previous modulerc or modulefile interpretation. When a Tcl native
command is overriden it appears in the defined procedure list. This
procedure not part of the initial list is unset at the reset time which
makes also disappear the Tcl command.

List of Tcl commands is dumped at initial interpreter creation time and
compared after each procedure reset. If command lists differ,
interpreter is deleted then recreated to ensure proper functioning.

Non-regression tests 301-interp-command have been added to 50-cmds
suite.
2017-06-24 08:53:34 +02:00
Xavier Delaruelle
76c5aef14a Reset interp state from one interp to another
When creating interpreter, dump its variable and procedure content so
before each usage of this interpreter for another modulerc or modulefile
the initial variable and procedure state is restored to avoid spread of
definitions from one interpretation to another.

Variables are removed if they are not part of the initial state or
restored if their value has changed. Procedures are removed if they are
not part of the initial state. Nothing is done if procedures part of the
initial state have been changed during an interpretation as there is no
vital procedure in this list. Interpreter aliases are redefined before
each interpretation to clear any potential override of these aliased
procedures.

dumpInterpState and resetInterpState procedures are introduced to handle
the dump/reset mechanism of the interpreter.

Non regression tests 300-interp in 50-cmds suite have been added to test
the correct behavior of interpreters when running a list of modulerc and
modulefiles.
2017-06-24 08:53:05 +02:00