unit test : suffixes

This commit is contained in:
alalazo 2016-06-04 18:09:06 +02:00
parent 669caefccb
commit 02cadb882b

View file

@ -135,6 +135,17 @@ def mock_open(filename, mode):
}
}
configuration_suffix = {
'enable': ['tcl'],
'tcl': {
'mpileaks': {
'suffixes': {
'+debug': 'foo',
'~debug': 'bar'
}
}
}
}
class HelperFunctionsTests(unittest.TestCase):
@ -282,6 +293,20 @@ def test_conflicts(self):
spack.modules.CONFIGURATION = configuration_wrong_conflicts
self.assertRaises(SystemExit, self.get_modulefile_content, spec)
def test_suffixes(self):
spack.modules.CONFIGURATION = configuration_suffix
spec = spack.spec.Spec('mpileaks+debug arch=x86-linux')
spec.concretize()
generator = spack.modules.TclModule(spec)
self.assertTrue('foo' in generator.use_name)
spec = spack.spec.Spec('mpileaks~debug arch=x86-linux')
spec.concretize()
generator = spack.modules.TclModule(spec)
self.assertTrue('bar' in generator.use_name)
configuration_dotkit = {
'enable': ['dotkit'],
'dotkit': {