Made architecture test robust for more architectures
This commit is contained in:
parent
57ced37229
commit
7e9baf9e25
1 changed files with 11 additions and 17 deletions
|
@ -14,30 +14,24 @@
|
||||||
|
|
||||||
class ArchitectureTest(unittest.TestCase):
|
class ArchitectureTest(unittest.TestCase):
|
||||||
|
|
||||||
def test_to_dict_function_with_architecture(self):
|
def test_dict_functions_for_architecture(self):
|
||||||
arch = Arch()
|
arch = Arch()
|
||||||
arch.platform_os = arch.platform.operating_system('default_os')
|
arch.platform_os = arch.platform.operating_system('default_os')
|
||||||
arch.target = arch.platform.target('default')
|
arch.target = arch.platform.target('default')
|
||||||
|
|
||||||
d = arch.to_dict()
|
d = arch.to_dict()
|
||||||
self.assertEqual(d, {'platform' : 'crayxc',
|
|
||||||
'platform_os' : {'name': 'CNL',
|
|
||||||
'compiler_strategy' : 'MODULES',
|
|
||||||
'version':'10'},
|
|
||||||
'target' : {'name': 'haswell',
|
|
||||||
'module_name': 'craype-haswell'}})
|
|
||||||
|
|
||||||
def test_from_dict_function_with_architecture(self):
|
new_arch = spack.architecture.arch_from_dict(d)
|
||||||
d = {'platform':'crayxc',
|
self.assertEqual(arch, new_arch)
|
||||||
'platform_os' : {'name' : 'CNL', 'compiler_strategy': 'MODULES',
|
|
||||||
'version': '10'},
|
|
||||||
'target' : {'name':'haswell', 'module_name': 'craype-haswell'}}
|
|
||||||
|
|
||||||
arch = spack.architecture.arch_from_dict(d)
|
|
||||||
self.assertTrue( isinstance(arch, Arch) )
|
self.assertTrue( isinstance(arch, Arch) )
|
||||||
self.assertTrue( isinstance(arch.platform, Platform) )
|
self.assertTrue( isinstance(arch.platform, Platform) )
|
||||||
self.assertTrue( isinstance(arch.platform_os, OperatingSystem) )
|
self.assertTrue( isinstance(arch.platform_os, OperatingSystem) )
|
||||||
self.assertTrue( isinstance(arch.target, Target) )
|
self.assertTrue( isinstance(arch.target, Target) )
|
||||||
|
self.assertTrue( isinstance(new_arch, Arch) )
|
||||||
|
self.assertTrue( isinstance(new_arch.platform, Platform) )
|
||||||
|
self.assertTrue( isinstance(new_arch.platform_os, OperatingSystem) )
|
||||||
|
self.assertTrue( isinstance(new_arch.target, Target) )
|
||||||
|
|
||||||
|
|
||||||
def test_platform_class_and_compiler_strategies(self):
|
def test_platform_class_and_compiler_strategies(self):
|
||||||
|
|
Loading…
Reference in a new issue