diff --git a/docs/install.rst b/docs/install.rst index 75913ec2..84666348 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -47,7 +47,7 @@ These instructions are only here for historical reasons. `GCC-XML`_ was the tool to generate the xml files before CastXML existed. **From version v1.8.0 on, pygccxml uses CastXML by default. -The support for GCC-XML will finally be dropped in pygccxml v2.0.0.** +The support for GCC-XML was finally dropped in pygccxml v2.0.0.** There are few different ways to install GCC-XML on your system: diff --git a/src/pygccxml/parser/config.py b/src/pygccxml/parser/config.py index e2db56d8..1032b54e 100644 --- a/src/pygccxml/parser/config.py +++ b/src/pygccxml/parser/config.py @@ -129,16 +129,12 @@ def compiler(self, compiler): @property def xml_generator(self): - """get xml_generator (gccxml or castxml)""" + """get xml_generator""" return self.__xml_generator @xml_generator.setter def xml_generator(self, xml_generator): - """set xml_generator (gccxml or castxml)""" - if "real" in xml_generator: - # Support for gccxml.real from newer gccxml package - # Can be removed once gccxml support is dropped. - xml_generator = "gccxml" + """set xml_generator""" self.__xml_generator = xml_generator @property @@ -241,9 +237,8 @@ def raise_on_wrong_settings(self): self.__ensure_dir_exists(self.working_directory, 'working directory') for idir in self.include_paths: self.__ensure_dir_exists(idir, 'include directory') - if self.__xml_generator not in ["castxml", "gccxml"]: - msg = ('xml_generator("%s") should either be ' + - '"castxml" or "gccxml".') % self.xml_generator + if self.__xml_generator != "castxml": + msg = f"xml_generator ({self.xml_generator}) can only be 'castxml'" raise RuntimeError(msg) diff --git a/unittests/array_bug_tester.py b/unittests/array_bug_tester.py index d811e701..bb748f77 100644 --- a/unittests/array_bug_tester.py +++ b/unittests/array_bug_tester.py @@ -62,14 +62,9 @@ def test5(self): global_ns = declarations.get_global_namespace( src_reader.read_string(code)) arr_type = global_ns.variable('arr').decl_type - if self.config.xml_generator == "gccxml": - self.assertTrue( - 'char [4] const' == arr_type.decl_string, - arr_type.decl_string) - else: - self.assertTrue( - 'char const [4]' == arr_type.decl_string, - arr_type.decl_string) + self.assertTrue( + 'char const [4]' == arr_type.decl_string, + arr_type.decl_string) self.assertTrue( declarations.is_array(arr_type)) self.assertTrue( @@ -81,14 +76,9 @@ def test6(self): global_ns = declarations.get_global_namespace( src_reader.read_string(code)) arr_type = global_ns.variable('arr').decl_type - if self.config.xml_generator == "gccxml": - self.assertTrue( - 'char [4] volatile' == arr_type.decl_string, - arr_type.decl_string) - else: - self.assertTrue( - 'char volatile [4]' == arr_type.decl_string, - arr_type.decl_string) + self.assertTrue( + 'char volatile [4]' == arr_type.decl_string, + arr_type.decl_string) self.assertTrue( declarations.is_array(arr_type)) self.assertTrue( @@ -100,14 +90,9 @@ def test7(self): global_ns = declarations.get_global_namespace( src_reader.read_string(code)) arr_type = global_ns.variable('arr').decl_type - if self.config.xml_generator == "gccxml": - self.assertTrue( - 'char [4] const volatile' == arr_type.decl_string, - arr_type.decl_string) - else: - self.assertTrue( - 'char const volatile [4]' == arr_type.decl_string, - arr_type.decl_string) + self.assertTrue( + 'char const volatile [4]' == arr_type.decl_string, + arr_type.decl_string) self.assertTrue( declarations.is_array(arr_type)) self.assertTrue( diff --git a/unittests/test_argument_without_name.py b/unittests/test_argument_without_name.py index 08ce1ed2..be161a7f 100644 --- a/unittests/test_argument_without_name.py +++ b/unittests/test_argument_without_name.py @@ -31,9 +31,6 @@ def test_argument_without_name(self): """ - if self.config.xml_generator == "gccxml": - return - decls = parser.parse([self.header], self.config) global_ns = declarations.get_global_namespace(decls) diff --git a/unittests/test_cpp_standards.py b/unittests/test_cpp_standards.py index eb284189..1eb5a3fb 100644 --- a/unittests/test_cpp_standards.py +++ b/unittests/test_cpp_standards.py @@ -19,10 +19,6 @@ def test(self): """ - # Skip this test for gccxml, this is a CastXML feature. - if "gccxml" in self.config.xml_generator: - return True - parser.parse(["cpp_standards.hpp"], self.config) if platform.system() != 'Windows': diff --git a/unittests/test_map_gcc5.py b/unittests/test_map_gcc5.py index 49d3340e..bf579e2f 100644 --- a/unittests/test_map_gcc5.py +++ b/unittests/test_map_gcc5.py @@ -28,9 +28,6 @@ def test_map_gcc5(self): """ - if self.config.xml_generator == "gccxml": - return - decls = parser.parse([self.header], self.config) global_ns = declarations.get_global_namespace(decls) diff --git a/unittests/test_pattern_parser.py b/unittests/test_pattern_parser.py index 00a6805d..0567db88 100644 --- a/unittests/test_pattern_parser.py +++ b/unittests/test_pattern_parser.py @@ -24,9 +24,6 @@ def test_template_split_std_vector(self): """ - if self.config.xml_generator == "gccxml": - return - decls = parser.parse([self.header], self.config) for decl in declarations.make_flatten(decls): @@ -41,9 +38,6 @@ def test_matcher(self): """ - if self.config.xml_generator == "gccxml": - return - decls = parser.parse([self.header], self.config) global_ns = declarations.get_global_namespace(decls) criteria = declarations.declaration_matcher(name="myClass") diff --git a/unittests/test_smart_pointer.py b/unittests/test_smart_pointer.py index e9183b74..9335debe 100644 --- a/unittests/test_smart_pointer.py +++ b/unittests/test_smart_pointer.py @@ -20,8 +20,6 @@ def __init__(self, *args): self.global_ns = None def setUp(self): - if self.config.xml_generator == "gccxml": - return decls = parser.parse([self.header], self.config) self.global_ns = declarations.get_global_namespace(decls) @@ -31,9 +29,6 @@ def test_is_smart_pointer(self): """ - if self.config.xml_generator == "gccxml": - return - criteria = declarations.declaration_matcher(name="yes1") decls = declarations.matcher.find(criteria, self.global_ns) self.assertTrue( @@ -58,9 +53,6 @@ def test_is_auto_pointer(self): """ - if self.config.xml_generator == "gccxml": - return - criteria = declarations.declaration_matcher(name="yes2") decls = declarations.matcher.find(criteria, self.global_ns) self.assertTrue( @@ -82,9 +74,6 @@ def test_smart_pointer_value_type(self): """ - if self.config.xml_generator == "gccxml": - return - criteria = declarations.declaration_matcher(name="yes1") decls = declarations.matcher.find(criteria, self.global_ns) vt = declarations.smart_pointer_traits.value_type(decls[0].decl_type) @@ -96,9 +85,6 @@ def test_auto_pointer_value_type(self): """ - if self.config.xml_generator == "gccxml": - return - criteria = declarations.declaration_matcher(name="yes2") decls = declarations.matcher.find(criteria, self.global_ns) vt = declarations.auto_ptr_traits.value_type(decls[0].decl_type) diff --git a/unittests/test_va_list_tag_removal.py b/unittests/test_va_list_tag_removal.py index ed0e3742..8cbfea5d 100644 --- a/unittests/test_va_list_tag_removal.py +++ b/unittests/test_va_list_tag_removal.py @@ -36,8 +36,7 @@ def __init__(self, *args): def test_keep_va_list_tag(self): - if "gccxml" in self.config.xml_generator or \ - platform.system() == 'Windows': + if platform.system() == 'Windows': return True self.config.flags = ["f1"] @@ -89,8 +88,7 @@ def test_keep_va_list_tag(self): def test_remove_va_list_tag(self): - if "gccxml" in self.config.xml_generator or \ - platform.system() == 'Windows': + if platform.system() == 'Windows': return True self.config.flags = [] diff --git a/unittests/xml_generator.cfg b/unittests/xml_generator.cfg index cb00818e..e47153ba 100644 --- a/unittests/xml_generator.cfg +++ b/unittests/xml_generator.cfg @@ -1,5 +1,5 @@ [xml_generator] -# Specify which xml generator you want to use "castxml" or "gccxml" +# Specify which xml generator you want to use. Only "castxml" if allowed (ass gccxml is not supported anymore) # "castxml is the default" xml_generator= # Path to castxml or gccxml executable file