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