summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/version-test-pkg
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-08-26 18:28:47 +0200
committerGitHub <noreply@github.com>2021-08-26 09:28:47 -0700
commit7dd3592eabe2b1ab2739a3e54c5228465c4c6ae7 (patch)
treed5ff27e4465846f503aed75c4acbe22e94abd7e3 /var/spack/repos/builtin.mock/packages/version-test-pkg
parente602c40d09e9b398e227a66838750f24c9dc1a5f (diff)
downloadspack-7dd3592eabe2b1ab2739a3e54c5228465c4c6ae7.tar.gz
spack-7dd3592eabe2b1ab2739a3e54c5228465c4c6ae7.tar.bz2
spack-7dd3592eabe2b1ab2739a3e54c5228465c4c6ae7.tar.xz
spack-7dd3592eabe2b1ab2739a3e54c5228465c4c6ae7.zip
Regression test for version selection with preferences (#25602)
This commit adds a regression test for version selection with preferences in `packages.yaml`. Before PR 25585 we used negative weights in a minimization to select the optimal version. This may lead to situations where a dependency may make the version score of dependents "better" if it is preferred in packages.yaml.
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/version-test-pkg')
-rw-r--r--var/spack/repos/builtin.mock/packages/version-test-pkg/package.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/version-test-pkg/package.py b/var/spack/repos/builtin.mock/packages/version-test-pkg/package.py
new file mode 100644
index 0000000000..5d2cd4b5cf
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/version-test-pkg/package.py
@@ -0,0 +1,19 @@
+# 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 VersionTestPkg(AutotoolsPackage):
+ """Mock AutotoolsPackage to check proper version
+ selection by clingo.
+ """
+ homepage = "https://www.gnu.org/software/make/"
+ url = "http://www.example.com/libtool-version-1.0.tar.gz"
+
+ version('develop', git='https://git.savannah.gnu.org/git/libtool.git',
+ branch='master', submodules=True)
+ version('2.4.6', sha256='e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7')
+
+ depends_on(
+ 'version-test-dependency-preferred',
+ when='@develop'
+ )