summaryrefslogtreecommitdiff
path: root/lib/libc_r/TEST/Makefile
blob: 9b95619ccdf3a5fe757f0a16086a4aaf5865f708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Generated automatically from Makefile.in by configure.
# === GNUmakefile ============================================================
# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
#
#	Description: This file is for creating the test programs for libpthread.a
#
#	1.00 93/08/03 proven
#		-Initial cut for pthreads.
#

LIBC_R?=	/usr/lib/libc_r.a

CPPFLAGS +=	-pthread
LDFLAGS +=	-pthread
CFLAGS +=	-ggdb -Wall # -Werror
CFLAGS +=	-DSRCDIR='"${.CURDIR}"'
LDLIBS +=	-lm
DPADD +=	${LIBC_R}
MKDEP =		-p

# This list used to include test_select, but that test doesn't terminate.
TESTS = test_create test_pthread_join test_switch test_sleep test_readdir \
	test_fork test_execve test_preemption \
	test_sock_1 test_sock_2 test_stdio_1 test_pthread_mutex \
	test_pthread_cond_timedwait test_netdb test_pw test_cwd \
	test_sock_2a

SRCS =		${TESTS:=.c}
CLEANFILES +=	${TESTS} 
SKIP_TESTS +=	test_sock_2a

# This list used to include p_bench_semaphore, but the semaphore support isn't
# defined for all targets (or used for any).

BENCHMARKS = p_bench_read p_bench_mutex p_bench_yield \
	p_bench_getpid p_bench_pthread_create

SRCS +=		${BENCHMARKS:=.c}
CLEANFILES +=	${BENCHMARKS} 


all : tests # benchmarks

tests : ${TESTS}
	@faillist= ; ulimit -t 5; \
	for i in ${.ALLSRC} ; do \
	  case " ${SKIP_TESTS} " in \
	  *" $$i "*) \
		  : skip ;; \
	  *) \
		  echo ; echo "*** $$i ***"; \
		  if ${.OBJDIR}/$$i; then \
			  echo "-- $$i passed"; \
		  else \
			  echo "-- $$i FAILED (exit code $$?)"; \
			  faillist="$$faillist $$i"; \
		  fi;; \
	  esac; \
	done; \
	if test -n "$$faillist"; then \
		echo; echo "*** tests that failed:$$faillist"; exit 1; \
	else \
		echo; echo "All tests passed OK."; exit 0; \
	fi

benchmarks: ${BENCHMARKS}

.include <bsd.prog.mk>
.include <bsd.dep.mk>