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