summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorXavier Delaruelle <xavier.delaruelle@cea.fr>2023-03-24 20:38:24 +0100
committerGitHub <noreply@github.com>2023-03-24 15:38:24 -0400
commitc4923fe3b3ee28ac47311411a631b228aaefef38 (patch)
tree43f9635d738f2077d236d75f4446870d81d7d4a5 /lib
parentae504ce2feeb2126d4ecb4098e01a1df1761b39d (diff)
downloadspack-c4923fe3b3ee28ac47311411a631b228aaefef38.tar.gz
spack-c4923fe3b3ee28ac47311411a631b228aaefef38.tar.bz2
spack-c4923fe3b3ee28ac47311411a631b228aaefef38.tar.xz
spack-c4923fe3b3ee28ac47311411a631b228aaefef38.zip
modules: add support for append_flags/remove_flags (#36402)
Adapt tcl and lmod modulefile templates to generate append-path or remove-path commands in modulefile when respectively append_flags or remove_flags commands are defined in package for run environment. Fixes #10299.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/modules/lmod.py2
-rw-r--r--lib/spack/spack/test/modules/tcl.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/spack/spack/test/modules/lmod.py b/lib/spack/spack/test/modules/lmod.py
index f002285ce0..4ac888f2d5 100644
--- a/lib/spack/spack/test/modules/lmod.py
+++ b/lib/spack/spack/test/modules/lmod.py
@@ -144,6 +144,8 @@ class TestLmod(object):
assert len([x for x in content if 'append_path("SEMICOLON", "bar", ";")' in x]) == 1
assert len([x for x in content if 'prepend_path("SEMICOLON", "bar", ";")' in x]) == 1
assert len([x for x in content if 'remove_path("SEMICOLON", "bar", ";")' in x]) == 1
+ assert len([x for x in content if 'append_path("SPACE", "qux", " ")' in x]) == 1
+ assert len([x for x in content if 'remove_path("SPACE", "qux", " ")' in x]) == 1
@pytest.mark.parametrize("config_name", ["exclude", "blacklist"])
def test_exclude(self, modulefile_content, module_configuration, config_name):
diff --git a/lib/spack/spack/test/modules/tcl.py b/lib/spack/spack/test/modules/tcl.py
index f289e455e5..f91a55691f 100644
--- a/lib/spack/spack/test/modules/tcl.py
+++ b/lib/spack/spack/test/modules/tcl.py
@@ -120,6 +120,8 @@ class TestTcl(object):
assert len([x for x in content if 'append-path --delim ";" SEMICOLON "bar"' in x]) == 1
assert len([x for x in content if 'prepend-path --delim ";" SEMICOLON "bar"' in x]) == 1
assert len([x for x in content if 'remove-path --delim ";" SEMICOLON "bar"' in x]) == 1
+ assert len([x for x in content if 'append-path --delim " " SPACE "qux"' in x]) == 1
+ assert len([x for x in content if 'remove-path --delim " " SPACE "qux"' in x]) == 1
@pytest.mark.parametrize("config_name", ["exclude", "blacklist"])
def test_exclude(self, modulefile_content, module_configuration, config_name):