summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-01-15 02:37:20 -0800
committerGitHub <noreply@github.com>2017-01-15 02:37:20 -0800
commit0d367bbd203eab4cdde78cfe6b81a8a5e61a1572 (patch)
tree4cf40538afa1f41ac64175f4da47862eef84a0a0 /lib
parent677623962ef70e405ecb6c6d8a01fd105dcfe2c5 (diff)
downloadspack-0d367bbd203eab4cdde78cfe6b81a8a5e61a1572.tar.gz
spack-0d367bbd203eab4cdde78cfe6b81a8a5e61a1572.tar.bz2
spack-0d367bbd203eab4cdde78cfe6b81a8a5e61a1572.tar.xz
spack-0d367bbd203eab4cdde78cfe6b81a8a5e61a1572.zip
Add a test to exercise non-buildable external packages. (#2833)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/concretize_preferences.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/lib/spack/spack/test/concretize_preferences.py b/lib/spack/spack/test/concretize_preferences.py
index b95fc83010..54df4e1563 100644
--- a/lib/spack/spack/test/concretize_preferences.py
+++ b/lib/spack/spack/test/concretize_preferences.py
@@ -43,6 +43,9 @@ def concretize_scope(config, tmpdir):
spack.config.config_scopes.pop('concretize')
spack.package_prefs._pkgsort = PreferredPackages()
+ # reset provider index each time, too
+ spack.repo._provider_index = None
+
def concretize(abstract_spec):
return Spec(abstract_spec).concretized()
@@ -123,7 +126,8 @@ class TestConcretizePreferences(object):
# set up a packages.yaml file with a vdep as a key. We use
# syaml.load here to make sure source lines in the config are
# attached to parsed strings, as the error message uses them.
- conf = syaml.load("""mpi:
+ conf = syaml.load("""\
+mpi:
paths:
mpi-with-lapack@2.1: /path/to/lapack
""")
@@ -135,7 +139,8 @@ class TestConcretizePreferences(object):
def test_all_is_not_a_virtual(self):
"""Verify that `all` is allowed in packages.yaml."""
- conf = syaml.load("""all:
+ conf = syaml.load("""\
+all:
variants: [+mpi]
""")
spack.config.update_config('packages', conf, 'concretize')
@@ -143,3 +148,26 @@ class TestConcretizePreferences(object):
# should be no error for 'all':
spack.package_prefs._pkgsort = PreferredPackages()
spack.package_prefs.get_packages_config()
+
+ def test_external_mpi(self):
+ # make sure this doesn't give us an external first.
+ spec = Spec('mpi')
+ spec.concretize()
+ assert not spec['mpi'].external
+
+ # load config
+ conf = syaml.load("""\
+all:
+ providers:
+ mpi: [mpich]
+mpich:
+ buildable: false
+ paths:
+ mpich@3.0.4: /dummy/path
+""")
+ spack.config.update_config('packages', conf, 'concretize')
+
+ # ensure that once config is in place, external is used
+ spec = Spec('mpi')
+ spec.concretize()
+ assert spec['mpich'].external == '/dummy/path'