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
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
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.
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.
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.