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