]> Savannah Git Hosting - gnulib.git/commitdiff
tests: skip thread-using tests when threading is disabled
authorJim Meyering <meyering@fb.com>
Sun, 5 Jan 2020 18:25:27 +0000 (10:25 -0800)
committerBruno Haible <bruno@clisp.org>
Sun, 5 Jan 2020 19:49:30 +0000 (20:49 +0100)
sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three
thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each
of those, so they are skipped in this case.
* tests/test-nl_langinfo-mt.c (main): Exit 77 when threading is disabled.
* tests/test-setlocale_null-mt-all.c (main): Likewise.
* tests/test-setlocale_null-mt-one.c (main): Likewise.

ChangeLog
tests/test-nl_langinfo-mt.c
tests/test-setlocale_null-mt-all.c
tests/test-setlocale_null-mt-one.c

index c8a9dbfac87685df4e5024cc2a9e2d55ac37d295..6d5228ed077b04ceadedf42f60da5fec27b4413b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-01-05  Jim Meyering  <meyering@fb.com>
+
+       tests: skip thread-using tests when threading is disabled
+       sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three
+       thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each
+       of those, so they are skipped in this case.
+       * tests/test-nl_langinfo-mt.c (main): Exit 77 when threading is disabled.
+       * tests/test-setlocale_null-mt-all.c (main): Likewise.
+       * tests/test-setlocale_null-mt-one.c (main): Likewise.
+
 2020-01-05  Bruno Haible  <bruno@clisp.org>
 
        tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.
index 55f9db98cea290ff119c948dcee162425e531cf8..de6cd998b7d459890754340b108acbe464482183 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <config.h>
 
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
 /* Specification.  */
 #include <langinfo.h>
 
@@ -236,3 +238,18 @@ main (int argc, char *argv[])
 
   return 0;
 }
+
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
index a4f91d98460b2ce94886cd74bc2cf2f736176073..19bdb55de6cbb4807e15f9e4d19a674f3935583e 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <config.h>
 
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
 /* Specification.  */
 #include <locale.h>
 
@@ -131,6 +133,21 @@ main (int argc, char *argv[])
   return 0;
 }
 
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
+
 /* Without locking, the results of this test would be:
 glibc                OK
 musl libc            crash < 10 sec
index dc9d4aa794292b765e84895992f8c8a0037a6fe1..fd6083a58d15c7731814cdd7bcb1fd4143601ab5 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <config.h>
 
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
 /* Specification.  */
 #include <locale.h>
 
@@ -131,6 +133,21 @@ main (int argc, char *argv[])
   return 0;
 }
 
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
+
 /* Without locking, the results of this test would be:
 glibc                OK
 musl libc            OK