unit test : suffixes
This commit is contained in:
parent
669caefccb
commit
02cadb882b
@ -135,6 +135,17 @@ def mock_open(filename, mode):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configuration_suffix = {
|
||||||
|
'enable': ['tcl'],
|
||||||
|
'tcl': {
|
||||||
|
'mpileaks': {
|
||||||
|
'suffixes': {
|
||||||
|
'+debug': 'foo',
|
||||||
|
'~debug': 'bar'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class HelperFunctionsTests(unittest.TestCase):
|
class HelperFunctionsTests(unittest.TestCase):
|
||||||
|
|
||||||
@ -282,6 +293,20 @@ def test_conflicts(self):
|
|||||||
spack.modules.CONFIGURATION = configuration_wrong_conflicts
|
spack.modules.CONFIGURATION = configuration_wrong_conflicts
|
||||||
self.assertRaises(SystemExit, self.get_modulefile_content, spec)
|
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 = {
|
configuration_dotkit = {
|
||||||
'enable': ['dotkit'],
|
'enable': ['dotkit'],
|
||||||
'dotkit': {
|
'dotkit': {
|
||||||
|
Loading…
Reference in New Issue
Block a user