diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-14 05:02:50 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-14 05:02:50 -0700 |
commit | f45b8b1083e5f628dd31fa4b7b873b6df7119d0e (patch) | |
tree | de1b7c2a6067709e9508cbeb575dc59a75392697 /lib | |
parent | 05c761dee9c86faf9ce6d5b98ae57c8737694898 (diff) | |
download | spack-f45b8b1083e5f628dd31fa4b7b873b6df7119d0e.tar.gz spack-f45b8b1083e5f628dd31fa4b7b873b6df7119d0e.tar.bz2 spack-f45b8b1083e5f628dd31fa4b7b873b6df7119d0e.tar.xz spack-f45b8b1083e5f628dd31fa4b7b873b6df7119d0e.zip |
Add some tests for packages with multiple virtual dependencies.
- Added mock `hypre` package, depends on `lapack` and `blas`.
- test cases where some packages provide both `lapack` and `blas`, but
others do not.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/concretize.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index 07828d8ea6..f264faf17a 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -142,6 +142,34 @@ class ConcretizeTest(MockPackagesTest): for spec in spack.repo.providers_for('mpi@3'))) + def test_concretize_two_virtuals(self): + """Test a package with multiple virtual dependencies.""" + s = Spec('hypre').concretize() + + + def test_concretize_two_virtuals_with_one_bound(self): + """Test a package with multiple virtual dependencies and one preset.""" + s = Spec('hypre ^openblas').concretize() + + + def test_concretize_two_virtuals_with_two_bound(self): + """Test a package with multiple virtual dependencies and two of them preset.""" + s = Spec('hypre ^openblas ^netlib-lapack').concretize() + + + def test_concretize_two_virtuals_with_dual_provider(self): + """Test a package with multiple virtual dependencies and force a provider + that provides both.""" + s = Spec('hypre ^openblas-with-lapack').concretize() + + + def test_concretize_two_virtuals_with_dual_provider_and_a_conflict(self): + """Test a package with multiple virtual dependencies and force a provider + that provides both, and another conflicting package that provides one.""" + s = Spec('hypre ^openblas-with-lapack ^netlib-lapack') + self.assertRaises(spack.spec.MultipleProviderError, s.concretize) + + def test_virtual_is_fully_expanded_for_callpath(self): # force dependence on fake "zmpi" by asking for MPI 10.0 spec = Spec('callpath ^mpi@10.0') @@ -281,4 +309,3 @@ class ConcretizeTest(MockPackagesTest): Spec('d')), Spec('e')) self.assertEqual(None, find_spec(s['b'], lambda s: '+foo' in s)) - |