]> granicus.if.org Git - strace/blob - tests/Makefile.am
tests: check handling of CLONE_PARENT'ed and CLONE_PTRACE'ed processes
[strace] / tests / Makefile.am
1 # Automake input for strace tests.
2 #
3 # Copyright (c) 2011-2016 Dmitry V. Levin <ldv@altlinux.org>
4 # Copyright (c) 2011-2017 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
29 OS = linux
30 ARCH = @arch@
31 MPERS_NAME =
32 ARCH_MFLAGS =
33 AM_CFLAGS = $(WARN_CFLAGS)
34 AM_CPPFLAGS = $(ARCH_MFLAGS) \
35               -I$(builddir) \
36               -I$(top_builddir)/$(OS)/$(ARCH) \
37               -I$(top_srcdir)/$(OS)/$(ARCH) \
38               -I$(top_builddir)/$(OS) \
39               -I$(top_srcdir)/$(OS) \
40               -I$(top_builddir) \
41               -I$(top_srcdir)
42 AM_LDFLAGS = $(ARCH_MFLAGS)
43
44 libtests_a_SOURCES = \
45         create_nl_socket.c \
46         errno2name.c \
47         error_msg.c \
48         fill_memory.c \
49         get_page_size.c \
50         get_sigset_size.c \
51         hexdump_strdup.c \
52         hexquote_strndup.c \
53         inode_of_sockfd.c \
54         libmmsg.c \
55         libsocketcall.c \
56         overflowuid.c \
57         pipe_maxfd.c \
58         print_quoted_string.c \
59         print_time.c \
60         printflags.c \
61         printxval.c \
62         signal2name.c \
63         skip_unavailable.c \
64         sprintrc.c \
65         tail_alloc.c \
66         test_netlink.h \
67         test_nlattr.h \
68         test_printpath.c \
69         test_printstrn.c \
70         test_ucopy.c \
71         test_ucopy.h \
72         tests.h \
73         tprintf.c \
74         # end of libtests_a_SOURCES
75 libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
76 check_LIBRARIES = libtests.a
77 LDADD = libtests.a
78
79 include pure_executables.am
80
81 check_PROGRAMS = $(PURE_EXECUTABLES) \
82         answer \
83         attach-f-p \
84         attach-f-p-cmd \
85         attach-p-cmd-cmd \
86         attach-p-cmd-p \
87         block_reset_raise_run \
88         caps-abbrev \
89         clone_parent \
90         clone_ptrace \
91         count-f \
92         execve-v \
93         execveat-v \
94         filter-unavailable \
95         fork-f \
96         getpid  \
97         getppid \
98         gettid \
99         int_0x80 \
100         ioctl_dm-v \
101         ioctl_evdev-v \
102         ioctl_loop-nv \
103         ioctl_loop-v \
104         ioctl_nsfs \
105         ioctl_rtc-v \
106         ksysent \
107         mmsg-silent \
108         mmsg_name-v \
109         msg_control-v \
110         net-accept-connect \
111         netlink_inet_diag \
112         netlink_netlink_diag \
113         netlink_unix_diag \
114         nsyscalls \
115         pc \
116         perf_event_open_nonverbose \
117         perf_event_open_unabbrev \
118         ppoll-v \
119         prctl-seccomp-filter-v \
120         prctl-seccomp-strict \
121         print_maxfd \
122         qual_fault \
123         qual_inject-error-signal \
124         qual_inject-retval \
125         qual_inject-signal \
126         qual_signal \
127         quotactl-v \
128         quotactl-xfs-v \
129         redirect-fds \
130         restart_syscall \
131         run_expect_termsig \
132         scm_rights \
133         seccomp-filter-v \
134         seccomp-strict \
135         set_ptracer_any \
136         signal_receive \
137         sleep \
138         stack-fcall \
139         threads-execve \
140         unblock_reset_raise \
141         unix-pair-send-recv \
142         unix-pair-sendto-recvfrom \
143         vfork-f \
144         wait4-v \
145         waitid-v \
146         zeroargc \
147         # end of check_PROGRAMS
148
149 attach_f_p_LDADD = -lrt -lpthread $(LDADD)
150 clock_xettime_LDADD = -lrt $(LDADD)
151 count_f_LDADD = -lpthread $(LDADD)
152 filter_unavailable_LDADD = -lpthread $(LDADD)
153 fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
154 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
155 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
156 lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
157 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
158 mq_LDADD = -lrt $(LDADD)
159 mq_sendrecv_LDADD = -lrt $(LDADD)
160 mq_sendrecv_read_LDADD = -lrt $(LDADD)
161 mq_sendrecv_write_LDADD = -lrt $(LDADD)
162 newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
163 pc_LDADD = $(dl_LIBS) $(LDADD)
164 pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
165 preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
166 preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
167 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
168 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
169 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
170 threads_execve_LDADD = -lrt -lpthread $(LDADD)
171 times_LDADD = -lrt $(LDADD)
172 truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
173 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
174
175 stack_fcall_SOURCES = stack-fcall.c \
176         stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c
177
178 include gen_tests.am
179
180 if USE_LIBUNWIND
181 LIBUNWIND_TESTS = strace-k.test
182 else
183 LIBUNWIND_TESTS =
184 endif
185
186 DECODER_TESTS = \
187         brk.test \
188         btrfs-v.test \
189         btrfs-vw.test \
190         btrfs-w.test \
191         caps-abbrev.test \
192         caps.test \
193         eventfd.test \
194         execve-v.test \
195         execve.test \
196         fadvise64.test \
197         futex.test \
198         getuid.test \
199         ioctl.test \
200         ioctl_dm-v.test \
201         ioctl_dm.test \
202         ioctl_loop-nv.test \
203         ioctl_nsfs.test \
204         ioctl_sock_gifconf.test \
205         ipc_msgbuf.test \
206         llseek.test \
207         lseek.test \
208         mmap.test \
209         net-y-unix.test \
210         net-yy-inet.test \
211         net-yy-netlink.test \
212         net-yy-unix.test \
213         net.test \
214         netlink_sock_diag.test \
215         nsyscalls.test \
216         oldselect.test \
217         personality.test \
218         pipe.test \
219         poll.test \
220         prctl-arg2-intptr.test \
221         prctl-dumpable.test \
222         prctl-name.test \
223         prctl-no-args.test \
224         prctl-pdeathsig.test \
225         prctl-seccomp-filter-v.test \
226         prctl-seccomp-strict.test \
227         prctl-securebits.test \
228         prctl-tid_address.test \
229         prctl-tsc.test \
230         qual_fault-exit_group.test \
231         readv.test \
232         rt_sigaction.test \
233         scm_rights-fd.test \
234         seccomp-strict.test \
235         sigaltstack.test \
236         sun_path.test \
237         uio.test \
238         umount.test \
239         umount2.test \
240         umovestr.test \
241         umovestr2.test \
242         uname.test \
243         unix-pair-send-recv.test \
244         unix-pair-sendto-recvfrom.test \
245         # end of DECODER_TESTS
246
247 MISC_TESTS = \
248         attach-f-p.test \
249         attach-p-cmd.test \
250         bexecve.test \
251         clone_parent.test \
252         clone_ptrace.test \
253         count-f.test \
254         count.test \
255         detach-running.test \
256         detach-sleeping.test \
257         detach-stopped.test \
258         filter-unavailable.test \
259         get_regs.test \
260         interactive_block.test \
261         ksysent.test \
262         opipe.test \
263         options-syntax.test \
264         pc.test \
265         printpath-umovestr-legacy.test \
266         printstrn-umoven-legacy.test \
267         qual_fault-syntax.test \
268         qual_fault.test \
269         qual_inject-error-signal.test \
270         qual_inject-retval.test \
271         qual_inject-signal.test \
272         qual_inject-syntax.test \
273         qual_signal.test \
274         qual_syscall.test \
275         redirect-fds.test \
276         redirect.test \
277         restart_syscall.test \
278         strace-C.test \
279         strace-E.test \
280         strace-S.test \
281         strace-T.test \
282         strace-V.test \
283         strace-ff.test \
284         strace-r.test \
285         strace-t.test \
286         strace-tt.test \
287         strace-ttt.test \
288         termsig.test \
289         threads-execve.test \
290         # end of MISC_TESTS
291
292 TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS)
293
294 XFAIL_TESTS_ =
295 XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS)
296 XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS)
297 XFAIL_TESTS_x86_64 = int_0x80.gen.test
298 XFAIL_TESTS_x32 = int_0x80.gen.test
299 XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
300
301 TEST_LOG_COMPILER = env
302 AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh
303
304 @VALGRIND_CHECK_RULES@
305 VALGRIND_FLAGS = --quiet
306 VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp
307
308 EXTRA_DIST = \
309         caps-abbrev.awk \
310         caps.awk \
311         clock.in \
312         count-f.expected \
313         eventfd.expected \
314         fadvise.h \
315         filter-unavailable.expected \
316         fstatat.c \
317         fstatx.c \
318         gen_pure_executables.sh \
319         gen_tests.in \
320         gen_tests.sh \
321         getresugid.c \
322         init.sh \
323         init_delete_module.h \
324         ioctl-v.sh \
325         ipc.sh \
326         ipc_msgbuf.expected \
327         ksysent.sed \
328         lstatx.c \
329         match.awk \
330         net.expected \
331         netlink_sock_diag-v.sh \
332         oldselect.expected \
333         pipe.expected \
334         process_vm_readv_writev.c \
335         pure_executables.list \
336         qual_fault-exit_group.expected \
337         qual_inject-error-signal.expected \
338         qual_inject-signal.expected \
339         quotactl.h \
340         regex.in \
341         rt_sigaction.awk \
342         run.sh \
343         sched.in \
344         scno_tampering.sh \
345         setfsugid.c \
346         setresugid.c \
347         setreugid.c \
348         setugid.c \
349         sigaltstack.expected \
350         sockname.c \
351         strace-C.expected \
352         strace-E.expected \
353         strace-T.expected \
354         strace-ff.expected \
355         strace-k.test \
356         strace-r.expected \
357         strace.supp \
358         struct_flock.c \
359         sun_path.expected \
360         trace_fstat.in \
361         trace_fstatfs.in \
362         trace_lstat.in \
363         trace_question.in \
364         trace_stat.in \
365         trace_stat_like.in \
366         trace_statfs.in \
367         trace_statfs_like.in \
368         uio.expected \
369         umode_t.c \
370         umovestr.expected \
371         unix-pair-send-recv.expected \
372         unix-pair-sendto-recvfrom.expected \
373         xchownx.c \
374         xgetrlimit.c \
375         xselect.c \
376         xstatfs.c \
377         xstatfs64.c \
378         xstatfsx.c \
379         xstatx.c \
380         xutimes.c \
381         $(TESTS)
382
383 ksysent.h: $(srcdir)/ksysent.sed
384         echo '#include <asm/unistd.h>' | \
385                 $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1
386         LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2
387         mv -f $@.t2 $@
388         rm -f $@.t1
389
390 ksysent.$(OBJEXT): ksysent.h
391
392 objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT)))
393 $(objects): scno.h
394
395 clean-local: clean-local-check
396 .PHONY: clean-local-check
397 clean-local-check:
398         -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir)
399
400 .PHONY: check-valgrind-local
401 check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS)
402
403 BUILT_SOURCES = ksysent.h
404 CLEANFILES = ksysent.h
405
406 include ../scno.am