[libcxx-commits] [libcxx] r356558 - [libc++] Mark <filesystem> tests as failing when the dylib doesn't support filesystem

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 20 07:34:01 PDT 2019


Author: ldionne
Date: Wed Mar 20 07:34:00 2019
New Revision: 356558

URL: http://llvm.org/viewvc/llvm-project?rev=356558&view=rev
Log:
[libc++] Mark <filesystem> tests as failing when the dylib doesn't support filesystem

This fixes CI for back-deployment testers on platforms that don't have
<filesystem> support in the dylib.

This is effectively half of https://reviews.llvm.org/D59224. The other
half requires fixes in Clang.

Added:
    libcxx/trunk/test/libcxx/input.output/filesystems/lit.local.cfg
    libcxx/trunk/test/std/input.output/filesystems/lit.local.cfg
Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/fstream
    libcxx/trunk/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
    libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
    libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
    libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
    libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
    libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
    libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
    libcxx/trunk/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp
    libcxx/trunk/utils/libcxx/test/config.py

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Mar 20 07:34:00 2019
@@ -1354,6 +1354,11 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 #  define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR                               \
      __attribute__((availability(macosx,strict,introduced=10.9)))              \
      __attribute__((availability(ios,strict,introduced=7.0)))
+#  define _LIBCPP_AVAILABILITY_FILESYSTEM                                      \
+     __attribute__((availability(macosx,strict,unavailable)))                  \
+     __attribute__((availability(ios,strict,unavailable)))                     \
+     __attribute__((availability(tvos,strict,unavailable)))                    \
+     __attribute__((availability(watchos,strict,unavailable)))
 #else
 #  define _LIBCPP_AVAILABILITY_SHARED_MUTEX
 #  define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
@@ -1365,6 +1370,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 #  define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
 #  define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
 #  define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+#  define _LIBCPP_AVAILABILITY_FILESYSTEM
 #endif
 
 // Define availability that depends on _LIBCPP_NO_EXCEPTIONS.

Modified: libcxx/trunk/include/fstream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/fstream?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/include/fstream (original)
+++ libcxx/trunk/include/fstream Wed Mar 20 07:34:00 2019
@@ -235,7 +235,7 @@ public:
     basic_filebuf* open(const string& __s, ios_base::openmode __mode);
 
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
       return open(__p.c_str(), __mode);
     }
@@ -757,7 +757,7 @@ basic_filebuf<_CharT, _Traits>::underflo
                                        this->eback() + __ibs_, __inext);
                 if (__r == codecvt_base::noconv)
                 {
-                    this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, 
+                    this->setg((char_type*)__extbuf_, (char_type*)__extbuf_,
                                           (char_type*)const_cast<char *>(__extbufend_));
                     __c = traits_type::to_int_type(*this->gptr());
                 }
@@ -1151,7 +1151,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
     explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
       : basic_ifstream(__p.c_str(), __mode) {}
 #endif // _LIBCPP_STD_VER >= 17
@@ -1177,7 +1177,7 @@ public:
 #endif
     void open(const string& __s, ios_base::openmode __mode = ios_base::in);
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     void open(const filesystem::path& __p,
               ios_base::openmode __mode = ios_base::in) {
       return open(__p.c_str(), __mode);
@@ -1365,7 +1365,7 @@ public:
     explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
 
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
       : basic_ofstream(__p.c_str(), __mode) {}
 #endif // _LIBCPP_STD_VER >= 17
@@ -1392,7 +1392,7 @@ public:
     void open(const string& __s, ios_base::openmode __mode = ios_base::out);
 
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
     { return open(__p.c_str(), __mode); }
 #endif // _LIBCPP_STD_VER >= 17
@@ -1579,7 +1579,7 @@ public:
     explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
       : basic_fstream(__p.c_str(), __mode) {}
 #endif // _LIBCPP_STD_VER >= 17
@@ -1607,7 +1607,7 @@ public:
     void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 
 #if _LIBCPP_STD_VER >= 17
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
     void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
     { return open(__p.c_str(), __mode); }
 #endif // _LIBCPP_STD_VER >= 17

Added: libcxx/trunk/test/libcxx/input.output/filesystems/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/input.output/filesystems/lit.local.cfg?rev=356558&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/input.output/filesystems/lit.local.cfg (added)
+++ libcxx/trunk/test/libcxx/input.output/filesystems/lit.local.cfg Wed Mar 20 07:34:00 2019
@@ -0,0 +1,3 @@
+# Disable all of the filesystem tests if the dylib under test doesn't support them.
+if 'dylib-has-no-filesystem' in config.available_features:
+  config.unsupported = True

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Modified: libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
 
 // <fstream>
 

Added: libcxx/trunk/test/std/input.output/filesystems/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/lit.local.cfg?rev=356558&view=auto
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/lit.local.cfg (added)
+++ libcxx/trunk/test/std/input.output/filesystems/lit.local.cfg Wed Mar 20 07:34:00 2019
@@ -0,0 +1,3 @@
+# Disable all of the filesystem tests if the dylib under test doesn't support them.
+if 'dylib-has-no-filesystem' in config.available_features:
+  config.unsupported = True

Modified: libcxx/trunk/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp Wed Mar 20 07:34:00 2019
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// XFAIL: dylib-has-no-filesystem
 
 // <chrono>
 

Modified: libcxx/trunk/utils/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=356558&r1=356557&r2=356558&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/config.py (original)
+++ libcxx/trunk/utils/libcxx/test/config.py Wed Mar 20 07:34:00 2019
@@ -1151,6 +1151,10 @@ class Configuration(object):
 
                 self.config.available_features.add('dylib-has-no-bad_any_cast')
                 self.lit_config.note("throwing bad_any_cast is not supported by the deployment target")
+            # Filesystem is not supported on Apple platforms yet
+            if name == 'macosx':
+                self.config.available_features.add('dylib-has-no-filesystem')
+                self.lit_config.note("the deployment target does not support the dylib parts of <filesystem>")
         else:
             self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
 




More information about the libcxx-commits mailing list