+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.
#include <config.h>
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
/* Specification. */
#include <langinfo.h>
return 0;
}
+
+#else
+
+/* No multithreading available. */
+
+#include <stdio.h>
+
+int
+main ()
+{
+ fputs ("Skipping test: multithreading not enabled\n", stderr);
+ return 77;
+}
+
+#endif
#include <config.h>
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
/* Specification. */
#include <locale.h>
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
#include <config.h>
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
/* Specification. */
#include <locale.h>
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