remove dead code, cleanup.

This commit is contained in:
Todd Gamblin 2016-06-16 10:44:15 -07:00
parent 8867adf942
commit f60ae61652
2 changed files with 26 additions and 42 deletions

View File

@ -23,7 +23,7 @@ def setUp(self):
def tearDown(self): def tearDown(self):
super(ArchitectureTest, self).tearDown() super(ArchitectureTest, self).tearDown()
def test_dict_functions_for_architecture(self): def test_dict_functions_for_architecture(self):
arch = Arch() arch = Arch()
arch.platform = spack.architecture.sys_type() arch.platform = spack.architecture.sys_type()
@ -46,14 +46,6 @@ def test_dict_functions_for_architecture(self):
self.assertTrue( isinstance(new_arch.target, Target) ) self.assertTrue( isinstance(new_arch.target, Target) )
# def test_platform_class_and_compiler_strategies(self):
# a = CrayXc()
# t = a.operating_system('default_os')
# self.assertEquals(t.compiler_strategy, 'MODULES')
# b = Linux()
# s = b.operating_system('default_os')
# self.assertEquals(s.compiler_strategy, 'PATH')
def test_sys_type(self): def test_sys_type(self):
output_platform_class = sys_type() output_platform_class = sys_type()
my_arch_class = None my_arch_class = None
@ -101,12 +93,12 @@ def test_user_defaults(self):
def test_user_input_combination(self): def test_user_input_combination(self):
os_list = self.platform.operating_sys.keys() os_list = self.platform.operating_sys.keys()
target_list = self.platform.targets.keys() target_list = self.platform.targets.keys()
additional = ["fe", "be", "frontend", "backend"] additional = ["fe", "be", "frontend", "backend"]
os_list.extend(additional) os_list.extend(additional)
target_list.extend(additional) target_list.extend(additional)
combinations = itertools.product(os_list, target_list) combinations = itertools.product(os_list, target_list)
results = [] results = []
for arch in combinations: for arch in combinations:
@ -117,5 +109,4 @@ def test_user_input_combination(self):
results.append(spec.architecture.target == self.platform.target(t)) results.append(spec.architecture.target == self.platform.target(t))
res = all(results) res = all(results)
self.assertTrue(res) self.assertTrue(res)

View File

