summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-10-28 19:15:33 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit930b05fab41e39ed5554dea853ccfac246f0c229 (patch)
tree54a14b4c3ddbf05b8f63e24e0ed96c5202196c24 /lib
parente226523aeb7df132aab50275e8591e6a941de536 (diff)
downloadspack-930b05fab41e39ed5554dea853ccfac246f0c229.tar.gz
spack-930b05fab41e39ed5554dea853ccfac246f0c229.tar.bz2
spack-930b05fab41e39ed5554dea853ccfac246f0c229.tar.xz
spack-930b05fab41e39ed5554dea853ccfac246f0c229.zip
Add unit tests for dependencies being patched by parent
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/concretize.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
index f8b3b1eda2..d8d411cb6a 100644
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -693,3 +693,20 @@ class TestConcretize(object):
for dep in unexpected:
msg = '"{0}" is in "{1}" but was unexpected'
assert dep not in s, msg.format(dep, spec_str)
+
+ @pytest.mark.parametrize('spec_str,patched_deps', [
+ ('patch-several-dependencies', [('libelf', 1), ('fake', 2)]),
+ ('patch-several-dependencies@1.0',
+ [('libelf', 1), ('fake', 2), ('libdwarf', 1)]),
+ ('patch-several-dependencies@1.0 ^libdwarf@20111030',
+ [('libelf', 1), ('fake', 2), ('libdwarf', 2)]),
+ ('patch-several-dependencies ^libelf@0.8.10',
+ [('libelf', 2), ('fake', 2)]),
+ ('patch-several-dependencies +foo', [('libelf', 2), ('fake', 2)])
+ ])
+ def test_patching_dependencies(self, spec_str, patched_deps):
+ s = Spec(spec_str).concretized()
+
+ for dep, num_patches in patched_deps:
+ assert s[dep].satisfies('patches=*')
+ assert len(s[dep].variants['patches'].value) == num_patches