[Glibc-bsd-commits] r6168 - trunk/glibc-ports-2.25/fbtl

aurel32 at alioth.debian.org aurel32 at alioth.debian.org
Fri Aug 4 19:22:00 UTC 2017


Author: aurel32
Date: 2017-08-04 19:22:00 +0000 (Fri, 04 Aug 2017)
New Revision: 6168

Modified:
   trunk/glibc-ports-2.25/fbtl/tst-cond3.c
   trunk/glibc-ports-2.25/fbtl/tst-eintr1.c
   trunk/glibc-ports-2.25/fbtl/tst-eintr2.c
   trunk/glibc-ports-2.25/fbtl/tst-eintr3.c
   trunk/glibc-ports-2.25/fbtl/tst-eintr4.c
   trunk/glibc-ports-2.25/fbtl/tst-eintr5.c
   trunk/glibc-ports-2.25/fbtl/tst-exit2.c
   trunk/glibc-ports-2.25/fbtl/tst-exit3.c
   trunk/glibc-ports-2.25/fbtl/tst-mutex6.c
   trunk/glibc-ports-2.25/fbtl/tst-rwlock5.c
   trunk/glibc-ports-2.25/fbtl/tst-sem2.c
   trunk/glibc-ports-2.25/fbtl/tst-spin3.c
   trunk/glibc-ports-2.25/fbtl/tst-stdio1.c
Log:
fbtl: Avoid expected SIGALRM in most tests

upstream commit 7e625f7e85b4e88f10dbde35a0641742af581806


Modified: trunk/glibc-ports-2.25/fbtl/tst-cond3.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-cond3.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-cond3.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -22,7 +22,11 @@
 #include <string.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 /* Note that this test requires more than the standard.  It is
    required that there are no spurious wakeups if only more readers
    are added.  This is a reasonable demand.  */
@@ -50,7 +54,8 @@
     }
 
   /* This call should never return.  */
-  pthread_cond_wait (&cond, &mut);
+  xpthread_cond_wait (&cond, &mut);
+  puts ("error: pthread_cond_wait in tf returned");
 
   /* We should never get here.  */
   exit (1);
@@ -96,17 +101,11 @@
 	}
     }
 
-  /* Set an alarm for 1 second.  The wrapper will expect this.  */
-  alarm (1);
+  delayed_exit (1);
 
   /* This call should never return.  */
-  pthread_cond_wait (&cond, &mut);
+  xpthread_cond_wait (&cond, &mut);
 
-  puts ("cond_wait returned");
+  puts ("error: pthread_cond_wait in do_test returned");
   return 1;
 }
-
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-eintr1.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-eintr1.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-eintr1.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -23,6 +23,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #include "eintr.c"
 
 
@@ -92,13 +97,8 @@
 	}
     }
 
+  delayed_exit (3);
+  /* This call must never return.  */
   (void) tf1 (NULL);
-  /* NOTREACHED */
-
-  return 0;
+  return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 3
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-eintr2.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-eintr2.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-eintr2.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -24,6 +24,11 @@
 #include <string.h>
 #include <sys/time.h>
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #include "eintr.c"
 
 
@@ -103,6 +108,7 @@
       exit (1);
     }
 
+  delayed_exit (3);
   /* This call must never return.  */
   e = pthread_mutex_lock (&m1);
   printf ("main: mutex_lock returned: %s\n",
@@ -110,8 +116,3 @@
 
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 3
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-eintr3.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-eintr3.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-eintr3.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -23,6 +23,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #include "eintr.c"
 
 
@@ -56,16 +61,9 @@
       exit (1);
     }
 
+  delayed_exit (1);
   /* This call must never return.  */
-  e = pthread_join (th, NULL);
-
-  if (e == EINTR)
-    puts ("pthread_join returned with EINTR");
-
-  return 0;
+  xpthread_join (th);
+  puts ("error: pthread_join returned");
+  return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 1
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-eintr4.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-eintr4.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-eintr4.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -23,6 +23,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #include "eintr.c"
 
 
@@ -40,16 +45,9 @@
       exit (1);
     }
 
+  delayed_exit (1);
   /* This call must never return.  */
-  int e = pthread_barrier_wait (&b);
-
-  if (e == EINTR)
-    puts ("pthread_join returned with EINTR");
-
-  return 0;
+  xpthread_barrier_wait (&b);
+  puts ("error: pthread_barrier_wait returned");
+  return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 1
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-eintr5.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-eintr5.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-eintr5.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -24,6 +24,11 @@
 #include <string.h>
 #include <sys/time.h>
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #include "eintr.c"
 
 
@@ -66,15 +71,9 @@
       exit (1);
     }
 
