summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-09-30 20:48:57 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commitc065245f14492eb661fe5f9d73de64866ad9efbd (patch)
treeac11ec589e5b2470070bd7a2a004e941e220af54 /lib
parent2ea8bd0b195daa31be2d87995f2cab24cf91276f (diff)
downloadspack-c065245f14492eb661fe5f9d73de64866ad9efbd.tar.gz
spack-c065245f14492eb661fe5f9d73de64866ad9efbd.tar.bz2
spack-c065245f14492eb661fe5f9d73de64866ad9efbd.tar.xz
spack-c065245f14492eb661fe5f9d73de64866ad9efbd.zip
Fixed failing unit tests
- Tests based on TestArchitecture - Tests on non-buildable external
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/platforms/test.py6
-rw-r--r--lib/spack/spack/test/concretize.py15
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/spack/spack/platforms/test.py b/lib/spack/spack/platforms/test.py
index 9c6143946e..f938eb749d 100644
--- a/lib/spack/spack/platforms/test.py
+++ b/lib/spack/spack/platforms/test.py
@@ -14,9 +14,9 @@ class Test(Platform):
if platform.system().lower() == 'darwin':
binary_formats = ['macho']
- front_end = 'x86_64'
- back_end = 'broadwell'
- default = 'broadwell'
+ front_end = 'x86_64'
+ back_end = 'core2'
+ default = 'core2'
front_os = 'redhat6'
back_os = 'debian6'
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
index da7a5b5a52..80938ca50a 100644
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -99,9 +99,10 @@ def current_host(request, monkeypatch):
# this function is memoized, so clear its state for testing
spack.architecture.get_platform.cache.clear()
+ monkeypatch.setattr(spack.platforms.test.Test, 'default', cpu)
+ monkeypatch.setattr(spack.platforms.test.Test, 'front_end', cpu)
if not is_preference:
monkeypatch.setattr(archspec.cpu, 'host', lambda: target)
- monkeypatch.setattr(spack.platforms.test.Test, 'default', cpu)
yield target
else:
with spack.config.override('packages:all', {'target': [cpu]}):
@@ -380,13 +381,12 @@ class TestConcretize(object):
assert spec['externalmodule'].compiler.satisfies('gcc')
def test_nobuild_package(self):
- got_error = False
+ """Test that a non-buildable package raise an error if no specs
+ in packages.yaml are compatible with the request.
+ """
spec = Spec('externaltool%clang')
- try:
+ with pytest.raises(spack.error.SpecError):
spec.concretize()
- except spack.concretize.NoBuildError:
- got_error = True
- assert got_error
def test_external_and_virtual(self):
spec = Spec('externaltest')
@@ -634,7 +634,7 @@ class TestConcretize(object):
else current_host
with spack.concretize.disable_compiler_existence_check():
s = Spec(spec).concretized()
- assert str(s.architecture.target) == str(expected)
+ assert str(s.architecture.target) == str(expected), str(best_achievable)
@pytest.mark.regression('8735,14730')
def test_compiler_version_matches_any_entry_in_compilers_yaml(self):
@@ -643,6 +643,7 @@ class TestConcretize(object):
with pytest.raises(spack.concretize.UnavailableCompilerVersionError):
s = Spec('mpileaks %gcc@4.5')
s.concretize()
+ pass
# An abstract compiler with a version list could resolve to 4.5.0
s = Spec('mpileaks %gcc@4.5:')