]> granicus.if.org Git - strace/blob - tests/Makefile.am
build: do not hardcode -lrt
[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         execve-v \
101         execveat-v \
102         filter-unavailable \
103         fork-f \
104         fsync-y \
105         getpid  \
106         getppid \
107         gettid \
108         int_0x80 \
109         ioctl_dm-v \
110         ioctl_evdev-v \
111         ioctl_loop-nv \
112         ioctl_loop-v \
113         ioctl_nsfs \
114         ioctl_rtc-v \
115         is_linux_mips_n64 \
116         ksysent \
117         list_sigaction_signum \
118         mmsg-silent \
119         mmsg_name-v \
120         msg_control-v \
121         net-accept-connect \
122         netlink_inet_diag \
123         netlink_netlink_diag \
124         netlink_unix_diag \
125         nsyscalls \
126         nsyscalls-d \
127         oldselect-P \
128         oldselect-efault-P \
129         pc \
130         perf_event_open_nonverbose \
131         perf_event_open_unabbrev \
132         ppoll-v \
133         prctl-seccomp-filter-v \
134         prctl-seccomp-strict \
135         print_maxfd \
136         qual_fault \
137         qual_inject-error-signal \
138         qual_inject-retval \
139         qual_inject-signal \
140         qual_signal \
141         quotactl-v \
142         quotactl-xfs-v \
143         redirect-fds \
144         restart_syscall \
145         run_expect_termsig \
146         scm_rights \
147         seccomp-filter-v \
148         seccomp-strict \
149         select-P \
150         set_ptracer_any \
151         set_sigblock \
152         set_sigign \
153         signal_receive \
154         sleep \
155         stack-fcall \
156         stack-fcall-mangled \
157         threads-execve \
158         unblock_reset_raise \
159         unix-pair-send-recv \
160         unix-pair-sendto-recvfrom \
161         vfork-f \
162         wait4-v \
163         waitid-v \
164         zeroargc \
165         # end of check_PROGRAMS
166
167 attach_f_p_LDADD = -lpthread $(LDADD)
168 count_f_LDADD = -lpthread $(LDADD)
169 filter_unavailable_LDADD = -lpthread $(LDADD)
170 fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
171 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
172 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
173 lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
174 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
175 mq_LDADD = $(mq_LIBS) $(LDADD)
176 newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
177 pc_LDADD = $(dl_LIBS) $(LDADD)
178 pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
179 preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
180 preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
181 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
182 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
183 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
184 threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD)
185 times_LDADD = $(clock_LIBS) $(LDADD)
186 truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
187 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
188
189 stack_fcall_SOURCES = stack-fcall.c \
190         stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c
191
192 stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \
193         stack-fcall-mangled-0.c stack-fcall-mangled-1.c \
194         stack-fcall-mangled-2.c stack-fcall-mangled-3.c
195
196 include gen_tests.am
197
198 if USE_LIBUNWIND
199 LIBUNWIND_TESTS = strace-k.test
200 if USE_DEMANGLE
201 LIBUNWIND_TESTS += strace-k-demangle.test
202 endif
203 else
204 LIBUNWIND_TESTS =
205 endif
206
207 DECODER_TESTS = \
208         brk.test \
209         btrfs-v.test \
210         btrfs-vw.test \
211         btrfs-w.test \
212         caps-abbrev.test \
213         caps.test \
214         eventfd.test \
215         execve-v.test \
216         execve.test \
217         fadvise64.test \
218         futex.test \
219         getuid.test \
220         ioctl.test \
221         ipc_msgbuf.test \
222         llseek.test \
223         lseek.test \
224         mmap.test \
225         net-y-unix.test \
226         net-yy-inet.test \
227         net-yy-netlink.test \
228         net-yy-unix.test \
229         net.test \
230         netlink_sock_diag.test \
231         nsyscalls.test \
232         nsyscalls-d.test \
233         nsyscalls-nd.test \
234         personality.test \
235         pipe.test \
236         poll-P.test \
237         poll.test \
238         prctl-arg2-intptr.test \
239         prctl-dumpable.test \
240         prctl-name.test \
241         prctl-no-args.test \
242         prctl-pdeathsig.test \
243         prctl-seccomp-filter-v.test \
244         prctl-seccomp-strict.test \
245         prctl-securebits.test \
246         prctl-tid_address.test \
247         prctl-tsc.test \
248         qual_fault-exit_group.test \
249         readv.test \
250         rt_sigaction.test \
251         scm_rights-fd.test \
252         seccomp-strict.test \
253         sigaltstack.test \
254         sun_path.test \
255         xet_thread_area_x86.test \
256         uio.test \
257         umount.test \
258         umount2.test \
259         umovestr.test \
260         umovestr2.test \
261         uname.test \
262         unix-pair-send-recv.test \
263         unix-pair-sendto-recvfrom.test \
264         # end of DECODER_TESTS
265
266 MISC_TESTS = \
267         attach-f-p.test \
268         attach-p-cmd.test \
269         bexecve.test \
270         clone_parent.test \
271         clone_ptrace.test \
272         count-f.test \
273         count.test \
274         detach-running.test \
275         detach-sleeping.test \
276         detach-stopped.test \
277         filter-unavailable.test \
278         filtering_fd-syntax.test \
279         filtering_syscall-syntax.test \
280         fflush.test \
281         get_regs.test \
282         interactive_block.test \
283         ksysent.test \
284         opipe.test \
285         options-syntax.test \
286         pc.test \
287         printpath-umovestr-legacy.test \
288         printstrn-umoven-legacy.test \
289         qual_fault-syntax.test \
290         qual_fault.test \
291         qual_inject-error-signal.test \
292         qual_inject-retval.test \
293         qual_inject-signal.test \
294         qual_inject-syntax.test \
295         qual_signal.test \
296         qual_syscall.test \
297         redirect-fds.test \
298         redirect.test \
299         restart_syscall.test \
300         sigblock.test \
301         sigign.test \
302         strace-C.test \
303         strace-E.test \
304         strace-S.test \
305         strace-T.test \
306         strace-V.test \
307         strace-ff.test \
308         strace-r.test \
309         strace-t.test \
310         strace-tt.test \
311         strace-ttt.test \
312         termsig.test \
313         threads-execve.test \
314         # end of MISC_TESTS
315
316 TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS)
317
318 XFAIL_TESTS_ =
319 XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS)
320 XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS)
321 XFAIL_TESTS_x86_64 = int_0x80.gen.test
322 XFAIL_TESTS_x32 = int_0x80.gen.test
323 XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
324
325 TEST_LOG_COMPILER = env
326 AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \
327                         SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \
328                         SIZEOF_LONG=$(SIZEOF_LONG) \
329                         MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh
330
331 @VALGRIND_CHECK_RULES@
332 VALGRIND_FLAGS = --quiet
333 VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp
334
335 EXTRA_DIST = \
336         accept_compat.h \
337         attach-p-cmd.h \
338         caps-abbrev.awk \
339         caps.awk \
340         clock.in \
341         count-f.expected \
342         eventfd.expected \
343         fadvise.h \
344         filter-unavailable.expected \
345         fstatat.c \
346         fstatx.c \
347         gen_pure_executables.sh \
348         gen_tests.in \
349         gen_tests.sh \
350         getresugid.c \
351         init.sh \
352         init_delete_module.h \
353         ipc.sh \
354         ipc_msgbuf.expected \
355         ksysent.sed \
356         lstatx.c \
357         match.awk \
358         net.expected \
359         netlink_sock_diag-v.sh \
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