Fixing multimethod test for new platforms
This commit is contained in:
parent
2b4dd8b9af
commit
2b2d4bae4e
@ -100,8 +100,12 @@ def test_target_match(self):
|
|||||||
self.assertEqual(pkg.different_by_target(), target.name)
|
self.assertEqual(pkg.different_by_target(), target.name)
|
||||||
|
|
||||||
pkg = spack.db.get('multimethod='+targets[-1].name)
|
pkg = spack.db.get('multimethod='+targets[-1].name)
|
||||||
|
if len(targets) == 1:
|
||||||
|
self.assertEqual(pkg.different_by_target(), targets[-1].name)
|
||||||
|
else:
|
||||||
self.assertRaises(NoSuchMethodError, pkg.different_by_target)
|
self.assertRaises(NoSuchMethodError, pkg.different_by_target)
|
||||||
|
|
||||||
|
|
||||||
def test_dependency_match(self):
|
def test_dependency_match(self):
|
||||||
pkg = spack.db.get('multimethod^zmpi')
|
pkg = spack.db.get('multimethod^zmpi')
|
||||||
self.assertEqual(pkg.different_by_dep(), 'zmpi')
|
self.assertEqual(pkg.different_by_dep(), 'zmpi')
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
import imp
|
||||||
|
from llnl.util.filesystem import join_path
|
||||||
|
from spack.util.naming import mod_to_class
|
||||||
from spack import *
|
from spack import *
|
||||||
import spack.architecture
|
import spack.architecture
|
||||||
|
|
||||||
@ -103,8 +106,15 @@ def has_a_default(self):
|
|||||||
#
|
#
|
||||||
# Make sure we can switch methods on different target
|
# Make sure we can switch methods on different target
|
||||||
#
|
#
|
||||||
|
# for platform_name in ['cray_xc', 'darwin', 'linux']:
|
||||||
|
# file_path = join_path(spack.platform_path, platform_name)
|
||||||
|
# platform_mod = imp.load_source('spack.platforms', file_path + '.py')
|
||||||
|
# cls = getattr(platform_mod, mod_to_class(platform_name))
|
||||||
|
|
||||||
|
# platform = cls()
|
||||||
platform = spack.architecture.sys_type()
|
platform = spack.architecture.sys_type()
|
||||||
targets = platform.targets.values()
|
targets = platform.targets.values()
|
||||||
|
|
||||||
for target in targets[:-1]:
|
for target in targets[:-1]:
|
||||||
@when('='+target.name)
|
@when('='+target.name)
|
||||||
def different_by_target(self):
|
def different_by_target(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user