diff options
author | Mario Melara <maamelara@gmail.com> | 2016-02-22 14:54:30 -0800 |
---|---|---|
committer | Mario Melara <maamelara@gmail.com> | 2016-02-22 14:54:30 -0800 |
commit | a385dae1aee6b7624707f42af8a6c52b9d9889bd (patch) | |
tree | a5224c664fff45d7360f411c93fb2fed04942514 /lib | |
parent | 1367ccab93e6263e11477abe7ea05f1ad74d88a2 (diff) | |
download | spack-a385dae1aee6b7624707f42af8a6c52b9d9889bd.tar.gz spack-a385dae1aee6b7624707f42af8a6c52b9d9889bd.tar.bz2 spack-a385dae1aee6b7624707f42af8a6c52b9d9889bd.tar.xz spack-a385dae1aee6b7624707f42af8a6c52b9d9889bd.zip |
Unit tests to test operating system subclass creation and whether compiler strategy is set correctly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/operating_system.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/spack/spack/test/operating_system.py b/lib/spack/spack/test/operating_system.py new file mode 100644 index 0000000000..9d6850bfa6 --- /dev/null +++ b/lib/spack/spack/test/operating_system.py @@ -0,0 +1,41 @@ +""" Test checks if the operating_system class is created correctly and that +the functions are using the correct operating_system. Also checks whether +the operating_system correctly uses the compiler_strategy +""" + +import unittest +import os +import platform +from spack.platforms.cray_xc import CrayXc +from spack.platforms.linux import Linux +from spack.platforms.darwin import Darwin +from spack.operating_system.linux_distro import LinuxDistro +from spack.operating_system.mac_osx import MacOSX + +class TestOperatingSystem(unittest.TestCase): + + def setUp(self): + cray_xc = CrayXc() + linux = Linux() + darwin = Darwin() + self.cray_operating_sys = cray_xc.operating_system('front_os') + self.darwin_operating_sys = darwin.operating_system('default_os') + self.linux_operating_sys = linux.operating_system('default_os') + + def test_cray_front_end_operating_system(self): + self.assertIsInstance(self.cray_operating_sys, LinuxDistro) + + def test_cray_front_end_compiler_strategy(self): + self.assertEquals(self.cray_operating_sys.compiler_strategy, "PATH") + + def test_linux_operating_system(self): + print self.linux_operating_sys + self.assertIsInstance(self.linux_operating_sys, LinuxDistro) + + def test_linux_compiler_strategy(self): + self.assertEquals(self.linux_operating_sys.compiler_strategy, "PATH") + + + + + |