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