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")
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)
def xml_to_tester(self, xml_string): """Helper that directly converts an XML string to a MakefileTester.""" test_xml = test_utils._wrap_config_compilers_xml(xml_string) if self.NO_CMAKE: self.skipTest("Skipping cmake test") else: return test_utils.CMakeTester( self, test_utils.get_macros(self._maker, test_xml, "CMake"))
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")
def xml_to_tester(self, xml_string): """Helper that directly converts an XML string to a MakefileTester.""" test_xml = test_utils._wrap_config_compilers_xml(xml_string) return test_utils.MakefileTester( self, test_utils.get_macros(self._maker, test_xml, "Makefile"))