From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id DB309384144C; Tue, 21 Jun 2022 00:09:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB309384144C Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: skip fs last_write_time tests if not available X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 8ce9375d132860d06c856a8ec45107f19ccf90cc X-Git-Newrev: f77a86a191fc99e3b43a5c482d1f5b63ce143463 Message-Id: <20220621000911.DB309384144C@sourceware.org> Date: Tue, 21 Jun 2022 00:09:11 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2022 00:09:12 -0000 https://gcc.gnu.org/g:f77a86a191fc99e3b43a5c482d1f5b63ce143463 commit f77a86a191fc99e3b43a5c482d1f5b63ce143463 Author: Alexandre Oliva Date: Mon Jun 20 20:44:03 2022 -0300 libstdc++: testsuite: skip fs last_write_time tests if not available The last_write_time functions are defined in ways that are useful, or that fail immediately, depending on various macros. When they fail immediately, the filesystem last_write_time.cc tests fail noisily, but the fail is entirely expected. Define HAVE_LWT in the last_write_time.cc tests, according to the macros that select implementations of last_write_time, and use it to skip tests that are expected to fail. for libstdc++-v3/ChangeLog * testsuite/27_io/filesystem/operations/last_write_time.cc: Skip the test if the features are unavailable. * testsuite/experimental/filesystem/operations/last_write_time.cc: Likewise. TN: V527-033 Diff: --- .../testsuite/27_io/filesystem/operations/last_write_time.cc | 11 +++++++++++ .../experimental/filesystem/operations/last_write_time.cc | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc b/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc index 7d6468a5124..ecdd45d6ac9 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc @@ -33,6 +33,14 @@ #endif #include +#if (_GLIBCXX_USE_UTIMENSAT \ + || (_GLIBCXX_USE_UTIME && _GLIBCXX_HAVE_SYS_STAT_H)) \ + && defined (_GLIBCXX_HAVE_SYS_STAT_H) +# define HAVE_LWT 1 +#else +# define HAVE_LWT 0 +#endif + using time_type = std::filesystem::file_time_type; namespace chrono = std::chrono; @@ -209,6 +217,9 @@ test02() int main() { + if (!HAVE_LWT) + return 0; + test01(); test02(); } diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc index 38fafc392ca..562c1114a7f 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc @@ -34,6 +34,14 @@ #endif #include +#if (_GLIBCXX_USE_UTIMENSAT \ + || (_GLIBCXX_USE_UTIME && _GLIBCXX_HAVE_SYS_STAT_H)) \ + && defined (_GLIBCXX_HAVE_SYS_STAT_H) +# define HAVE_LWT 1 +#else +# define HAVE_LWT 0 +#endif + using time_type = std::experimental::filesystem::file_time_type; namespace chrono = std::chrono; @@ -175,6 +183,9 @@ test02() int main() { + if (!HAVE_LWT) + return 0; + test01(); test02(); }