Skip to content

Commit 4a5f371

Browse files
committed
cleanup: remove old code related to gccxml
We don't support gccxml anymore
1 parent 6d4544c commit 4a5f371

10 files changed

+17
-69
lines changed

docs/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ These instructions are only here for historical reasons. `GCC-XML`_ was the tool
4747
to generate the xml files before CastXML existed.
4848

4949
**From version v1.8.0 on, pygccxml uses CastXML by default.
50-
The support for GCC-XML will finally be dropped in pygccxml v2.0.0.**
50+
The support for GCC-XML was finally dropped in pygccxml v2.0.0.**
5151

5252
There are few different ways to install GCC-XML on your system:
5353

src/pygccxml/parser/config.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,12 @@ def compiler(self, compiler):
129129

130130
@property
131131
def xml_generator(self):
132-
"""get xml_generator (gccxml or castxml)"""
132+
"""get xml_generator"""
133133
return self.__xml_generator
134134

135135
@xml_generator.setter
136136
def xml_generator(self, xml_generator):
137-
"""set xml_generator (gccxml or castxml)"""
138-
if "real" in xml_generator:
139-
# Support for gccxml.real from newer gccxml package
140-
# Can be removed once gccxml support is dropped.
141-
xml_generator = "gccxml"
137+
"""set xml_generator"""
142138
self.__xml_generator = xml_generator
143139

144140
@property
@@ -241,9 +237,8 @@ def raise_on_wrong_settings(self):
241237
self.__ensure_dir_exists(self.working_directory, 'working directory')
242238
for idir in self.include_paths:
243239
self.__ensure_dir_exists(idir, 'include directory')
244-
if self.__xml_generator not in ["castxml", "gccxml"]:
245-
msg = ('xml_generator("%s") should either be ' +
246-
'"castxml" or "gccxml".') % self.xml_generator
240+
if self.__xml_generator != "castxml":
241+
msg = f"xml_generator ({self.xml_generator}) can only be 'castxml'"
247242
raise RuntimeError(msg)
248243

249244

