[libcxx-commits] [PATCH] D99177: [libcxx] [test] Fix testing on windows with c++experimental enabled

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 23 06:09:39 PDT 2021


mstorsjo updated this revision to Diff 332648.
mstorsjo added a comment.

As it's too late to update link_flags after running `newconfig.configure`, add a simplified form of conditional logic in a lambda instead. This lambda requires knowledge about what kind of library naming/linking form is going to be used though, which is (not nicely) passed via a flag in available_features.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99177/new/

https://reviews.llvm.org/D99177

Files:
  libcxx/utils/libcxx/test/config.py
  libcxx/utils/libcxx/test/params.py


Index: libcxx/utils/libcxx/test/params.py
===================================================================
--- libcxx/utils/libcxx/test/params.py
+++ libcxx/utils/libcxx/test/params.py
@@ -90,7 +90,7 @@
             help="Whether to enable tests for experimental C++ libraries (typically Library Fundamentals TSes).",
             actions=lambda experimental: [] if not experimental else [
               AddFeature('c++experimental'),
-              AddLinkFlag('-lc++experimental')
+              AddLinkFlag(lambda config: '-llibc++experimental' if 'msvc' in config.available_features else '-lc++experimental')
             ]),
 
   Parameter(name='long_tests', choices=[True, False], type=bool, default=True,
Index: libcxx/utils/libcxx/test/config.py
===================================================================
--- libcxx/utils/libcxx/test/config.py
+++ libcxx/utils/libcxx/test/config.py
@@ -249,6 +249,11 @@
                 # and regressions. Note: New failures should not be suppressed
                 # using this feature. (Also see llvm.org/PR32730)
                 self.config.available_features.add('LIBCXX-WINDOWS-FIXME')
+            if not self.target_info.is_mingw():
+                # The feature 'windows' gets set by DEFAULT_FEATURES later,
+                # after processing DEFAULT_PARAMETERS which needs to be able
+                # to check this detail.
+                self.config.available_features.add('msvc')
 
         target_triple = getattr(self.config, 'target_triple', None)
         if target_triple:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99177.332648.patch
Type: text/x-patch
Size: 1551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210323/d38c6b10/attachment-0001.bin>


More information about the libcxx-commits mailing list