From 6d69d23aa5574df501ac8bdccdeaaf0ecc550f1b Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 21 Oct 2021 17:44:53 +0200 Subject: Add a unit test to prevent regression --- .../packages/low-priority-provider/package.py | 18 ++++++++++++++++++ .../packages/many-virtual-consumer/package.py | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/low-priority-provider/package.py create mode 100644 var/spack/repos/builtin.mock/packages/many-virtual-consumer/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/low-priority-provider/package.py b/var/spack/repos/builtin.mock/packages/low-priority-provider/package.py new file mode 100644 index 0000000000..d0b768637f --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/low-priority-provider/package.py @@ -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') diff --git a/var/spack/repos/builtin.mock/packages/many-virtual-consumer/package.py b/var/spack/repos/builtin.mock/packages/many-virtual-consumer/package.py new file mode 100644 index 0000000000..40da0f40e0 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/many-virtual-consumer/package.py @@ -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') -- cgit v1.2.3-70-g09d2