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