]> granicus.if.org Git - python/commitdiff
bpo-11191: skip unsupported test_distutils case for AIX with xlc (GH-8709)
authorMichael Felt <aixtools@users.noreply.github.com>
Fri, 28 Dec 2018 14:03:17 +0000 (15:03 +0100)
committerNick Coghlan <ncoghlan@gmail.com>
Fri, 28 Dec 2018 14:03:17 +0000 (00:03 +1000)
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)

Lib/distutils/command/config.py
Lib/distutils/tests/test_config_cmd.py
Misc/NEWS.d/next/Tests/2018-08-08-22-41-30.bpo-11191.eq9tSH.rst [new file with mode: 0644]

index f511b888577066c4a1c5a679ab5d05757a1edc24..aeda408e731979bf5884e4830fed142a70bfb25e 100644 (file)
@@ -328,7 +328,6 @@ class config(Command):
         return self.try_cpp(body="/* No body */", headers=[header],
                             include_dirs=include_dirs)
 
-
 def dump_file(filename, head=None):
     """Dumps a file content into log.info.
 
index 6e566e79152a54a09cb8753095df49dba76f0339..b735fd334d87805d0693e71885e18f985311b069 100644 (file)
@@ -39,11 +39,17 @@ class ConfigTestCase(support.LoggingSilencer,
 
     @unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
     def test_search_cpp(self):
+        import shutil
         cmd = missing_compiler_executable(['preprocessor'])
         if cmd is not None:
             self.skipTest('The %r command is not found' % cmd)
         pkg_dir, dist = self.create_dist()
         cmd = config(dist)
+        cmd._check_compiler()
+        compiler = cmd.compiler
+        is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac")
+        if is_xlc:
+            self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options')
 
         # simple pattern searches
         match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
diff --git a/Misc/NEWS.d/next/Tests/2018-08-08-22-41-30.bpo-11191.eq9tSH.rst b/Misc/NEWS.d/next/Tests/2018-08-08-22-41-30.bpo-11191.eq9tSH.rst
new file mode 100644 (file)
index 0000000..d05d522
--- /dev/null
@@ -0,0 +1,2 @@
+Skip the distutils test 'test_search_cpp' when using XLC as compiler
+patch by aixtools (Michael Felt)