summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-06-04 17:24:27 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-06-04 17:24:27 +0200
commit2d6db06fca54aa840593a1dbb4e99e8f0e58bbce (patch)
treeee5017694b3e31575224bbdb49b755b26edf4bcf
parentffa6fed3a3205d15d6c9ff8ca8c92cbecdbe2a0c (diff)
downloadspack-2d6db06fca54aa840593a1dbb4e99e8f0e58bbce.tar.gz
spack-2d6db06fca54aa840593a1dbb4e99e8f0e58bbce.tar.bz2
spack-2d6db06fca54aa840593a1dbb4e99e8f0e58bbce.tar.xz
spack-2d6db06fca54aa840593a1dbb4e99e8f0e58bbce.zip
unit test : prerequisites
-rw-r--r--lib/spack/spack/test/modules.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py
index bf5555d9d4..99cc280d27 100644
--- a/lib/spack/spack/test/modules.py
+++ b/lib/spack/spack/test/modules.py
@@ -68,6 +68,24 @@ configuration_autoload_all = {
}
}
+configuration_prerequisites_direct = {
+ 'enable': ['tcl'],
+ 'tcl': {
+ 'all': {
+ 'prerequisites': 'direct'
+ }
+ }
+}
+
+configuration_prerequisites_all = {
+ 'enable': ['tcl'],
+ 'tcl': {
+ 'all': {
+ 'prerequisites': 'all'
+ }
+ }
+}
+
configuration_alter_environment = {
'enable': ['tcl'],
'tcl': {
@@ -187,6 +205,17 @@ class TclTests(MockPackagesTest):
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 5)
self.assertEqual(len([x for x in content if 'module load ' in x]), 5)
+ def test_prerequisites(self):
+ spack.modules.CONFIGURATION = configuration_prerequisites_direct
+ spec = spack.spec.Spec('mpileaks arch=x86-linux')
+ content = self.get_modulefile_content(spec)
+ self.assertEqual(len([x for x in content if 'prereq' in x]), 2)
+
+ spack.modules.CONFIGURATION = configuration_prerequisites_all
+ spec = spack.spec.Spec('mpileaks arch=x86-linux')
+ content = self.get_modulefile_content(spec)
+ self.assertEqual(len([x for x in content if 'prereq' in x]), 5)
+
def test_alter_environment(self):
spack.modules.CONFIGURATION = configuration_alter_environment
spec = spack.spec.Spec('mpileaks arch=x86-linux')