Add a unit test to prevent regression

This commit is contained in:
Massimiliano Culpo
2021-10-21 17:44:53 +02:00
parent dd4d7bae1d
commit 6d69d23aa5
6 changed files with 56 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class LowPriorityProvider(Package):
"""Provides multiple virtuals but is low in the priority of clingo"""
homepage = "http://www.example.com"
url = "http://www.example.com/a-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
provides('lapack')
provides('mpi')

View File

@@ -0,0 +1,18 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class ManyVirtualConsumer(Package):
"""PAckage that depends on many virtual packages"""
url = "http://www.example.com/"
url = "http://www.example.com/2.0.tar.gz"
version('1.0', 'abcdef1234567890abcdef1234567890')
depends_on('mpi')
depends_on('lapack')
# This directive is an example of imposing a constraint on a
# dependency is that dependency is in the DAG. This pattern
# is mainly used with virtual providers.
depends_on('low-priority-provider@1.0', when='^low-priority-provider')