Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/lib The libpthread tests have been converted to atf; ...
details: https://anonhg.NetBSD.org/src/rev/2e36517c1944
branches: trunk
changeset: 756411:2e36517c1944
user: jmmv <jmmv%NetBSD.org@localhost>
date: Fri Jul 16 15:46:01 2010 +0000
description:
The libpthread tests have been converted to atf; remove the old versions.
diffstat:
regress/lib/Makefile | 4 +-
regress/lib/libpthread/Makefile | 38 ---
regress/lib/libpthread/atexit/Makefile | 25 --
regress/lib/libpthread/barrier1/Makefile | 15 -
regress/lib/libpthread/barrier1/barrier1.c | 78 -------
regress/lib/libpthread/cancel2/Makefile | 15 -
regress/lib/libpthread/cancel2/cancel2.c | 27 --
regress/lib/libpthread/cond1/Makefile | 15 -
regress/lib/libpthread/cond1/cond1.c | 74 -------
regress/lib/libpthread/cond2/Makefile | 15 -
regress/lib/libpthread/cond2/cond2.c | 75 -------
regress/lib/libpthread/cond3/Makefile | 15 -
regress/lib/libpthread/cond3/cond3.c | 72 -------
regress/lib/libpthread/cond4/Makefile | 15 -
regress/lib/libpthread/cond4/cond4.c | 93 ---------
regress/lib/libpthread/cond5/Makefile | 15 -
regress/lib/libpthread/cond5/cond5.c | 87 --------
regress/lib/libpthread/cond6/Makefile | 15 -
regress/lib/libpthread/cond6/cond6.c | 93 ---------
regress/lib/libpthread/condcancel1/Makefile | 15 -
regress/lib/libpthread/condcancel1/condcancel1.c | 91 ---------
regress/lib/libpthread/conddestroy1/Makefile | 15 -
regress/lib/libpthread/conddestroy1/conddestroy1.c | 86 --------
regress/lib/libpthread/detach1/Makefile | 15 -
regress/lib/libpthread/detach1/detach1.c | 55 -----
regress/lib/libpthread/exit1/Makefile | 15 -
regress/lib/libpthread/exit1/exit1.c | 16 -
regress/lib/libpthread/find/Makefile | 13 -
regress/lib/libpthread/find/findthreads.c | 58 -----
regress/lib/libpthread/find/findthreads.sh | 7 -
regress/lib/libpthread/fork/Makefile | 14 -
regress/lib/libpthread/fork/fork.c | 76 -------
regress/lib/libpthread/fpu/Makefile | 9 -
regress/lib/libpthread/fpu/fpu.c | 118 ------------
regress/lib/libpthread/kill1/Makefile | 14 -
regress/lib/libpthread/kill1/kill1.c | 117 -----------
regress/lib/libpthread/mutex1/Makefile | 15 -
regress/lib/libpthread/mutex1/mutex1.c | 66 ------
regress/lib/libpthread/mutex2/Makefile | 15 -
regress/lib/libpthread/mutex2/mutex2.c | 81 --------
regress/lib/libpthread/mutex3/Makefile | 15 -
regress/lib/libpthread/mutex3/mutex3.c | 78 -------
regress/lib/libpthread/mutex4/Makefile | 15 -
regress/lib/libpthread/mutex4/mutex4.c | 83 --------
regress/lib/libpthread/name/Makefile | 15 -
regress/lib/libpthread/name/name.c | 67 ------
regress/lib/libpthread/once1/Makefile | 15 -
regress/lib/libpthread/once1/once1.c | 35 ---
regress/lib/libpthread/once2/Makefile | 15 -
regress/lib/libpthread/once2/once2.c | 61 ------
regress/lib/libpthread/once3/Makefile | 15 -
regress/lib/libpthread/once3/once3.c | 87 --------
regress/lib/libpthread/preempt1/Makefile | 16 -
regress/lib/libpthread/preempt1/preempt1.c | 91 ---------
regress/lib/libpthread/resolv/Makefile | 15 -
regress/lib/libpthread/resolv/mach | 92 ---------
regress/lib/libpthread/resolv/resolv.c | 205 ---------------------
regress/lib/libpthread/rwlock1/Makefile | 15 -
regress/lib/libpthread/rwlock1/rwlock1.c | 107 ----------
regress/lib/libpthread/sem/Makefile | 12 -
regress/lib/libpthread/sem/sem.c | 167 -----------------
regress/lib/libpthread/sem2/Makefile | 15 -
regress/lib/libpthread/sem2/sem2.c | 113 -----------
regress/lib/libpthread/sigalarm/Makefile | 14 -
regress/lib/libpthread/sigalarm/sigalarm.c | 74 -------
regress/lib/libpthread/siglongjmp1/Makefile | 14 -
regress/lib/libpthread/siglongjmp1/siglongjmp1.c | 72 -------
regress/lib/libpthread/sigmask1/Makefile | 14 -
regress/lib/libpthread/sigmask1/sigmask1.c | 33 ---
regress/lib/libpthread/sigmask2/Makefile | 14 -
regress/lib/libpthread/sigmask2/sigmask2.c | 63 ------
regress/lib/libpthread/sigmask3/Makefile | 14 -
regress/lib/libpthread/sigmask3/sigmask3.c | 95 ---------
regress/lib/libpthread/sigmask4/Makefile | 14 -
regress/lib/libpthread/sigmask4/sigmask4.c | 61 ------
regress/lib/libpthread/sigsuspend/Makefile | 14 -
regress/lib/libpthread/sigsuspend/sigsuspend.c | 52 -----
regress/lib/libpthread/sleep1/Makefile | 15 -
regress/lib/libpthread/sleep1/sleep1.c | 63 ------
79 files changed, 2 insertions(+), 3670 deletions(-)
diffs (truncated from 3994 to 300 lines):
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/Makefile
--- a/regress/lib/Makefile Fri Jul 16 15:45:05 2010 +0000
+++ b/regress/lib/Makefile Fri Jul 16 15:46:01 2010 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.23 2010/07/16 13:59:07 jmmv Exp $
+# $NetBSD: Makefile,v 1.24 2010/07/16 15:46:01 jmmv Exp $
.include <bsd.own.mk>
-SUBDIR+= csu libc libm libpthread
+SUBDIR+= csu libc libm
.if (${MACHINE_CPU} != "alpha" && \
${MACHINE_CPU} != "mips" && \
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/Makefile
--- a/regress/lib/libpthread/Makefile Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-# $NetBSD: Makefile,v 1.32 2009/04/02 12:58:44 drochner Exp $
-
-.include <bsd.own.mk>
-
-.if exists(${.CURDIR}/../../../lib/libpthread/arch/${MACHINE_ARCH})
-ARCHSUBDIR= ${MACHINE_ARCH}
-.elif exists(${.CURDIR}/../../../lib/libpthread/arch/${MACHINE_CPU})
-ARCHSUBDIR= ${MACHINE_CPU}
-.else
-.BEGIN:
- @echo "WARNING: no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}"
- @echo "*** REFUSING TO CONTINUE! (nag, nag, nag) ***"
- @false # this is intentional!
-.endif
-
-.if defined(ARCHSUBDIR)
-
-SUBDIR+= atexit \
- barrier1 \
- cancel2 \
- cond1 cond2 cond3 cond4 cond5 cond6 condcancel1 \
- exit1 \
- find \
- fork \
- fpu \
- kill1 \
- mutex1 mutex2 mutex3 mutex4 \
- name \
- once1 once2 once3 \
- preempt1 \
- resolv rwlock1 \
- sem sem2 sigalarm sigmask1 sigmask2 sigmask3 sigmask4 \
- siglongjmp1 sigsuspend \
- sleep1
-
-.endif
-
-.include <bsd.subdir.mk>
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/atexit/Makefile
--- a/regress/lib/libpthread/atexit/Makefile Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/03/04 18:00:49 thorpej Exp $
-
-NOMAN= # defined
-
-PROG= atexit
-
-ATEXITDIR= ${.CURDIR}/../../libc/atexit
-.PATH: ${ATEXITDIR}
-
-# Note: this test relies on being dynamically linked. You will get a
-# spurious PASS for a statically linked test.
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
-
-CLEANFILES+= output
-
-regress: ${PROG}
- ./${PROG} > output
- if cmp ${ATEXITDIR}/expected output; then \
- echo PASSED; \
- else \
- echo FAILED; exit 1; \
- fi
-
-.include <bsd.prog.mk>
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/barrier1/Makefile
--- a/regress/lib/libpthread/barrier1/Makefile Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/01/30 18:23:09 thorpej Exp $
-
-WARNS=1
-
-PROG= barrier1
-SRCS= barrier1.c
-
-LDADD= -lpthread
-
-NOMAN=
-
-regress:
- ./barrier1
-
-.include <bsd.prog.mk>
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/barrier1/barrier1.c
--- a/regress/lib/libpthread/barrier1/barrier1.c Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/* $NetBSD: barrier1.c,v 1.3 2007/12/03 17:59:45 ad Exp $ */
-
-#include <assert.h>
-#include <err.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-void *threadfunc(void *arg);
-
-pthread_barrier_t barrier;
-pthread_mutex_t mutex;
-int serial_count;
-int after_barrier_count;
-
-#define COUNT 10
-
-int
-main(int argc, char *argv[])
-{
- int i, ret;
- pthread_t new[COUNT];
- void *joinval;
-
- pthread_mutex_init(&mutex, NULL);
-
- ret = pthread_barrier_init(&barrier, NULL, COUNT);
- if (ret != 0)
- err(1, "pthread_barrier_init");
-
- for (i = 0; i < COUNT; i++) {
- pthread_mutex_lock(&mutex);
- assert(after_barrier_count == 0);
- pthread_mutex_unlock(&mutex);
- ret = pthread_create(&new[i], NULL, threadfunc,
- (void *)(long)i);
- if (ret != 0)
- err(1, "pthread_create");
- sleep(2);
- }
-
- for (i = 0; i < COUNT; i++) {
- ret = pthread_join(new[i], &joinval);
- if (ret != 0)
- err(1, "pthread_join: %d", ret);
- pthread_mutex_lock(&mutex);
- assert(after_barrier_count > i);
- pthread_mutex_unlock(&mutex);
- printf("main joined with thread %d\n", i);
- }
-
- pthread_mutex_lock(&mutex);
- assert(after_barrier_count == COUNT);
- pthread_mutex_unlock(&mutex);
- assert(serial_count == 1);
-
- return 0;
-}
-
-void *
-threadfunc(void *arg)
-{
- int which = (int)(long)arg;
- int ret;
-
- printf("thread %d entering barrier\n", which);
- ret = pthread_barrier_wait(&barrier);
- printf("thread %d leaving barrier -> %d\n", which, ret);
-
- pthread_mutex_lock(&mutex);
- after_barrier_count++;
- if (ret == PTHREAD_BARRIER_SERIAL_THREAD)
- serial_count++;
- pthread_mutex_unlock(&mutex);
-
- return NULL;
-}
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/cancel2/Makefile
--- a/regress/lib/libpthread/cancel2/Makefile Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/07/22 21:26:13 nathanw Exp $
-
-WARNS=1
-
-PROG= cancel2
-SRCS= cancel2.c
-
-LDADD= -lpthread
-
-NOMAN=
-
-regress:
- ./cancel2
-
-.include <bsd.prog.mk>
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/cancel2/cancel2.c
--- a/regress/lib/libpthread/cancel2/cancel2.c Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/* $NetBSD: cancel2.c,v 1.3 2004/03/05 15:07:22 wiz Exp $ */
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <unistd.h>
-
-int
-main(void)
-{
- char str1[] = "You should see this.\n";
- char str2[] = "You should not see this.\n";
-
- printf("Cancellation test 2: Self-cancellation and disabling.\n");
-
-
- pthread_cancel(pthread_self());
-
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
-
- write(STDOUT_FILENO, str1, sizeof(str1));
-
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
-
- write(STDOUT_FILENO, str2, sizeof(str2));
-
- exit(1);
-}
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/cond1/Makefile
--- a/regress/lib/libpthread/cond1/Makefile Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/01/30 18:53:45 thorpej Exp $
-
-WARNS=1
-
-PROG= cond1
-SRCS= cond1.c
-
-LDADD= -lpthread
-
-NOMAN=
-
-regress:
- ./cond1
-
-.include <bsd.prog.mk>
diff -r 69989a83b456 -r 2e36517c1944 regress/lib/libpthread/cond1/cond1.c
--- a/regress/lib/libpthread/cond1/cond1.c Fri Jul 16 15:45:05 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/* $NetBSD: cond1.c,v 1.1 2003/01/30 18:53:46 thorpej Exp $ */
-
-#include <err.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-void *threadfunc(void *arg);
-
-pthread_mutex_t mutex;
-pthread_cond_t cond;
-
-int
-main(int argc, char *argv[])
-{
- int x,ret;
- pthread_t new;
- void *joinval;
- int sharedval;
-
- printf("1: condition variable test 1\n");
-
- pthread_mutex_init(&mutex, NULL);
- pthread_cond_init(&cond, NULL);
-
- x = 20;
- pthread_mutex_lock(&mutex);
-
- sharedval = 1;
-
- ret = pthread_create(&new, NULL, threadfunc, &sharedval);
- if (ret != 0)
- err(1, "pthread_create");
-
- printf("1: Before waiting.\n");
- do {
- sleep(2);
- pthread_cond_wait(&cond, &mutex);
- printf("1: After waiting, in loop.\n");
- } while (sharedval != 0);
Home |
Main Index |
Thread Index |
Old Index