1
2include $(top_srcdir)/Makefile.tool-tests.am
3
4SUBDIRS = .
5SUBDIRS += scripts
6
7# Arch-specific tests.
8if VGCONF_ARCHS_INCLUDE_X86
9SUBDIRS += x86
10endif
11if VGCONF_ARCHS_INCLUDE_AMD64
12SUBDIRS += amd64
13endif
14if VGCONF_ARCHS_INCLUDE_PPC32
15SUBDIRS += ppc32
16endif
17if VGCONF_ARCHS_INCLUDE_PPC64
18SUBDIRS += ppc64
19endif
20if VGCONF_ARCHS_INCLUDE_ARM
21SUBDIRS += arm
22endif
23if VGCONF_ARCHS_INCLUDE_ARM64
24SUBDIRS += arm64
25endif
26if VGCONF_ARCHS_INCLUDE_S390X
27SUBDIRS += s390x
28endif
29if VGCONF_ARCHS_INCLUDE_MIPS32
30SUBDIRS += mips32
31endif
32if VGCONF_ARCHS_INCLUDE_MIPS64
33SUBDIRS += mips64
34endif
35if VGCONF_ARCHS_INCLUDE_TILEGX
36SUBDIRS += tilegx
37endif
38
39# OS-specific tests
40if VGCONF_OS_IS_LINUX
41SUBDIRS += linux
42endif
43if VGCONF_OS_IS_DARWIN
44SUBDIRS += darwin
45endif
46if VGCONF_OS_IS_SOLARIS
47SUBDIRS += solaris
48endif
49
50# Platform-specific tests
51if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
52SUBDIRS += amd64-linux
53endif
54if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
55SUBDIRS += x86-linux
56endif
57if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN
58SUBDIRS += amd64-darwin
59endif
60if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
61SUBDIRS += x86-darwin
62endif
63if VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS
64SUBDIRS += amd64-solaris
65endif
66if VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS
67SUBDIRS += x86-solaris
68endif
69
70DIST_SUBDIRS = x86 amd64 ppc32 ppc64 arm arm64 s390x mips32 mips64 tilegx \
71               linux darwin solaris amd64-linux x86-linux amd64-darwin \
72               x86-darwin amd64-solaris x86-solaris scripts .
73
74dist_noinst_SCRIPTS = \
75	filter_cmdline0 \
76	filter_cmdline1 \
77	filter_fdleak \
78	filter_ioctl_moans \
79	filter_none_discards \
80	filter_stderr \
81	filter_timestamp \
82	allexec_prepare_prereq
83
84noinst_HEADERS = fdleak.h
85
86EXTRA_DIST = \
87	allexec32.stdout.exp allexec32.stderr.exp allexec32.vgtest\
88	allexec64.stdout.exp allexec64.stderr.exp allexec64.vgtest\
89	ansi.stderr.exp ansi.vgtest \
90	args.stderr.exp args.stdout.exp args.vgtest \
91	async-sigs.stderr.exp async-sigs.stderr.exp-mips32 \
92	async-sigs.vgtest \
93	bigcode.vgtest bigcode.stderr.exp bigcode.stdout.exp \
94	bitfield1.stderr.exp bitfield1.vgtest \
95	bug129866.vgtest bug129866.stderr.exp bug129866.stdout.exp \
96	bug234814.vgtest bug234814.stderr.exp bug234814.stdout.exp \
97	closeall.stderr.exp closeall.vgtest \
98	cmdline0.stderr.exp cmdline0.stdout.exp cmdline0.vgtest \
99	cmdline1.stderr.exp cmdline1.stdout.exp cmdline1.vgtest \
100	cmdline2.stderr.exp cmdline2.stdout.exp cmdline2.vgtest \
101	cmdline3.stderr.exp cmdline3.vgtest \
102	cmdline4.stderr.exp cmdline4.vgtest \
103	cmdline5.stderr.exp cmdline5.vgtest \
104	cmdline6.stderr.exp cmdline6.vgtest \
105	cmd-with-special.stderr.exp cmd-with-special.vgtest \
106	coolo_sigaction.stderr.exp \
107	coolo_sigaction.stdout.exp coolo_sigaction.vgtest \
108	coolo_strlen.stderr.exp coolo_strlen.vgtest \
109	discard.stderr.exp discard.stdout.exp \
110	discard.vgtest \
111	empty-exe.vgtest empty-exe.stderr.exp \
112	exec-sigmask.vgtest exec-sigmask.stdout.exp \
113	exec-sigmask.stdout.exp2 exec-sigmask.stdout.exp3 \
114	exec-sigmask.stdout.exp-solaris exec-sigmask.stderr.exp \
115	execve.vgtest execve.stdout.exp execve.stderr.exp \
116	faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \
117	fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \
118	fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \
119	fdleak_creat.stderr.exp fdleak_creat.vgtest \
120	fdleak_dup.stderr.exp fdleak_dup.vgtest \
121	fdleak_dup2.stderr.exp fdleak_dup2.vgtest \
122	fdleak_fcntl.stderr.exp fdleak_fcntl.vgtest \
123	fdleak_ipv4.stderr.exp fdleak_ipv4.stdout.exp fdleak_ipv4.vgtest \
124	fdleak_open.stderr.exp fdleak_open.vgtest \
125	fdleak_pipe.stderr.exp fdleak_pipe.vgtest \
126	fdleak_socketpair.stderr.exp fdleak_socketpair.vgtest \
127	floored.stderr.exp floored.stdout.exp floored.vgtest \
128	fork.stderr.exp fork.stdout.exp fork.vgtest \
129	fucomip.stderr.exp fucomip.vgtest \
130	gxx304.stderr.exp gxx304.vgtest \
131	ifunc.stderr.exp ifunc.stdout.exp ifunc.vgtest \
132	ioctl_moans.stderr.exp ioctl_moans.vgtest \
133	libvex_test.stderr.exp libvex_test.vgtest \
134	libvexmultiarch_test.stderr.exp libvexmultiarch_test.vgtest \
135	manythreads.stdout.exp manythreads.stderr.exp manythreads.vgtest \
136	map_unaligned.stderr.exp map_unaligned.vgtest \
137	map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
138	mmap_fcntl_bug.vgtest mmap_fcntl_bug.stdout.exp \
139		mmap_fcntl_bug.stderr.exp \
140	mq.stderr.exp mq.vgtest \
141	munmap_exe.stderr.exp munmap_exe.vgtest \
142	nestedfns.stderr.exp nestedfns.stdout.exp nestedfns.vgtest \
143	nodir.stderr.exp nodir.vgtest \
144	pending.stdout.exp pending.stderr.exp pending.vgtest \
145	procfs-linux.stderr.exp-with-readlinkat \
146	procfs-linux.stderr.exp-without-readlinkat \
147	procfs-linux.vgtest \
148	procfs-non-linux.vgtest \
149	procfs-non-linux.stderr.exp-with-readlinkat \
150	procfs-non-linux.stderr.exp-without-readlinkat \
151	pth_atfork1.stderr.exp pth_atfork1.stdout.exp pth_atfork1.vgtest \
152	pth_blockedsig.stderr.exp \
153	pth_blockedsig.stdout.exp pth_blockedsig.vgtest \
154	pth_cancel1.stderr.exp pth_cancel1.stdout.exp pth_cancel1.vgtest \
155	pth_cancel2.stderr.exp pth_cancel2.vgtest \
156	pth_cvsimple.stderr.exp pth_cvsimple.stdout.exp pth_cvsimple.vgtest \
157	pth_empty.stderr.exp pth_empty.vgtest \
158	pth_exit.stderr.exp pth_exit.vgtest \
159	pth_exit2.stderr.exp pth_exit2.vgtest \
160	pth_mutexspeed.stderr.exp \
161	pth_mutexspeed.stdout.exp pth_mutexspeed.vgtest \
162	pth_once.stderr.exp pth_once.stdout.exp pth_once.vgtest \
163	pth_rwlock.stderr.exp pth_rwlock.vgtest \
164	pth_stackalign.stderr.exp \
165	pth_stackalign.stdout.exp pth_stackalign.vgtest \
166	rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
167	readline1.stderr.exp readline1.stdout.exp \
168	readline1.vgtest \
169	require-text-symbol-1.vgtest \
170		require-text-symbol-1.stderr.exp \
171	require-text-symbol-2.vgtest \
172		require-text-symbol-2.stderr.exp-libcso1 \
173		require-text-symbol-2.stderr.exp-libcso6 \
174	res_search.stderr.exp res_search.stdout.exp res_search.vgtest \
175	resolv.stderr.exp resolv.stdout.exp resolv.vgtest \
176	rlimit_nofile.stderr.exp rlimit_nofile.stdout.exp rlimit_nofile.vgtest \
177	rlimit64_nofile.stderr.exp rlimit64_nofile.stdout.exp rlimit64_nofile.vgtest \
178	selfrun.stderr.exp selfrun.stdout.exp selfrun.vgtest \
179	sem.stderr.exp sem.stdout.exp sem.vgtest \
180	semlimit.stderr.exp semlimit.stdout.exp semlimit.vgtest \
181	sha1_test.stderr.exp sha1_test.vgtest \
182	shortpush.stderr.exp shortpush.vgtest \
183	shorts.stderr.exp shorts.vgtest \
184	sigstackgrowth.stdout.exp sigstackgrowth.stderr.exp sigstackgrowth.vgtest \
185	stackgrowth.stdout.exp stackgrowth.stderr.exp stackgrowth.vgtest \
186	syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
187	syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
188	syslog.vgtest syslog.stderr.exp \
189	system.stderr.exp system.vgtest \
190	thread-exits.stderr.exp thread-exits.stdout.exp thread-exits.vgtest \
191	threaded-fork.stderr.exp threaded-fork.stdout.exp threaded-fork.vgtest \
192	threadederrno.stderr.exp threadederrno.stdout.exp \
193	threadederrno.vgtest \
194	timestamp.stderr.exp timestamp.vgtest \
195	tls.vgtest tls.stderr.exp tls.stdout.exp  \
196	unit_debuglog.stderr.exp unit_debuglog.vgtest \
197	vgprintf.stderr.exp vgprintf.vgtest \
198	process_vm_readv_writev.stderr.exp process_vm_readv_writev.vgtest
199
200check_PROGRAMS = \
201	args \
202	async-sigs \
203	bitfield1 \
204	bug129866 bug234814 \
205	closeall coolo_strlen \
206	discard exec-sigmask execve faultstatus fcntl_setown \
207	fdleak_cmsg fdleak_creat fdleak_dup fdleak_dup2 \
208	fdleak_fcntl fdleak_ipv4 fdleak_open fdleak_pipe \
209	fdleak_socketpair \
210	floored fork fucomip \
211	ioctl_moans \
212	libvex_test \
213	libvexmultiarch_test \
214	manythreads \
215	mmap_fcntl_bug \
216	munmap_exe map_unaligned map_unmap mq \
217	pending \
218	procfs-cmdline-exe \
219	pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
220	pth_empty pth_exit pth_exit2 pth_mutexspeed pth_once pth_rwlock \
221	pth_stackalign \
222	rcrl readline1 \
223	require-text-symbol \
224	res_search resolv \
225	rlimit_nofile selfrun sem semlimit sha1_test \
226	shortpush shorts stackgrowth sigstackgrowth \
227	syscall-restart1 syscall-restart2 \
228	syslog \
229	system \
230	thread-exits \
231	threaded-fork \
232	threadederrno \
233	timestamp \
234	tls \
235	tls.so \
236	tls2.so \
237	unit_debuglog \
238	valgrind_cpp_test \
239	vgprintf \
240	coolo_sigaction \
241	gxx304 \
242	process_vm_readv_writev
243
244if HAVE_NESTED_FUNCTIONS
245   check_PROGRAMS += nestedfns
246endif
247
248# This doesn't appear to be compilable on Darwin.
249if ! VGCONF_OS_IS_DARWIN
250   check_PROGRAMS += rlimit64_nofile
251endif
252
253# clang does not know -ansi
254if ! COMPILER_IS_CLANG
255   check_PROGRAMS += ansi
256endif
257
258if BUILD_IFUNC_TESTS
259   check_PROGRAMS += ifunc
260endif
261
262AM_CFLAGS   += $(AM_FLAG_M3264_PRI)
263AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
264
265# Extra stuff for C tests
266ansi_CFLAGS		= $(AM_CFLAGS) -ansi
267execve_CFLAGS		= $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
268if VGCONF_OS_IS_SOLARIS
269fcntl_setown_LDADD	= -lsocket -lnsl
270fdleak_cmsg_CFLAGS	= $(AM_CFLAGS) -D_XOPEN_SOURCE=500
271fdleak_cmsg_LDADD	= -lsocket -lnsl
272fdleak_ipv4_LDADD	= -lsocket -lnsl
273fdleak_creat_LDADD	= -lsocket -lnsl
274fdleak_socketpair_LDADD	= -lsocket -lnsl
275endif
276floored_LDADD 		= -lm
277manythreads_LDADD	= -lpthread
278if VGCONF_OS_IS_DARWIN
279 nestedfns_CFLAGS	= $(AM_CFLAGS) -fnested-functions
280else
281 nestedfns_CFLAGS	= $(AM_CFLAGS)
282 mq_LDADD		= -lrt
283endif
284libvex_test_CFLAGS      = $(AM_CFLAGS) @FLAG_FSANITIZE@
285libvex_test_LDADD       = ../../VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a \
286			   @LIB_UBSAN@
287libvexmultiarch_test_CFLAGS= $(AM_CFLAGS) @FLAG_FSANITIZE@
288libvexmultiarch_test_LDADD = \
289	../../VEX/libvexmultiarch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a \
290	../../VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a @LIB_UBSAN@
291libvexmultiarch_test_SOURCES = libvex_test.c
292pth_atfork1_LDADD	= -lpthread
293pth_blockedsig_LDADD	= -lpthread
294pth_cancel1_CFLAGS	= $(AM_CFLAGS) -Wno-shadow
295pth_cancel1_LDADD	= -lpthread
296pth_cancel2_LDADD	= -lpthread
297pth_cvsimple_LDADD	= -lpthread
298pth_empty_LDADD 	= -lpthread
299pth_exit_LDADD	 	= -lpthread
300pth_exit2_LDADD	 	= -lpthread
301pth_mutexspeed_LDADD	= -lpthread
302pth_once_LDADD		= -lpthread
303pth_rwlock_LDADD	= -lpthread
304pth_rwlock_CFLAGS	= $(AM_CFLAGS)
305if VGCONF_OS_IS_SOLARIS
306pth_rwlock_CFLAGS	+= --std=c99
307endif
308pth_stackalign_LDADD	= -lpthread
309res_search_LDADD        = -lresolv -lpthread
310resolv_CFLAGS		= $(AM_CFLAGS)
311resolv_LDADD            = -lresolv -lpthread
312if VGCONF_OS_IS_SOLARIS
313resolv_CFLAGS		+= -U_REENTRANT
314endif
315semlimit_LDADD		= -lpthread
316sha1_test_CFLAGS	= $(AM_CFLAGS)
317if VGCONF_OS_IS_SOLARIS
318sha1_test_CFLAGS	+= -Du_int32_t=uint32_t
319endif
320thread_exits_LDADD	= -lpthread
321threaded_fork_LDADD	= -lpthread
322threadederrno_CFLAGS	= $(AM_CFLAGS)
323threadederrno_LDADD	= -lpthread
324if VGCONF_OS_IS_SOLARIS
325threadederrno_CFLAGS	+= --std=c99
326endif
327tls_SOURCES		= tls.c tls2.c
328tls_DEPENDENCIES	= tls.so tls2.so
329tls_LDFLAGS		= -Wl,-rpath,$(abs_top_builddir)/none/tests
330tls_LDADD		= tls.so tls2.so -lpthread
331tls_so_SOURCES		= tls_so.c
332tls_so_DEPENDENCIES	= tls2.so
333if VGCONF_OS_IS_DARWIN
334 tls_so_LDFLAGS		= -dynamic -dynamiclib -all_load -fpic
335 tls_so_LDADD		= `pwd`/tls2.so
336else
337 tls_so_LDFLAGS		= -Wl,-rpath,$(abs_top_builddir)/none/tests -shared -fPIC
338 tls_so_LDADD		= tls2.so
339endif
340tls_so_CFLAGS		= $(AM_CFLAGS) -fPIC
341tls2_so_SOURCES		= tls2_so.c
342if VGCONF_OS_IS_DARWIN
343 tls2_so_LDFLAGS	= -dynamic -dynamiclib -all_load
344else
345 tls2_so_LDFLAGS	= -shared
346endif
347
348valgrind_cpp_test_SOURCES = valgrind_cpp_test.cpp
349valgrind_cpp_test_LDADD   = -lstdc++
350
351# C++ tests
352coolo_sigaction_SOURCES	= coolo_sigaction.cpp
353gxx304_SOURCES		= gxx304.cpp
354
355