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