]> granicus.if.org Git - strace/blob - tests/Makefile.am
tests: add hexdump_strdup function to libtests
[strace] / tests / Makefile.am
1 # Automake input for strace tests.
2 #
3 # Copyright (c) 2011-2016 Dmitry V. Levin <ldv@altlinux.org>
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 #    notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 #    notice, this list of conditions and the following disclaimer in the
13 #    documentation and/or other materials provided with the distribution.
14 # 3. The name of the author may not be used to endorse or promote products
15 #    derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 OS = linux
29 ARCH = @arch@
30 MPERS_NAME =
31 ARCH_MFLAGS =
32 AM_CFLAGS = $(WARN_CFLAGS)
33 AM_CPPFLAGS = $(ARCH_MFLAGS) \
34               -I$(builddir) \
35               -I$(top_builddir)/$(OS)/$(ARCH) \
36               -I$(top_srcdir)/$(OS)/$(ARCH) \
37               -I$(top_builddir)/$(OS) \
38               -I$(top_srcdir)/$(OS) \
39               -I$(top_builddir) \
40               -I$(top_srcdir)
41 AM_LDFLAGS = $(ARCH_MFLAGS)
42
43 libtests_a_SOURCES = \
44         error_msg.c \
45         get_page_size.c \
46         hexdump_strdup.c \
47         tail_alloc.c \
48         tests.h \
49         tprintf.c \
50         # end of libtests_a_SOURCES
51 libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
52 check_LIBRARIES = libtests.a
53 LDADD = libtests.a
54
55 check_PROGRAMS = \
56         _newselect \
57         adjtimex \
58         aio \
59         bpf \
60         caps \
61         clock_nanosleep \
62         clock_xettime \
63         epoll_create1 \
64         eventfd \
65         execve \
66         execveat \
67         fanotify_mark \
68         fcntl \
69         fcntl64 \
70         file_handle \
71         filter-unavailable \
72         fork-f \
73         fstat \
74         fstat64 \
75         fstatat64 \
76         ftruncate \
77         ftruncate64 \
78         getdents \
79         getdents64 \
80         getrandom \
81         getxxid \
82         inet-accept-connect-send-recv \
83         inet-cmsg \
84         ioctl \
85         ip_mreq \
86         ipc_msg \
87         ipc_msgbuf \
88         ipc_sem \
89         ipc_shm \
90         ksysent \
91         llseek \
92         lseek \
93         lstat \
94         lstat64 \
95         membarrier \
96         memfd_create \
97         mlock2 \
98         mmap \
99         mmap64 \
100         mmsg \
101         mq \
102         nanosleep \
103         net-accept-connect \
104         netlink_inet_diag \
105         netlink_unix_diag \
106         newfstatat \
107         oldselect \
108         pc \
109         personality \
110         pipe \
111         ppoll \
112         pselect6 \
113         readdir \
114         readlink \
115         readlinkat \
116         restart_syscall \
117         rt_sigqueueinfo \
118         sched_xetaffinity \
119         sched_xetattr \
120         scm_rights \
121         seccomp \
122         select \
123         sendfile \
124         sendfile64 \
125         set_ptracer_any \
126         sigaction \
127         sigaltstack \
128         signalfd \
129         sigreturn \
130         stack-fcall \
131         stat \
132         stat64 \
133         statfs \
134         sysinfo \
135         time \
136         timer_create \
137         timer_xettime \
138         timerfd_xettime \
139         times \
140         times-fail \
141         truncate \
142         truncate64 \
143         uid \
144         uid16 \
145         uid32 \
146         uio \
147         umount \
148         umount2 \
149         umovestr \
150         umovestr2 \
151         unix-pair-send-recv \
152         userfaultfd \
153         utime \
154         utimensat \
155         vfork-f \
156         wait \
157         xattr \
158         xet_robust_list \
159         xetitimer \
160         xettimeofday \
161         # end of check_PROGRAMS
162
163 clock_xettime_LDADD = -lrt $(LDADD)
164 filter_unavailable_LDADD = -lpthread $(LDADD)
165 fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
166 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
167 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
168 lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
169 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
170 mq_LDADD = -lrt $(LDADD)
171 newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
172 pc_LDADD = $(dl_LIBS) $(LDADD)
173 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
174 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
175 times_LDADD = -lrt $(LDADD)
176 truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
177 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
178 stack_fcall_SOURCES = stack-fcall.c \
179         stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c
180
181 if USE_LIBUNWIND
182 LIBUNWIND_TESTS = strace-k.test
183 else
184 LIBUNWIND_TESTS =
185 endif
186
187 TESTS = \
188         strace-f.test \
189         qual_syscall.test \
190         ksysent.test \
191         \
192         _newselect.test \
193         adjtimex.test \
194         aio.test \
195         bexecve.test \
196         bpf.test \
197         caps.test \
198         clock_nanosleep.test \
199         clock_xettime.test \
200         dumpio.test \
201         epoll_create1.test \
202         eventfd.test \
203         execve.test \
204         execveat.test \
205         fanotify_mark.test \
206         fcntl.test \
207         fcntl64.test \
208         file_handle.test \
209         filter-unavailable.test \
210         fork-f.test \
211         fstat.test \
212         fstat64.test \
213         fstatat64.test \
214         ftruncate.test \
215         ftruncate64.test \
216         getdents.test \
217         getdents64.test \
218         getrandom.test \
219         getxxid.test \
220         inet-cmsg.test \
221         ioctl.test \
222         ip_mreq.test \
223         ipc_msg.test \
224         ipc_msgbuf.test \
225         ipc_sem.test \
226         ipc_shm.test \
227         llseek.test \
228         lseek.test \
229         lstat.test \
230         lstat64.test \
231         membarrier.test \
232         memfd_create.test \
233         mlock2.test \
234         mmap.test \
235         mmap64.test \
236         mmsg.test \
237         mq.test \
238         nanosleep.test \
239         net-fd.test \
240         net-yy.test \
241         net.test \
242         newfstatat.test \
243         oldselect.test \
244         pc.test \
245         personality.test \
246         pipe.test \
247         ppoll.test \
248         pselect6.test \
249         readdir.test \
250         readlink.test \
251         readlinkat.test \
252         rt_sigqueueinfo.test \
253         sched_xetaffinity.test \
254         sched_xetattr.test \
255         scm_rights-fd.test \
256         seccomp.test \
257         select.test \
258         sendfile.test \
259         sendfile64.test \
260         sigaction.test \
261         sigaltstack.test \
262         signalfd.test \
263         sigreturn.test \
264         stat.test \
265         stat64.test \
266         statfs.test \
267         sun_path.test \
268         sysinfo.test \
269         time.test \
270         timer_create.test \
271         timer_xettime.test \
272         timerfd_xettime.test \
273         times-fail.test \
274         times.test \
275         truncate.test \
276         truncate64.test \
277         uid.test \
278         uid16.test \
279         uid32.test \
280         uio.test \
281         umount.test \
282         umount2.test \
283         umovestr.test \
284         umovestr2.test \
285         unix-yy.test \
286         userfaultfd.test \
287         utime.test \
288         utimensat.test \
289         vfork-f.test \
290         wait.test \
291         xattr.test \
292         xet_robust_list.test \
293         xetitimer.test \
294         xettimeofday.test \
295         \
296         count.test \
297         detach-sleeping.test \
298         detach-stopped.test \
299         detach-running.test \
300         restart_syscall.test \
301         $(LIBUNWIND_TESTS)
302
303 XFAIL_TESTS_ =
304 XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS)
305 XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS)
306 XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME))
307
308 net-fd.log: net.log
309
310 TEST_LOG_COMPILER = env
311 AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) $(srcdir)/run.sh
312
313 EXTRA_DIST = init.sh run.sh match.awk \
314              caps.awk \
315              dumpio.expected \
316              eventfd.expected \
317              execve.expected \
318              execve-v.expected \
319              execveat.expected \
320              execveat-v.expected \
321              fanotify_mark.expected \
322              filter-unavailable.expected \
323              fstatat.c \
324              fstatx.c \
325              ip_mreq.expected \
326              ipc.sh \
327              ipc_msgbuf.expected \
328              ksysent.sed \
329              lstatx.c \
330              memfd_create.expected \
331              mq.expected \
332              net.expected \
333              net-fd.expected \
334              net-yy-accept.awk \
335              net-yy-connect.awk \
336              oldselect.expected \
337              pipe.expected \
338              ppoll.expected \
339              ppoll-v.expected \
340              sigaction.awk \
341              sigaltstack.expected \
342              signalfd.expected \
343              statfs.expected \
344              statx.sh \
345              struct_flock.c \
346              sun_path.expected \
347              uid.awk \
348              uio.expected \
349              umovestr.expected \
350              unix-yy-accept.awk \
351              unix-yy-connect.awk \
352              wait.expected \
353              xattr.expected \
354              xselect.c \
355              xstatx.c \
356              $(TESTS)
357
358 ksysent.h: $(srcdir)/ksysent.sed
359         echo '#include <asm/unistd.h>' | \
360                 $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dD - > $@.t1
361         LC_COLLATE=C sed -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2
362         mv -f $@.t2 $@
363         rm -f $@.t1
364
365 BUILT_SOURCES = ksysent.h
366 CLEANFILES = ksysent.h $(TESTS:=.tmp)