bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lock tests: skip test when no multithreading is enabled


From: Bruno Haible
Subject: lock tests: skip test when no multithreading is enabled
Date: Sun, 15 Dec 2019 20:05:56 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )

On Minix 3.3, which has no multithreading, the test-lock reports:
  Skipping test: multithreading not enabled
but the test-rwlock1 fails with
  Unexpected outcome 3

This patch fixes it.


2019-12-15  Bruno Haible  <address@hidden>

        lock tests: Skip test when no multithreading is enabled.
        * tests/test-rwlock1.c: Skip the test when no multithreading is enabled.

diff --git a/tests/test-rwlock1.c b/tests/test-rwlock1.c
index 097a60f..ca87fea 100644
--- a/tests/test-rwlock1.c
+++ b/tests/test-rwlock1.c
@@ -21,6 +21,8 @@
 
 #include <config.h>
 
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || 
USE_WINDOWS_THREADS
+
 #include "glthread/lock.h"
 
 #include <errno.h>
@@ -151,3 +153,18 @@ main ()
       sleep (1);
     }
 }
+
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]