Skip to content

Commit ed57e13

Browse files
aixtoolsncoghlan
authored andcommitted
bpo-11191: skip unsupported test_distutils case for AIX with xlc (GH-8709)
Command line options for the xlc compiler behave differently from gcc and clang, so skip this test case for now when xlc is the compiler. Patch by aixtools (Michael Felt)
1 parent e2926b7 commit ed57e13

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Lib/distutils/command/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ def check_header(self, header, include_dirs=None, library_dirs=None,
328328
return self.try_cpp(body="/* No body */", headers=[header],
329329
include_dirs=include_dirs)
330330

331-
332331
def dump_file(filename, head=None):
333332
"""Dumps a file content into log.info.
334333

Lib/distutils/tests/test_config_cmd.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ def test_dump_file(self):
3939

4040
@unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
4141
def test_search_cpp(self):
42+
import shutil
4243
cmd = missing_compiler_executable(['preprocessor'])
4344
if cmd is not None:
4445
self.skipTest('The %r command is not found' % cmd)
4546
pkg_dir, dist = self.create_dist()
4647
cmd = config(dist)
48+
cmd._check_compiler()
49+
compiler = cmd.compiler
50+
is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac")
51+
if is_xlc:
52+
self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options')
4753

4854
# simple pattern searches
4955
match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Skip the distutils test 'test_search_cpp' when using XLC as compiler
2+
patch by aixtools (Michael Felt)

0 commit comments

Comments
 (0)