1# Automake input for strace tests.
2#
3# Copyright (c) 2011-2016 Dmitry V. Levin <ldv@altlinux.org>
4# Copyright (c) 2011-2018 The strace developers.
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. The name of the author may not be used to endorse or promote products
16#    derived from this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29OS = linux
30ARCH = @arch_m32@
31NATIVE_ARCH = @arch_native@
32SIZEOF_KERNEL_LONG_T = 4
33SIZEOF_LONG = 4
34MPERS_NAME = m32
35MPERS_CC_FLAGS = @cc_flags_m32@
36ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) $(MPERS_CC_FLAGS)
37AM_CFLAGS = $(WARN_CFLAGS)
38AM_CPPFLAGS = $(ARCH_MFLAGS) \
39	      -I$(builddir) \
40	      -I$(top_builddir)/$(OS)/$(ARCH) \
41	      -I$(top_srcdir)/$(OS)/$(ARCH) \
42	      -I$(top_builddir)/$(OS) \
43	      -I$(top_srcdir)/$(OS) \
44	      -I$(top_builddir) \
45	      -I$(top_srcdir) \
46	      -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \
47	      -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG)
48AM_LDFLAGS = $(ARCH_MFLAGS)
49
50libtests_a_SOURCES = \
51	create_nl_socket.c \
52	errno2name.c \
53	error_msg.c \
54	fill_memory.c \
55	get_page_size.c \
56	get_sigset_size.c \
57	hexdump_strdup.c \
58	hexquote_strndup.c \
59	ifindex.c \
60	inode_of_sockfd.c \
61	libmmsg.c \
62	libsocketcall.c \
63	overflowuid.c \
64	pipe_maxfd.c \
65	print_quoted_string.c \
66	print_time.c \
67	printflags.c \
68	printxval.c \
69	signal2name.c \
70	skip_unavailable.c \
71	sprintrc.c \
72	tail_alloc.c \
73	test_netlink.h \
74	test_nlattr.h \
75	test_printpath.c \
76	test_printstrn.c \
77	test_ucopy.c \
78	test_ucopy.h \
79	tests.h \
80	tprintf.c \
81	# end of libtests_a_SOURCES
82libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
83check_LIBRARIES = libtests.a
84LDADD = libtests.a
85
86include pure_executables.am
87
88check_PROGRAMS = $(PURE_EXECUTABLES) \
89	_newselect-P \
90	answer \
91	attach-f-p \
92	attach-f-p-cmd \
93	attach-p-cmd-cmd \
94	attach-p-cmd-p \
95	block_reset_raise_run \
96	bpf-obj_get_info_by_fd \
97	bpf-obj_get_info_by_fd-prog \
98	bpf-obj_get_info_by_fd-prog-v \
99	bpf-obj_get_info_by_fd-v \
100	bpf-success \
101	bpf-success-v \
102	caps-abbrev \
103	check_sigblock \
104	check_sigign \
105	clone_parent \
106	clone_ptrace \
107	count-f \
108	delay \
109	execve-v \
110	execveat-v \
111	filter-unavailable \
112	fork-f \
113	fsync-y \
114	getpid	\
115	getppid	\
116	gettid \
117	inject-nf \
118	int_0x80 \
119	ioctl_dm-v \
120	ioctl_evdev-v \
121	ioctl_evdev-success \
122	ioctl_evdev-success-v \
123	ioctl_loop-nv \
124	ioctl_loop-v \
125	ioctl_nsfs \
126	ioctl_perf-success \
127	ioctl_rtc-v \
128	is_linux_mips_n64 \
129	ksysent \
130	list_sigaction_signum \
131	localtime \
132	mmsg-silent \
133	mmsg_name-v \
134	msg_control-v \
135	net-accept-connect \
136	net-tpacket_stats-success \
137	netlink_inet_diag \
138	netlink_netlink_diag \
139	netlink_unix_diag \
140	nsyscalls \
141	nsyscalls-d \
142	oldselect-P \
143	oldselect-efault-P \
144	pc \
145	perf_event_open_nonverbose \
146	perf_event_open_unabbrev \
147	ppoll-v \
148	prctl-seccomp-filter-v \
149	prctl-seccomp-strict \
150	prctl-spec-inject \
151	print_maxfd \
152	qual_fault \
153	qual_inject-error-signal \
154	qual_inject-retval \
155	qual_inject-signal \
156	qual_signal \
157	quotactl-success \
158	quotactl-success-v \
159	quotactl-v \
160	quotactl-xfs-success \
161	quotactl-xfs-success-v \
162	quotactl-xfs-v \
163	redirect-fds \
164	restart_syscall \
165	run_expect_termsig \
166	scm_rights \
167	seccomp-filter-v \
168	seccomp-strict \
169	select-P \
170	set_ptracer_any \
171	set_sigblock \
172	set_sigign \
173	signal_receive \
174	sleep \
175	stack-fcall \
176	stack-fcall-mangled \
177	threads-execve \
178	unblock_reset_raise \
179	unix-pair-send-recv \
180	unix-pair-sendto-recvfrom \
181	vfork-f \
182	wait4-v \
183	waitid-v \
184	zeroargc \
185	# end of check_PROGRAMS
186
187attach_f_p_LDADD = -lpthread $(LDADD)
188count_f_LDADD = -lpthread $(LDADD)
189delay_LDADD = $(clock_LIBS) $(LDADD)
190filter_unavailable_LDADD = -lpthread $(LDADD)
191fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
192fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
193ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
194localtime_LDADD = $(clock_LIBS) $(LDADD)
195lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
196mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
197mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
198mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
199mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
200mq_LDADD = $(mq_LIBS) $(LDADD)
201newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
202pc_LDADD = $(dl_LIBS) $(LDADD)
203pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
204preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
205preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
206pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
207stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
208statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
209threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD)
210times_LDADD = $(clock_LIBS) $(LDADD)
211truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
212uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
213
214stack_fcall_SOURCES = stack-fcall.c \
215	stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c
216
217stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \
218	stack-fcall-mangled-0.c stack-fcall-mangled-1.c \
219	stack-fcall-mangled-2.c stack-fcall-mangled-3.c
220
221include gen_tests.am
222
223if ENABLE_STACKTRACE
224STACKTRACE_TESTS = strace-k.test
225if USE_DEMANGLE
226STACKTRACE_TESTS += strace-k-demangle.test
227endif
228else
229STACKTRACE_TESTS =
230endif
231
232DECODER_TESTS = \
233	bpf-success-v.test \
234	bpf-success.test \
235	brk.test \
236	btrfs-X.test \
237	btrfs-v.test \
238	btrfs-vX.test \
239	btrfs-vw.test \
240	btrfs-vwX.test \
241	btrfs-w.test \
242	btrfs-wX.test \
243	caps-abbrev.test \
244	caps.test \
245	eventfd.test \
246	execve-v.test \
247	execve.test \
248	fadvise64.test \
249	futex.test \
250	getuid.test \
251	ioctl.test \
252	ioctl_evdev-success.test \
253	ioctl_evdev-success-v.test \
254	ioctl_perf-success.test \
255	ipc_msgbuf.test \
256	kern_features-fault.test \
257	llseek.test \
258	lseek.test \
259	mmap.test \
260	net-tpacket_stats-success.test \
261	net-y-unix.test \
262	net-yy-inet.test \
263	net-yy-netlink.test \
264	net-yy-unix.test \
265	net.test \
266	netlink_sock_diag.test \
267	nsyscalls-d.test \
268	nsyscalls-nd.test \
269	nsyscalls.test \
270	personality.test \
271	pipe.test \
272	poll-P.test \
273	poll.test \
274	prctl-arg2-intptr.test \
275	prctl-dumpable.test \
276	prctl-name.test \
277	prctl-no-args.test \
278	prctl-pdeathsig.test \
279	prctl-seccomp-filter-v.test \
280	prctl-seccomp-strict.test \
281	prctl-securebits.test \
282	prctl-spec-inject.test \
283	prctl-tid_address.test \
284	prctl-tsc.test \
285	qual_fault-exit_group.test \
286	quotactl-success-v.test \
287	quotactl-success.test \
288	quotactl-xfs-success-v.test \
289	quotactl-xfs-success.test \
290	readv.test \
291	rt_sigaction.test \
292	scm_rights-fd.test \
293	seccomp-strict.test \
294	sigaltstack.test \
295	sun_path.test \
296	uio.test \
297	umount.test \
298	umount2.test \
299	umovestr.test \
300	umovestr2.test \
301	uname.test \
302	unix-pair-send-recv.test \
303	unix-pair-sendto-recvfrom.test \
304	xet_thread_area_x86.test \
305	# end of DECODER_TESTS
306
307MISC_TESTS = \
308	attach-f-p.test \
309	attach-p-cmd.test \
310	bexecve.test \
311	clone_parent.test \
312	clone_ptrace.test \
313	count-f.test \
314	count.test \
315	delay.test \
316	detach-running.test \
317	detach-sleeping.test \
318	detach-stopped.test \
319	fflush.test \
320	filter-unavailable.test \
321	filtering_fd-syntax.test \
322	filtering_syscall-syntax.test \
323	get_regs.test \
324	inject-nf.test \
325	interactive_block.test \
326	ksysent.test \
327	localtime.test \
328	opipe.test \
329	options-syntax.test \
330	pc.test \
331	printpath-umovestr-legacy.test \
332	printstrn-umoven-legacy.test \
333	qual_fault-syntax.test \
334	qual_fault-syscall.test \
335	qual_fault.test \
336	qual_inject-error-signal-syscall.test \
337	qual_inject-error-signal.test \
338	qual_inject-retval-syscall.test \
339	qual_inject-retval.test \
340	qual_inject-signal-syscall.test \
341	qual_inject-signal.test \
342	qual_inject-syntax.test \
343	qual_signal.test \
344	qual_syscall.test \
345	redirect-fds.test \
346	redirect.test \
347	restart_syscall.test \
348	sigblock.test \
349	sigign.test \
350	strace-C.test \
351	strace-E.test \
352	strace-S.test \
353	strace-T.test \
354	strace-V.test \
355	strace-ff.test \
356	strace-r.test \
357	strace-t.test \
358	strace-tt.test \
359	strace-ttt.test \
360	termsig.test \
361	threads-execve.test \
362	# end of MISC_TESTS
363
364TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(STACKTRACE_TESTS)
365
366XFAIL_TESTS_ =
367XFAIL_TESTS_m32 = $(STACKTRACE_TESTS)
368XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS)
369XFAIL_TESTS_x86_64 = int_0x80.gen.test
370XFAIL_TESTS_x32 = int_0x80.gen.test
371XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
372
373TEST_LOG_COMPILER = env
374AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \
375			SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \
376			SIZEOF_LONG=$(SIZEOF_LONG) \
377			MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh
378
379@VALGRIND_CHECK_RULES@
380VALGRIND_FLAGS = --quiet
381VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp
382
383EXTRA_DIST = \
384	accept_compat.h \
385	attach-p-cmd.h \
386	caps-abbrev.awk \
387	caps.awk \
388	clock.in \
389	count-f.expected \
390	eventfd.expected \
391	fadvise.h \
392	fcntl-common.c \
393	filter-unavailable.expected \
394	fstatat.c \
395	fstatx.c \
396	gen_pure_executables.sh \
397	gen_tests.in \
398	gen_tests.sh \
399	getresugid.c \
400	init.sh \
401	init_delete_module.h \
402	ipc.sh \
403	ioctl_kvm_run_common.c \
404	ksysent.sed \
405	lstatx.c \
406	match.awk \
407	net.expected \
408	netlink_sock_diag-v.sh \
409	nlattr_ifla.h \
410	pipe.expected \
411	print_user_desc.c \
412	process_vm_readv_writev.c \
413	pure_executables.list \
414	qual_fault-exit_group.expected \
415	qual_inject-error-signal.expected \
416	qual_inject-signal.expected \
417	qualify_personality.sh \
418	qualify_personality_empty.in \
419	quotactl.h \
420	regex.in \
421	rt_sigaction.awk \
422	run.sh \
423	sched.in \
424	scno_tampering.sh \
425	setfsugid.c \
426	setresugid.c \
427	setreugid.c \
428	setugid.c \
429	sigaltstack.expected \
430	sockname.c \
431	stack-fcall.h \
432	strace-C.expected \
433	strace-E.expected \
434	strace-T.expected \
435	strace-ff.expected \
436	strace-k-demangle.expected \
437	strace-k-demangle.test \
438	strace-k.expected \
439	strace-k.test \
440	strace-r.expected \
441	strace.supp \
442	sun_path.expected \
443	syntax.sh \
444	trace_fstat.in \
445	trace_fstatfs.in \
446	trace_lstat.in \
447	trace_personality_32.in \
448	trace_personality_64.in \
449	trace_personality_x32.in \
450	trace_personality_regex_32.in \
451	trace_personality_regex_64.in \
452	trace_personality_regex_x32.in \
453	trace_question.in \
454	trace_stat.in \
455	trace_stat_like.in \
456	trace_statfs.in \
457	trace_statfs_like.in \
458	uio.expected \
459	umode_t.c \
460	umovestr.expected \
461	unix-pair-send-recv.expected \
462	unix-pair-sendto-recvfrom.expected \
463	xchownx.c \
464	xgetrlimit.c \
465	xselect.c \
466	xstatfs.c \
467	xstatfs64.c \
468	xstatfsx.c \
469	xstatx.c \
470	xutimes.c \
471	$(TESTS)
472
473ksysent.h: $(srcdir)/ksysent.sed
474	echo '#include <asm/unistd.h>' | \
475		$(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1
476	LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2
477	mv -f $@.t2 $@
478	rm -f $@.t1
479
480ksysent.$(OBJEXT): ksysent.h
481
482objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT)))
483$(objects): scno.h
484
485clean-local: clean-local-check
486.PHONY: clean-local-check
487clean-local-check:
488	-rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir)
489
490.PHONY: check-valgrind-local
491check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS)
492
493BUILT_SOURCES = ksysent.h
494CLEANFILES = ksysent.h
495
496include ../scno.am
497