From e0ae60edc4ee7dafc5ab99d756d9c63624c281d5 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sun, 1 Nov 2020 20:42:14 +0100 Subject: Added unit tests to for regressions on open concretizer bugs --- .../packages/cumulative-vrange-bottom/package.py | 16 +++++++++++++++ .../packages/cumulative-vrange-middle/package.py | 15 ++++++++++++++ .../packages/cumulative-vrange-root/package.py | 16 +++++++++++++++ .../repos/builtin.mock/packages/fftw/package.py | 18 ++++++++++++++++ .../repos/builtin.mock/packages/hdf5/package.py | 4 ++-- .../packages/quantum-espresso/package.py | 24 ++++++++++++++++++++++ .../variant-on-dependency-condition-a/package.py | 18 ++++++++++++++++ .../variant-on-dependency-condition-b/package.py | 15 ++++++++++++++ .../package.py | 20 ++++++++++++++++++ 9 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 var/spack/repos/builtin.mock/packages/cumulative-vrange-bottom/package.py create mode 100644 var/spack/repos/builtin.mock/packages/cumulative-vrange-middle/package.py create mode 100644 var/spack/repos/builtin.mock/packages/cumulative-vrange-root/package.py create mode 100644 var/spack/repos/builtin.mock/packages/fftw/package.py create mode 100644 var/spack/repos/builtin.mock/packages/quantum-espresso/package.py create mode 100644 var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-a/package.py create mode 100644 var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-b/package.py create mode 100644 var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-root/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/cumulative-vrange-bottom/package.py b/var/spack/repos/builtin.mock/packages/cumulative-vrange-bottom/package.py new file mode 100644 index 0000000000..dbbec45497 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/cumulative-vrange-bottom/package.py @@ -0,0 +1,16 @@ +# Copyright 2013-2020 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 CumulativeVrangeBottom(Package): + """Test that creating cumulative version ranges of the + form X.Y:X works and allows for the selection of all the + versions >= X.Y with major == X + """ + homepage = 'https://www.example.org' + url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz' + + version('3.0', '4cb3ff35b2472aae70f542116d616e63') + version('2.2', '4cb3ff35b2472aae70f542116d616e63') + version('2.1', '4cb3ff35b2472aae70f542116d616e63') + version('2.0', '4cb3ff35b2472aae70f542116d616e63') diff --git a/var/spack/repos/builtin.mock/packages/cumulative-vrange-middle/package.py b/var/spack/repos/builtin.mock/packages/cumulative-vrange-middle/package.py new file mode 100644 index 0000000000..7a6d6d4315 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/cumulative-vrange-middle/package.py @@ -0,0 +1,15 @@ +# Copyright 2013-2020 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 CumulativeVrangeMiddle(Package): + """Test that creating cumulative version ranges of the + form X.Y:X works and allows for the selection of all the + versions >= X.Y with major == X + """ + homepage = 'https://www.example.org' + url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz' + + version('1.0', '4cb3ff35b2472aae70f542116d616e63') + + depends_on('cumulative-vrange-bottom@2.1:') diff --git a/var/spack/repos/builtin.mock/packages/cumulative-vrange-root/package.py b/var/spack/repos/builtin.mock/packages/cumulative-vrange-root/package.py new file mode 100644 index 0000000000..8215ceb517 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/cumulative-vrange-root/package.py @@ -0,0 +1,16 @@ +# Copyright 2013-2020 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 CumulativeVrangeRoot(Package): + """Test that creating cumulative version ranges of the + form X.Y:X works and allows for the selection of all the + versions >= X.Y with major == X + """ + homepage = 'https://www.example.org' + url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz' + + version('1.0', '4cb3ff35b2472aae70f542116d616e63') + + depends_on('cumulative-vrange-middle') + depends_on('cumulative-vrange-bottom@:2') \ No newline at end of file diff --git a/var/spack/repos/builtin.mock/packages/fftw/package.py b/var/spack/repos/builtin.mock/packages/fftw/package.py new file mode 100644 index 0000000000..9adcf1ea0a --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/fftw/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2020 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 Fftw(Package): + """Used to test that a few problematic concretization + cases with the old concretizer have been solved by the + new ones. + """ + homepage = "http://www.example.com" + url = "http://www.example.com/fftw-1.0.tar.gz" + + version(2.0, 'foobar') + version(1.0, 'foobar') + + variant('mpi', default=False, description='Enable MPI') + + depends_on('mpi', when='+mpi') diff --git a/var/spack/repos/builtin.mock/packages/hdf5/package.py b/var/spack/repos/builtin.mock/packages/hdf5/package.py index 495dbcbaa8..765a2993b8 100644 --- a/var/spack/repos/builtin.mock/packages/hdf5/package.py +++ b/var/spack/repos/builtin.mock/packages/hdf5/package.py @@ -10,6 +10,6 @@ class Hdf5(Package): version(2.3, 'foobarbaz') - variant('mpi', default=True, description='Debug variant') + variant('mpi', default=True, description='Enable mpi') - depends_on('mpi', when='mpi') + depends_on('mpi', when='+mpi') diff --git a/var/spack/repos/builtin.mock/packages/quantum-espresso/package.py b/var/spack/repos/builtin.mock/packages/quantum-espresso/package.py new file mode 100644 index 0000000000..61287ab7c8 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/quantum-espresso/package.py @@ -0,0 +1,24 @@ +# Copyright 2013-2020 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 QuantumEspresso(Package): + """Used to test that a few problematic concretization + cases with the old concretizer have been solved by the + new ones. + """ + homepage = "http://www.example.com" + url = "http://www.example.com/qe-1.0.tar.gz" + + version(1.0, 'foobar') + + variant('invino', default=True, description='?') + variant('veritas', default=True, description='?') + + depends_on('fftw@:1.0') + depends_on('fftw+mpi', when='+invino') + + depends_on('openblas', when='^fftw@:1') + + depends_on('libelf@0.8.10:') + depends_on('libelf@:0.8.12', when='+veritas') diff --git a/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-a/package.py b/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-a/package.py new file mode 100644 index 0000000000..f2687d6043 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-a/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2020 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 VariantOnDependencyConditionA(Package): + """Test that dependencies that are conditional on the state of + other dependencies are added correctly, for instance: + + depends_on('A') + depends_on('B', when='^A+x') + """ + + homepage = 'https://www.example.org' + url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz' + + version('1.0', '4cb3ff35b2472aae70f542116d616e63') + + variant('x', default=True, description='?') diff --git a/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-b/package.py b/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-b/package.py new file mode 100644 index 0000000000..7660a42a8e --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-b/package.py @@ -0,0 +1,15 @@ +# Copyright 2013-2020 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 VariantOnDependencyConditionB(Package): + """Test that dependencies that are conditional on the state of + other dependencies are added correctly, for instance: + + depends_on('A') + depends_on('B', when='^A+x') + """ + homepage = 'https://www.example.org' + url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz' + + version('1.0', '4cb3ff35b2472aae70f542116d616e63') diff --git a/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-root/package.py b/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-root/package.py new file mode 100644 index 0000000000..c6ea84b8b2 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/variant-on-dependency-condition-root/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2020 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 VariantOnDependencyConditionRoot(Package): + """Test that dependencies that are conditional on the state of + other dependencies are added correctly, for instance: + + depends_on('A') + depends_on('B', when='^A+x') + """ + + homepage = 'https://www.example.org' + url = 'https://example.org/files/v3.4/cmake-3.4.3.tar.gz' + + version('1.0', '4cb3ff35b2472aae70f542116d616e63') + + depends_on('variant-on-dependency-condition-a') + depends_on('variant-on-dependency-condition-b', + when='^variant-on-dependency-condition-a+x') -- cgit v1.2.3-60-g2f50