Exemplo n.º 1
0
 def test_script_is_callable(self):
     """The test script can be called on valid output without dying."""
     # This is really more a smoke test of this script than anything else.
     maker = Compilers(test_utils.MockMachines("mymachine", "SomeOS"),
                       version=2.0)
     test_xml = test_utils._wrap_config_compilers_xml(
         "<compiler><SUPPORTS_CXX>FALSE</SUPPORTS_CXX></compiler>")
     test_utils.get_macros(maker, test_xml, "Makefile")
Exemplo n.º 2
0
 def test_script_rejects_bad_build_system(self):
     """The macro writer rejects a bad build system string."""
     maker = Compilers(test_utils.MockMachines("mymachine", "SomeOS"),
                       version=2.0)
     bad_string = "argle-bargle."
     with self.assertRaisesRegex(
             utils.CIMEError,
             "Unrecognized build system provided to write_macros: " +
             bad_string,
     ):
         test_utils.get_macros(maker, "This string is irrelevant.",
                               bad_string)
Exemplo n.º 3
0
    def setUp(self):
        self.test_os = "SomeOS"
        self.test_machine = "mymachine"
        self.test_compiler = (self.MACHINE.get_default_compiler()
                              if self.TEST_COMPILER is None else
                              self.TEST_COMPILER)
        self.test_mpilib = (self.MACHINE.get_default_MPIlib(
            attributes={"compiler": self.test_compiler})
                            if self.TEST_MPILIB is None else self.TEST_MPILIB)

        self._maker = Compilers(test_utils.MockMachines(
            self.test_machine, self.test_os),
                                version=2.0)

        super().setUp()
Exemplo n.º 4
0
    def setUp(self):
        super().setUp()

        if "CIME_NO_CMAKE_MACRO" not in os.environ:
            self.skipTest("Skipping test of old macro system")

        self.test_os = "SomeOS"
        self.test_machine = "mymachine"
        self.test_compiler = (self.MACHINE.get_default_compiler()
                              if self.TEST_COMPILER is None else
                              self.TEST_COMPILER)
        self.test_mpilib = (self.MACHINE.get_default_MPIlib(
            attributes={"compiler": self.test_compiler})
                            if self.TEST_MPILIB is None else self.TEST_MPILIB)

        self._maker = Compilers(test_utils.MockMachines(
            self.test_machine, self.test_os),
                                version=2.0)
Exemplo n.º 5
0
 def test_script_rejects_bad_xml(self):
     """The macro writer rejects input that's not valid XML."""
     maker = Compilers(test_utils.MockMachines("mymachine", "SomeOS"),
                       version=2.0)
     with self.assertRaises(ParseError):
         test_utils.get_macros(maker, "This is not valid XML.", "Makefile")