[libcxx] r348296 - [libcxx] Always enable availability in the lit test suite.

Louis Dionne ldionne at apple.com
Tue Dec 4 11:31:08 PST 2018


Author: ldionne
Date: Tue Dec  4 11:31:08 2018
New Revision: 348296

URL: http://llvm.org/viewvc/llvm-project?rev=348296&view=rev
Log:
[libcxx] Always enable availability in the lit test suite.

Summary:
Running the tests without availability enabled doesn't really make sense:
availability annotations allow catching errors at compile-time instead
of link-time. Running the tests without availability enabled allows
confirming that a test breaks at link-time under some configuration,
but it is more useful to instead check that it should fail at compile-time.

Always enabling availability in the lit test suite will greatly simplify
XFAILs and troubleshooting of failing tests, which is currently a giant
pain because we have these two levels of possible failure: link-time and
compile-time.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D55079

Modified:
    libcxx/trunk/docs/DesignDocs/AvailabilityMarkup.rst
    libcxx/trunk/utils/libcxx/test/config.py

Modified: libcxx/trunk/docs/DesignDocs/AvailabilityMarkup.rst
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/AvailabilityMarkup.rst?rev=348296&r1=348295&r2=348296&view=diff
==============================================================================
--- libcxx/trunk/docs/DesignDocs/AvailabilityMarkup.rst (original)
+++ libcxx/trunk/docs/DesignDocs/AvailabilityMarkup.rst Tue Dec  4 11:31:08 2018
@@ -65,14 +65,12 @@ availability.
   the test-suite against the host system library. Alternatively a path to the
   directory containing a specific prebuilt libc++ can be used, for example:
   `--param=use_system_cxx_lib=/path/to/macOS/10.8/`.
-* The `with_availability` boolean parameter enables the availability markup.
 
 Tests can be marked as XFAIL based on multiple features made available by lit:
 
 
-* if either `use_system_cxx_lib` or `with_availability` is passed to lit,
-  assuming `--param=platform=macosx10.8` is passed as well the following
-  features will be available:
+* if `use_system_cxx_lib` is passed to lit, assuming `--param=platform=macosx10.8`
+  is passed as well the following features will be available:
 
   - availability
   - availability=x86_64

Modified: libcxx/trunk/utils/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=348296&r1=348295&r2=348296&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/config.py (original)
+++ libcxx/trunk/utils/libcxx/test/config.py Tue Dec  4 11:31:08 2018
@@ -133,7 +133,6 @@ class Configuration(object):
         self.configure_cxx()
         self.configure_triple()
         self.configure_deployment()
-        self.configure_availability()
         self.configure_src_root()
         self.configure_obj_root()
         self.configure_cxx_stdlib_under_test()
@@ -311,12 +310,6 @@ class Configuration(object):
         self.lit_config.note(
             "inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
 
-    def configure_availability(self):
-        # See https://libcxx.llvm.org/docs/DesignDocs/AvailabilityMarkup.html
-        self.with_availability = self.get_lit_bool('with_availability', False)
-        self.lit_config.note(
-            "inferred with_availability as: %r" % self.with_availability)
-
     def configure_cxx_stdlib_under_test(self):
         self.cxx_stdlib_under_test = self.get_lit_conf(
             'cxx_stdlib_under_test', 'libc++')
@@ -414,11 +407,10 @@ class Configuration(object):
                 self.add_deployment_feature('with_system_cxx_lib')
 
         # Configure the availability markup checks features.
-        if self.with_availability:
+        if self.use_deployment:
             self.config.available_features.add('availability_markup')
             self.add_deployment_feature('availability_markup')
 
-        if self.use_system_cxx_lib or self.with_availability:
             self.config.available_features.add('availability')
             self.add_deployment_feature('availability')
 
@@ -582,9 +574,6 @@ class Configuration(object):
             self.cxx.flags += ['-arch', arch]
             self.cxx.flags += ['-m' + name + '-version-min=' + version]
 
-        # Disable availability unless explicitly requested
-        if not self.with_availability:
-            self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
         # FIXME(EricWF): variant_size.pass.cpp requires a slightly larger
         # template depth with older Clang versions.
         self.cxx.addFlagIfSupported('-ftemplate-depth=270')




More information about the libcxx-commits mailing list