[libcxx-commits] [PATCH] D98026: [libcxx] [test] Fix cross testing for windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 5 03:05:16 PST 2021

mstorsjo created this revision.
Herald added a subscriber: arichardson.
mstorsjo edited the summary of this revision.
mstorsjo added a reviewer: libc++.
mstorsjo added a subscriber: libcxx-commits.
mstorsjo published this revision for review.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.

When cross compiling, the compiler tool doesn't have a .exe suffix.

Make WindowsLocalTI always return True in is_windows. The default implementation of is_windows checks whether the script executes on Windows. We could add separate classes WindowsRemoteTI and MingwRemoteTI, that override the is_windows method, but there shouldn't be any downside to just overriding the is_windows method in the WindowsLocalTI class.

  rG LLVM Github Monorepo



Index: libcxx/utils/libcxx/test/target_info.py
--- libcxx/utils/libcxx/test/target_info.py
+++ libcxx/utils/libcxx/test/target_info.py
@@ -187,6 +187,9 @@
     def __init__(self, full_config):
         super(WindowsLocalTI, self).__init__(full_config)
+    def is_windows(self):
+        return True
 class MingwLocalTI(WindowsLocalTI):
     def __init__(self, full_config):
         super(MingwLocalTI, self).__init__(full_config)
Index: libcxx/utils/libcxx/test/config.py
--- libcxx/utils/libcxx/test/config.py
+++ libcxx/utils/libcxx/test/config.py
@@ -175,7 +175,7 @@
         # Gather various compiler parameters.
         cxx = self.get_lit_conf('cxx_under_test')
         self.cxx_is_clang_cl = cxx is not None and \
-                               os.path.basename(cxx) == 'clang-cl.exe'
+                               os.path.basename(cxx).startswith('clang-cl')
         # If no specific cxx_under_test was given, attempt to infer it as
         # clang++.
         if cxx is None or self.cxx_is_clang_cl:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98026.328462.patch
Type: text/x-patch
Size: 1157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210305/6e91f421/attachment.bin>

More information about the libcxx-commits mailing list