@ -108,7 +108,8 @@ def test_satisfies_namespace(self):
def test_satisfies_namespaced_dep(self): def test_satisfies_namespaced_dep(self):
"""Ensure spec from same or unspecified namespace satisfies namespace constraint.""" """Ensure spec from same or unspecified namespace satisfies namespace
constraint."""
self.check_satisfies('mpileaks ^builtin.mock.mpich', '^mpich') self.check_satisfies('mpileaks ^builtin.mock.mpich', '^mpich')
self.check_satisfies('mpileaks ^builtin.mock.mpich', '^mpi') self.check_satisfies('mpileaks ^builtin.mock.mpich', '^mpi')
@ -141,29 +142,17 @@ def test_satisfies_compiler_version(self):
def test_satisfies_architecture(self): def test_satisfies_architecture(self):
platform = spack.architecture.sys_type() platform = spack.architecture.sys_type()
self.check_satisfies('foo platform=test target=frontend os=frontend', 'platform=test target=frontend os=frontend') self.check_satisfies(
self.check_satisfies('foo platform=test target=backend os=backend', 'platform=test target=backend', 'platform=test os=backend') 'foo platform=test target=frontend os=frontend',
self.check_satisfies('foo platform=test target=default_target os=default_os','platform=test target=default_target os=default_os') 'platform=test target=frontend os=frontend')
self.check_satisfies(
'foo platform=test target=backend os=backend',
'platform=test target=backend', 'platform=test os=backend')
self.check_satisfies(
'foo platform=test target=default_target os=default_os',
'platform=test target=default_target os=default_os')
#ifdef NEW
#def test_satisfies_architecture(self):
# self.check_satisfies('foo arch=chaos_5_x86_64_ib', ' arch=chaos_5_x86_64_ib')
# self.check_satisfies('foo arch=bgqos_0', ' arch=bgqos_0')
# self.check_unsatisfiable('foo arch=bgqos_0', ' arch=chaos_5_x86_64_ib')
# self.check_unsatisfiable('foo arch=chaos_5_x86_64_ib', ' arch=bgqos_0')
#els#e /* not NEW */
#def test_satisfies_target(self):
# platform = spack.architecture.sys_type()
# targets = platform.targets.values()
# for target in targets:
# self.check_satisfies('foo='+target.name, '='+target.name)
#end#if /* not NEW */
# for i in range(1,len(targets)):
# self.check_unsatisfiable('foo='+targets[i-1].name, '='+targets[i].name)
def test_satisfies_dependencies(self): def test_satisfies_dependencies(self):
self.check_satisfies('mpileaks^mpich', '^mpich') self.check_satisfies('mpileaks^mpich', '^mpich')
self.check_satisfies('mpileaks^zmpi', '^zmpi') self.check_satisfies('mpileaks^zmpi', '^zmpi')
@ -176,10 +165,14 @@ def test_satisfies_dependency_versions(self):
self.check_satisfies('mpileaks^mpich@2.0', '^mpich@1:3') self.check_satisfies('mpileaks^mpich@2.0', '^mpich@1:3')
self.check_unsatisfiable('mpileaks^mpich@1.2', '^mpich@2.0') self.check_unsatisfiable('mpileaks^mpich@1.2', '^mpich@2.0')
self.check_satisfies('mpileaks^mpich@2.0^callpath@1.5', '^mpich@1:3^callpath@1.4:1.6') self.check_satisfies(
self.check_unsatisfiable('mpileaks^mpich@4.0^callpath@1.5', '^mpich@1:3^callpath@1.4:1.6') 'mpileaks^mpich@2.0^callpath@1.5', '^mpich@1:3^callpath@1.4:1.6')
self.check_unsatisfiable('mpileaks^mpich@2.0^callpath@1.7', '^mpich@1:3^callpath@1.4:1.6') self.check_unsatisfiable(
self.check_unsatisfiable('mpileaks^mpich@4.0^callpath@1.7', '^mpich@1:3^callpath@1.4:1.6') 'mpileaks^mpich@4.0^callpath@1.5', '^mpich@1:3^callpath@1.4:1.6')
self.check_unsatisfiable(
'mpileaks^mpich@2.0^callpath@1.7', '^mpich@1:3^callpath@1.4:1.6')
self.check_unsatisfiable(
'mpileaks^mpich@4.0^callpath@1.7', '^mpich@1:3^callpath@1.4:1.6')
def test_satisfies_virtual_dependencies(self): def test_satisfies_virtual_dependencies(self):
@ -390,7 +383,7 @@ def test_invalid_constraint(self):
self.check_invalid_constraint('libelf debug=2', 'libelf debug=1') self.check_invalid_constraint('libelf debug=2', 'libelf debug=1')
self.check_invalid_constraint('libelf cppflags="-O3"', 'libelf cppflags="-O2"') self.check_invalid_constraint('libelf cppflags="-O3"', 'libelf cppflags="-O2"')
self.check_invalid_constraint('libelf platform=test target=be os=be', self.check_invalid_constraint('libelf platform=test target=be os=be',
'libelf target=fe os=fe') 'libelf target=fe os=fe')
def test_constrain_changed(self): def test_constrain_changed(self):
@ -402,7 +395,7 @@ def test_constrain_changed(self):
self.check_constrain_changed('libelf', '~debug') self.check_constrain_changed('libelf', '~debug')
self.check_constrain_changed('libelf', 'debug=2') self.check_constrain_changed('libelf', 'debug=2')
self.check_constrain_changed('libelf', 'cppflags="-O3"') self.check_constrain_changed('libelf', 'cppflags="-O3"')
platform = spack.architecture.sys_type() platform = spack.architecture.sys_type()
self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name) self.check_constrain_changed('libelf', 'target='+platform.target('default_target').name)
self.check_constrain_changed('libelf', 'os='+platform.operating_system('default_os').name) self.check_constrain_changed('libelf', 'os='+platform.operating_system('default_os').name)