summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/test/build_systems.py69
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-gnu-broken/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-gnu/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/mirror-gnu-broken/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-sourceware/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-xorg-broken/package.py15
-rw-r--r--var/spack/repos/builtin.mock/packages/mirror-xorg/package.py15
8 files changed, 174 insertions, 0 deletions
diff --git a/lib/spack/spack/test/build_systems.py b/lib/spack/spack/test/build_systems.py
index 7ede78b7a5..295704798f 100644
--- a/lib/spack/spack/test/build_systems.py
+++ b/lib/spack/spack/test/build_systems.py
@@ -219,3 +219,72 @@ class TestCMakePackage(object):
with pytest.raises(KeyError, match="not a variant"):
pkg.define_from_variant('NONEXISTENT')
+
+
+@pytest.mark.usefixtures('config', 'mock_packages')
+class TestGNUMirrorPackage(object):
+
+ def test_define(self):
+ s = Spec('mirror-gnu')
+ s.concretize()
+ pkg = spack.repo.get(s)
+
+ s = Spec('mirror-gnu-broken')
+ s.concretize()
+ pkg_broken = spack.repo.get(s)
+
+ cls_name = type(pkg_broken).__name__
+ with pytest.raises(AttributeError,
+ match=r'{0} must define a `gnu_mirror_path` '
+ r'attribute \[none defined\]'
+ .format(cls_name)):
+ pkg_broken.urls
+
+ assert pkg.urls[0] == 'https://ftpmirror.gnu.org/' \
+ 'make/make-4.2.1.tar.gz'
+
+
+@pytest.mark.usefixtures('config', 'mock_packages')
+class TestSourcewarePackage(object):
+
+ def test_define(self):
+ s = Spec('mirror-sourceware')
+ s.concretize()
+ pkg = spack.repo.get(s)
+
+ s = Spec('mirror-sourceware-broken')
+ s.concretize()
+ pkg_broken = spack.repo.get(s)
+
+ cls_name = type(pkg_broken).__name__
+ with pytest.raises(AttributeError,
+ match=r'{0} must define a `sourceware_mirror_path` '
+ r'attribute \[none defined\]'
+ .format(cls_name)):
+ pkg_broken.urls
+
+ assert pkg.urls[0] == 'https://sourceware.org/pub/' \
+ 'bzip2/bzip2-1.0.8.tar.gz'
+
+
+@pytest.mark.usefixtures('config', 'mock_packages')
+class TestXorgPackage(object):
+
+ def test_define(self):
+ s = Spec('mirror-xorg')
+ s.concretize()
+ pkg = spack.repo.get(s)
+
+ s = Spec('mirror-xorg-broken')
+ s.concretize()
+ pkg_broken = spack.repo.get(s)
+
+ cls_name = type(pkg_broken).__name__
+ with pytest.raises(AttributeError,
+ match=r'{0} must define a `xorg_mirror_path` '
+ r'attribute \[none defined\]'
+ .format(cls_name)):
+ pkg_broken.urls
+
+ assert pkg.urls[0] == 'https://www.x.org/archive/individual/' \
+ 'util/util-macros-1.19.1.tar.bz2'
diff --git a/var/spack/repos/builtin.mock/packages/mirror-gnu-broken/package.py b/var/spack/repos/builtin.mock/packages/mirror-gnu-broken/package.py
new file mode 100644
index 0000000000..d55f57f114
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-gnu-broken/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)
+
+from spack import *
+
+
+class MirrorGnuBroken(AutotoolsPackage, GNUMirrorPackage):
+ """Simple GNU package"""
+
+ homepage = "https://www.gnu.org/software/make/"
+ url = "https://ftpmirror.gnu.org/make/make-4.2.1.tar.gz"
+
+ version('4.2.1', sha256='e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7')
diff --git a/var/spack/repos/builtin.mock/packages/mirror-gnu/package.py b/var/spack/repos/builtin.mock/packages/mirror-gnu/package.py
new file mode 100644
index 0000000000..fe94998e8c
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-gnu/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)
+
+from spack import *
+
+
+class MirrorGnu(AutotoolsPackage, GNUMirrorPackage):
+ """Simple GNU package"""
+
+ homepage = "https://www.gnu.org/software/make/"
+ gnu_mirror_path = "make/make-4.2.1.tar.gz"
+
+ version('4.2.1', sha256='e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7')
diff --git a/var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/mirror-gnu-broken/package.py b/var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/mirror-gnu-broken/package.py
new file mode 100644
index 0000000000..d55f57f114
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/mirror-gnu-broken/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)
+
+from spack import *
+
+
+class MirrorGnuBroken(AutotoolsPackage, GNUMirrorPackage):
+ """Simple GNU package"""
+
+ homepage = "https://www.gnu.org/software/make/"
+ url = "https://ftpmirror.gnu.org/make/make-4.2.1.tar.gz"
+
+ version('4.2.1', sha256='e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7')
diff --git a/var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/package.py b/var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/package.py
new file mode 100644
index 0000000000..82c3d99819
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-sourceware-broken/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)
+
+from spack import *
+
+
+class MirrorSourcewareBroken(AutotoolsPackage, SourcewarePackage):
+ """Simple sourceware.org package"""
+
+ homepage = "https://sourceware.org/bzip2/"
+ url = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
+
+ version('1.0.8', sha256='ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269')
diff --git a/var/spack/repos/builtin.mock/packages/mirror-sourceware/package.py b/var/spack/repos/builtin.mock/packages/mirror-sourceware/package.py
new file mode 100644
index 0000000000..31c4ad2ed7
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-sourceware/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)
+
+from spack import *
+
+
+class MirrorSourceware(AutotoolsPackage, SourcewarePackage):
+ """Simple sourceware.org package"""
+
+ homepage = "https://sourceware.org/bzip2/"
+ sourceware_mirror_path = "bzip2/bzip2-1.0.8.tar.gz"
+
+ version('1.0.8', sha256='ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269')
diff --git a/var/spack/repos/builtin.mock/packages/mirror-xorg-broken/package.py b/var/spack/repos/builtin.mock/packages/mirror-xorg-broken/package.py
new file mode 100644
index 0000000000..42e9a2be2a
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-xorg-broken/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)
+
+from spack import *
+
+
+class MirrorXorgBroken(AutotoolsPackage, XorgPackage):
+ """Simple x.org package"""
+
+ homepage = "http://cgit.freedesktop.org/xorg/util/macros/"
+ url = "https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2"
+
+ version('1.19.1', sha256='18d459400558f4ea99527bc9786c033965a3db45bf4c6a32eefdc07aa9e306a6')
diff --git a/var/spack/repos/builtin.mock/packages/mirror-xorg/package.py b/var/spack/repos/builtin.mock/packages/mirror-xorg/package.py
new file mode 100644
index 0000000000..513eb90780
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/mirror-xorg/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)
+
+from spack import *
+
+
+class MirrorXorg(AutotoolsPackage, XorgPackage):
+ """Simple x.org package"""
+
+ homepage = "http://cgit.freedesktop.org/xorg/util/macros/"
+ xorg_mirror_path = "util/util-macros-1.19.1.tar.bz2"
+
+ version('1.19.1', sha256='18d459400558f4ea99527bc9786c033965a3db45bf4c6a32eefdc07aa9e306a6')