+  delayed_exit (3);
   /* This call must never return.  */
-  e = pthread_cond_wait (&c, &m);
-  printf ("main: cond_wait returned: %s\n",
-	  strerror_r (e, buf, sizeof (buf)));
-
-  return 0;
+  xpthread_cond_wait (&c, &m);
+  puts ("error: pthread_cond_wait returned");
+  return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 3
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-exit2.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-exit2.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-exit2.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -4,7 +4,11 @@
 #include <string.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static void *
 tf (void *arg)
 {
@@ -28,13 +32,11 @@
       return 1;
     }
 
+  delayed_exit (1);
+
   /* Terminate only this thread.  */
   pthread_exit (NULL);
 
   /* NOTREACHED */
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-exit3.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-exit3.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-exit3.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -5,7 +5,11 @@
 #include <string.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static pthread_barrier_t b;
 
 
@@ -69,13 +73,11 @@
       exit (1);
     }
 
+  delayed_exit (3);
+
   /* Terminate only this thread.  */
   pthread_exit (NULL);
 
   /* NOTREACHED */
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-mutex6.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-mutex6.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-mutex6.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -22,6 +22,11 @@
 #include <unistd.h>
 #include <errno.h>
 
+#ifndef TEST_FUNCTION
+static int do_test (void);
+# define TEST_FUNCTION do_test ()
+#endif
+#include "../test-skeleton.c"
 
 #ifndef ATTR
 pthread_mutexattr_t *attr;
@@ -58,18 +63,10 @@
       return 1;
     }
 
-  /* Set an alarm for 1 second.  The wrapper will expect this.  */
-  alarm (1);
-
+  delayed_exit (1);
   /* This call should never return.  */
-  pthread_mutex_lock (&m);
+  xpthread_mutex_lock (&m);
 
   puts ("2nd mutex_lock returned");
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#ifndef TEST_FUNCTION
-# define TEST_FUNCTION do_test ()
-#endif
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-rwlock5.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-rwlock5.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-rwlock5.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -22,7 +22,11 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
 static pthread_rwlock_t r;
 
@@ -65,22 +69,16 @@
       return 1;
     }
 
-  /* Set an alarm for 1 second.  The wrapper will expect this.  */
-  alarm (1);
-
   if (pthread_create (&th, NULL, tf, NULL) != 0)
     {
       puts ("create failed");
       return 1;
     }
 
+  delayed_exit (1);
   /* This call should never return.  */
-  pthread_mutex_lock (&m);
+  xpthread_mutex_lock (&m);
 
   puts ("2nd mutex_lock returned");
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-sem2.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-sem2.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-sem2.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -17,12 +17,17 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
+#include <pthread.h>
 #include <semaphore.h>
 #include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static int
 do_test (void)
 {
@@ -34,8 +39,7 @@
       return 1;
     }
 
-  /* Set an alarm for 1 second.  The wrapper will expect this.  */
-  alarm (1);
+  delayed_exit (1);
 
   if (TEMP_FAILURE_RETRY (sem_wait (&s)) == -1)
     {
@@ -47,7 +51,3 @@
   puts ("wait succeeded");
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-spin3.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-spin3.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-spin3.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -21,7 +21,11 @@
 #include <stdio.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static int
 do_test (void)
 {
@@ -39,16 +43,11 @@
       return 1;
     }
 
-  /* Set an alarm for 1 second.  The wrapper will expect this.  */
-  alarm (1);
+  delayed_exit (1);
 
   /* This call should never return.  */
-  pthread_spin_lock (&s);
+  xpthread_spin_lock (&s);
 
   puts ("2nd spin_lock returned");
   return 1;
 }
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

Modified: trunk/glibc-ports-2.25/fbtl/tst-stdio1.c
===================================================================
--- trunk/glibc-ports-2.25/fbtl/tst-stdio1.c	2017-08-04 19:16:18 UTC (rev 6167)
+++ trunk/glibc-ports-2.25/fbtl/tst-stdio1.c	2017-08-04 19:22:00 UTC (rev 6168)
@@ -21,7 +21,11 @@
 #include <stdio.h>
 #include <unistd.h>
 
+static int do_test (void);
 
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static void *tf (void *a)
 {
   flockfile (stdout);
@@ -43,14 +47,10 @@
       _exit (1);
     }
 
-  pthread_join (th, NULL);
+  delayed_exit (1);
+  xpthread_join (th);
 
   puts ("join returned");
 
-  return 0;
+  return 1;
 }
-
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"




More information about the Glibc-bsd-commits mailing list