public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: skip fs last_write_time tests if not available
@ 2022-06-21  0:17 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2022-06-21  0:17 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:d17aab2d8041c6325a2f2c14a6097041748da886

commit d17aab2d8041c6325a2f2c14a6097041748da886
Author: Alexandre Oliva <oliva@adacore.com>
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.

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 <stdio.h>
 
+#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 <stdio.h>
 
+#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();
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: skip fs last_write_time tests if not available
@ 2022-06-22  5:23 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2022-06-22  5:23 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:bfdeb7926de633d639ceea26955ef7af7cc5b94c

commit bfdeb7926de633d639ceea26955ef7af7cc5b94c
Author: Alexandre Oliva <oliva@adacore.com>
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.

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 <stdio.h>
 
+#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 <stdio.h>
 
+#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();
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: skip fs last_write_time tests if not available
@ 2022-06-21  0:09 Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2022-06-21  0:09 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:f77a86a191fc99e3b43a5c482d1f5b63ce143463

commit f77a86a191fc99e3b43a5c482d1f5b63ce143463
Author: Alexandre Oliva <oliva@adacore.com>
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 <stdio.h>
 
+#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 <stdio.h>
 
+#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();
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-22  5:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  0:17 [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: skip fs last_write_time tests if not available Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2022-06-22  5:23 Alexandre Oliva
2022-06-21  0:09 Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).