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