unittests/array_bug_tester.py

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,9 @@ def test5(self):
6262
global_ns = declarations.get_global_namespace(
6363
src_reader.read_string(code))
6464
arr_type = global_ns.variable('arr').decl_type
65-
if self.config.xml_generator == "gccxml":
66-
self.assertTrue(
67-
'char [4] const' == arr_type.decl_string,
68-
arr_type.decl_string)
69-
else:
70-
self.assertTrue(
71-
'char const [4]' == arr_type.decl_string,
72-
arr_type.decl_string)
65+
self.assertTrue(
66+
'char const [4]' == arr_type.decl_string,
67+
arr_type.decl_string)
7368
self.assertTrue(
7469
declarations.is_array(arr_type))
7570
self.assertTrue(
@@ -81,14 +76,9 @@ def test6(self):
8176
global_ns = declarations.get_global_namespace(
8277
src_reader.read_string(code))
8378
arr_type = global_ns.variable('arr').decl_type
84-
if self.config.xml_generator == "gccxml":
85-
self.assertTrue(
86-
'char [4] volatile' == arr_type.decl_string,
87-
arr_type.decl_string)
88-
else:
89-
self.assertTrue(
90-
'char volatile [4]' == arr_type.decl_string,
91-
arr_type.decl_string)
79+
self.assertTrue(
80+
'char volatile [4]' == arr_type.decl_string,
81+
arr_type.decl_string)
9282
self.assertTrue(
9383
declarations.is_array(arr_type))
9484
self.assertTrue(
@@ -100,14 +90,9 @@ def test7(self):
10090
global_ns = declarations.get_global_namespace(
10191
src_reader.read_string(code))
10292
arr_type = global_ns.variable('arr').decl_type
103-
if self.config.xml_generator == "gccxml":
104-
self.assertTrue(
105-
'char [4] const volatile' == arr_type.decl_string,
106-
arr_type.decl_string)
107-
else:
108-
self.assertTrue(
109-
'char const volatile [4]' == arr_type.decl_string,
110-
arr_type.decl_string)
93+
self.assertTrue(
94+
'char const volatile [4]' == arr_type.decl_string,
95+
arr_type.decl_string)
11196
self.assertTrue(
11297
declarations.is_array(arr_type))
11398
self.assertTrue(

unittests/test_argument_without_name.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ def test_argument_without_name(self):
3131
3232
"""
3333

34-
if self.config.xml_generator == "gccxml":
35-
return
36-
3734
decls = parser.parse([self.header], self.config)
3835
global_ns = declarations.get_global_namespace(decls)
3936

unittests/test_cpp_standards.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ def test(self):
1919
2020
"""
2121

22-
# Skip this test for gccxml, this is a CastXML feature.
23-
if "gccxml" in self.config.xml_generator:
24-
return True
25-
2622
parser.parse(["cpp_standards.hpp"], self.config)
2723

2824
if platform.system() != 'Windows':

unittests/test_map_gcc5.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ def test_map_gcc5(self):
2828
2929
"""
3030

31-
if self.config.xml_generator == "gccxml":
32-
return
33-
3431
decls = parser.parse([self.header], self.config)
3532
global_ns = declarations.get_global_namespace(decls)
3633

unittests/test_pattern_parser.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ def test_template_split_std_vector(self):
2424
2525
"""
2626

27-
if self.config.xml_generator == "gccxml":
28-
return
29-
3027
decls = parser.parse([self.header], self.config)
3128

3229
for decl in declarations.make_flatten(decls):
@@ -41,9 +38,6 @@ def test_matcher(self):
4138
4239
"""
4340

44-
if self.config.xml_generator == "gccxml":
45-
return
46-
4741
decls = parser.parse([self.header], self.config)
4842
global_ns = declarations.get_global_namespace(decls)
4943
criteria = declarations.declaration_matcher(name="myClass")

unittests/test_smart_pointer.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def __init__(self, *args):
2020
self.global_ns = None
2121

2222
def setUp(self):
23-
if self.config.xml_generator == "gccxml":
24-
return
2523
decls = parser.parse([self.header], self.config)
2624
self.global_ns = declarations.get_global_namespace(decls)
2725

@@ -31,9 +29,6 @@ def test_is_smart_pointer(self):
3129
3230
"""
3331

34-
if self.config.xml_generator == "gccxml":
35-
return
36-
3732
criteria = declarations.declaration_matcher(name="yes1")
3833
decls = declarations.matcher.find(criteria, self.global_ns)
3934
self.assertTrue(
@@ -58,9 +53,6 @@ def test_is_auto_pointer(self):
5853
5954
"""
6055

61-
if self.config.xml_generator == "gccxml":
62-
return
63-
6456
criteria = declarations.declaration_matcher(name="yes2")
6557
decls = declarations.matcher.find(criteria, self.global_ns)
6658
self.assertTrue(
@@ -82,9 +74,6 @@ def test_smart_pointer_value_type(self):
8274
8375
"""
8476

85-
if self.config.xml_generator == "gccxml":
86-
return
87-
8877
criteria = declarations.declaration_matcher(name="yes1")
8978
decls = declarations.matcher.find(criteria, self.global_ns)
9079
vt = declarations.smart_pointer_traits.value_type(decls[0].decl_type)
@@ -96,9 +85,6 @@ def test_auto_pointer_value_type(self):
9685
9786
"""
9887

99-
if self.config.xml_generator == "gccxml":
100-
return
101-
10288
criteria = declarations.declaration_matcher(name="yes2")
10389
decls = declarations.matcher.find(criteria, self.global_ns)
10490
vt = declarations.auto_ptr_traits.value_type(decls[0].decl_type)

unittests/test_va_list_tag_removal.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def __init__(self, *args):
3636

3737
def test_keep_va_list_tag(self):
3838

39-
if "gccxml" in self.config.xml_generator or \
40-
platform.system() == 'Windows':
39+
if platform.system() == 'Windows':
4140
return True
4241

4342
self.config.flags = ["f1"]
@@ -89,8 +88,7 @@ def test_keep_va_list_tag(self):
8988

9089
def test_remove_va_list_tag(self):
9190

92-
if "gccxml" in self.config.xml_generator or \
93-
platform.system() == 'Windows':
91+
if platform.system() == 'Windows':
9492
return True
9593

9694
self.config.flags = []

unittests/xml_generator.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[xml_generator]
2-
# Specify which xml generator you want to use "castxml" or "gccxml"
2+
# Specify which xml generator you want to use. Only "castxml" if allowed (ass gccxml is not supported anymore)
33
# "castxml is the default"
44
xml_generator=
55
# Path to castxml or gccxml executable file

0 commit comments

Comments
 (0)