]> granicus.if.org Git - strace/blob - tests/Makefile.am
tests: use fixed timestamps in utime related tests
[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         errno2name.c \
45         error_msg.c \
46         fill_memory.c \
47         get_page_size.c \
48         get_sigset_size.c \
49         hexdump_strdup.c \
50         hexquote_strndup.c \
51         inode_of_sockfd.c \
52         libmmsg.c \
53         libsocketcall.c \
54         overflowuid.c \
55         pipe_maxfd.c \
56         print_quoted_string.c \
57         print_time.c \
58         printflags.c \
59         printxval.c \
60         signal2name.c \
61         sprintrc.c \
62         tail_alloc.c \
63         tests.h \
64         tprintf.c \
65         # end of libtests_a_SOURCES
66 libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
67 check_LIBRARIES = libtests.a
68 LDADD = libtests.a
69
70 check_PROGRAMS = \
71         _newselect \
72         accept \
73         accept4 \
74         access \
75         acct \
76         add_key \
77         adjtimex \
78         aio \
79         alarm \
80         answer \
81         attach-f-p \
82         attach-f-p-cmd \
83         attach-p-cmd-cmd \
84         attach-p-cmd-p \
85         bpf \
86         brk \
87         btrfs \
88         caps \
89         caps-abbrev \
90         chmod \
91         chown \
92         chown32 \
93         chroot \
94         clock_adjtime \
95         clock_nanosleep \
96         clock_xettime \
97         copy_file_range \
98         count-f \
99         creat \
100         delete_module \
101         dup \
102         dup2 \
103         dup3 \
104         epoll_create \
105         epoll_create1 \
106         epoll_ctl \
107         epoll_pwait \
108         epoll_wait \
109         erestartsys \
110         eventfd \
111         execve \
112         execve-v \
113         execveat \
114         execveat-v \
115         faccessat \
116         fadvise64 \
117         fadvise64_64 \
118         fallocate \
119         fanotify_init \
120         fanotify_mark \
121         fchdir \
122         fchmod \
123         fchmodat \
124         fchown \
125         fchown32 \
126         fchownat \
127         fcntl \
128         fcntl64 \
129         fdatasync \
130         file_handle \
131         file_ioctl \
132         filter-unavailable \
133         finit_module \
134         flock \
135         fork-f \
136         fstat \
137         fstat64 \
138         fstatat64 \
139         fstatfs \
140         fstatfs64 \
141         fsync \
142         ftruncate \
143         ftruncate64 \
144         futex \
145         futimesat \
146         get_mempolicy \
147         getcpu \
148         getcwd \
149         getdents \
150         getdents64 \
151         getegid \
152         getegid32 \
153         geteuid \
154         geteuid32 \
155         getgid \
156         getgid32 \
157         getgroups \
158         getgroups32 \
159         getpeername \
160         getpgrp \
161         getpid  \
162         getppid \
163         getrandom \
164         getresgid \
165         getresgid32 \
166         getresuid \
167         getresuid32 \
168         getrlimit \
169         getrusage \
170         getsid \
171         getsockname \
172         gettid \
173         getuid \
174         getuid32 \
175         getxxid \
176         inet-cmsg \
177         init_module \
178         inotify \
179         inotify_init1 \
180         int_0x80 \
181         ioctl \
182         ioctl_block \
183         ioctl_dm \
184         ioctl_dm-v \
185         ioctl_evdev \
186         ioctl_evdev-v \
187         ioctl_loop \
188         ioctl_loop-nv \
189         ioctl_loop-v \
190         ioctl_mtd \
191         ioctl_nsfs \
192         ioctl_rtc \
193         ioctl_rtc-v \
194         ioctl_scsi \
195         ioctl_sg_io_v3 \
196         ioctl_sg_io_v4 \
197         ioctl_sock_gifconf \
198         ioctl_uffdio \
199         ioctl_v4l2 \
200         ioperm \
201         iopl \
202         ioprio \
203         ip_mreq \
204         ipc \
205         ipc_msg \
206         ipc_msgbuf \
207         ipc_sem \
208         ipc_shm \
209         kcmp \
210         kexec_file_load \
211         kexec_load \
212         keyctl \
213         kill \
214         ksysent \
215         lchown \
216         lchown32 \
217         link \
218         linkat \
219         llseek \
220         lookup_dcookie \
221         lseek \
222         lstat \
223         lstat64 \
224         mbind \
225         membarrier \
226         memfd_create \
227         migrate_pages \
228         mincore \
229         mkdir \
230         mkdirat \
231         mknod \
232         mknodat \
233         mlock \
234         mlock2 \
235         mlockall \
236         mmap \
237         mmap64 \
238         mmsg \
239         mmsg-silent \
240         mmsg_name \
241         mmsg_name-v \
242         mount \
243         move_pages \
244         mq \
245         mq_sendrecv \
246         mq_sendrecv-read \
247         mq_sendrecv-write \
248         msg_control \
249         msg_control-v \
250         msg_name \
251         munlockall \
252         nanosleep \
253         net-accept-connect \
254         net-icmp_filter \
255         net-sockaddr \
256         net-y-unix \
257         net-yy-inet \
258         net-yy-netlink \
259         net-yy-unix \
260         netlink_inet_diag \
261         netlink_netlink_diag \
262         netlink_protocol \
263         netlink_unix_diag \
264         newfstatat \
265         nsyscalls \
266         old_mmap \
267         oldfstat \
268         oldlstat \
269         oldselect \
270         oldstat \
271         open \
272         openat \
273         pause \
274         pc \
275         perf_event_open \
276         perf_event_open_nonverbose \
277         perf_event_open_unabbrev \
278         personality \
279         pipe \
280         pipe2 \
281         pkey_alloc \
282         pkey_free \
283         pkey_mprotect \
284         poll \
285         ppoll \
286         ppoll-v \
287         prctl-arg2-intptr \
288         prctl-dumpable \
289         prctl-name \
290         prctl-no-args \
291         prctl-pdeathsig \
292         prctl-seccomp-filter-v \
293         prctl-seccomp-strict \
294         prctl-securebits \
295         prctl-tid_address \
296         prctl-tsc \
297         pread64-pwrite64 \
298         preadv \
299         preadv-pwritev \
300         preadv2-pwritev2 \
301         print_maxfd \
302         printstr \
303         prlimit64 \
304         process_vm_readv \
305         process_vm_writev \
306         pselect6 \
307         ptrace \
308         pwritev \
309         qual_fault \
310         qual_inject-error-signal \
311         qual_inject-retval \
312         qual_inject-signal \
313         qual_signal \
314         quotactl \
315         quotactl-v \
316         quotactl-xfs \
317         quotactl-xfs-v \
318         read-write \
319         readahead \
320         readdir \
321         readlink \
322         readlinkat \
323         readv \
324         reboot \
325         recvfrom \
326         recvmmsg-timeout \
327         recvmsg \
328         redirect-fds \
329         remap_file_pages \
330         rename \
331         renameat \
332         renameat2 \
333         request_key \
334         restart_syscall \
335         rmdir \
336         rt_sigpending \
337         rt_sigprocmask \
338         rt_sigqueueinfo \
339         rt_sigreturn \
340         rt_sigsuspend \
341         rt_sigtimedwait \
342         rt_tgsigqueueinfo \
343         sched_get_priority_mxx \
344         sched_rr_get_interval \
345         sched_xetaffinity \
346         sched_xetattr \
347         sched_xetparam \
348         sched_xetscheduler \
349         sched_yield \
350         scm_rights \
351         seccomp-filter \
352         seccomp-filter-v \
353         seccomp-strict \
354         select \
355         semop \
356         sendfile \
357         sendfile64 \
358         set_mempolicy \
359         set_ptracer_any \
360         setdomainname \
361         setfsgid \
362         setfsgid32 \
363         setfsuid \
364         setfsuid32 \
365         setgid \
366         setgid32 \
367         setgroups \
368         setgroups32 \
369         sethostname \
370         setns \
371         setregid \
372         setregid32 \
373         setresgid \
374         setresgid32 \
375         setresuid \
376         setresuid32 \
377         setreuid \
378         setreuid32 \
379         setrlimit \
380         setuid \
381         setuid32 \
382         shmxt \
383         shutdown \
384         sigaction \
385         sigaltstack \
386         siginfo \
387         signal_receive \
388         signalfd4 \
389         sigreturn \
390         sleep \
391         socketcall \
392         splice \
393         stack-fcall \
394         stat \
395         stat64 \
396         statfs \
397         statfs64 \
398         statx \
399         swap \
400         symlink \
401         symlinkat \
402         sync \
403         sync_file_range \
404         sync_file_range2 \
405         sysinfo \
406         syslog \
407         tee \
408         threads-execve \
409         time \
410         timer_create \
411         timer_xettime \
412         timerfd_xettime \
413         times \
414         times-fail \
415         truncate \
416         truncate64 \
417         ugetrlimit \
418         uio \
419         umask \
420         umount \
421         umount2 \
422         umoven-illptr \
423         umovestr \
424         umovestr-illptr \
425         umovestr2 \
426         umovestr3 \
427         uname \
428         unix-pair-send-recv \
429         unix-pair-sendto-recvfrom \
430         unlink \
431         unlinkat \
432         unshare \
433         userfaultfd \
434         ustat \
435         utime \
436         utimensat \
437         utimes \
438         vfork-f \
439         vhangup \
440         vmsplice \
441         wait4 \
442         wait4-v \
443         waitid \
444         waitid-v \
445         waitpid \
446         xattr \
447         xattr-strings \
448         xet_robust_list \
449         xetitimer \
450         xetpgid \
451         xetpriority \
452         xettimeofday \
453         # end of check_PROGRAMS
454
455 attach_f_p_LDADD = -lrt -lpthread $(LDADD)
456 clock_xettime_LDADD = -lrt $(LDADD)
457 count_f_LDADD = -lpthread $(LDADD)
458 filter_unavailable_LDADD = -lpthread $(LDADD)
459 fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
460 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
461 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
462 lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
463 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
464 mq_LDADD = -lrt $(LDADD)
465 mq_sendrecv_LDADD = -lrt $(LDADD)
466 mq_sendrecv_read_LDADD = -lrt $(LDADD)
467 mq_sendrecv_write_LDADD = -lrt $(LDADD)
468 newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
469 pc_LDADD = $(dl_LIBS) $(LDADD)
470 pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
471 preadv_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
472 preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
473 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
474 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
475 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
476 threads_execve_LDADD = -lrt -lpthread $(LDADD)
477 times_LDADD = -lrt $(LDADD)
478 truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
479 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
480
481 stack_fcall_SOURCES = stack-fcall.c \
482         stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c
483
484 include gen_tests.am
485
486 if USE_LIBUNWIND
487 LIBUNWIND_TESTS = strace-k.test
488 else
489 LIBUNWIND_TESTS =
490 endif
491
492 DECODER_TESTS = \
493         brk.test \
494         btrfs-v.test \
495         btrfs-vw.test \
496         btrfs-w.test \
497         caps-abbrev.test \
498         caps.test \
499         clock.test \
500         eventfd.test \
501         execve-v.test \
502         execve.test \
503         fadvise64.test \
504         fstat.test \
505         futex.test \
506         getuid.test \
507         ioctl.test \
508         ioctl_dm-v.test \
509         ioctl_dm.test \
510         ioctl_loop-nv.test \
511         ioctl_nsfs.test \
512         ioctl_sock_gifconf.test \
513         ipc_msgbuf.test \
514         llseek.test \
515         lseek.test \
516         mmap.test \
517         net-y-unix.test \
518         net-yy-inet.test \
519         net-yy-netlink.test \
520         net-yy-unix.test \
521         net.test \
522         netlink_protocol.test \
523         nsyscalls.test \
524         oldselect.test \
525         personality.test \
526         pipe.test \
527         poll.test \
528         prctl-arg2-intptr.test \
529         prctl-dumpable.test \
530         prctl-name.test \
531         prctl-no-args.test \
532         prctl-pdeathsig.test \
533         prctl-seccomp-filter-v.test \
534         prctl-seccomp-strict.test \
535         prctl-securebits.test \
536         prctl-tid_address.test \
537         prctl-tsc.test \
538         pread64-pwrite64.test \
539         qual_fault-exit_group.test \
540         read-write.test \
541         readv.test \
542         regex.test \
543         sched.test \
544         scm_rights-fd.test \
545         seccomp-strict.test \
546         sigaction.test \
547         sigaltstack.test \
548         statfs.test \
549         sun_path.test \
550         trace_statfs.test \
551         uio.test \
552         umount.test \
553         umount2.test \
554         umovestr.test \
555         umovestr2.test \
556         uname.test \
557         unix-pair-send-recv.test \
558         unix-pair-sendto-recvfrom.test \
559         utimensat.test \
560         # end of DECODER_TESTS
561
562 MISC_TESTS = \
563         attach-f-p.test \
564         attach-p-cmd.test \
565         bexecve.test \
566         count-f.test \
567         count.test \
568         detach-running.test \
569         detach-sleeping.test \
570         detach-stopped.test \
571         filter-unavailable.test \
572         get_regs.test \
573         ksysent.test \
574         opipe.test \
575         options-syntax.test \
576         pc.test \
577         qual_fault-syntax.test \
578         qual_fault.test \
579         qual_inject-error-signal.test \
580         qual_inject-retval.test \
581         qual_inject-signal.test \
582         qual_inject-syntax.test \
583         qual_signal.test \
584         qual_syscall.test \
585         redirect-fds.test \
586         redirect.test \
587         restart_syscall.test \
588         strace-C.test \
589         strace-E.test \
590         strace-S.test \
591         strace-T.test \
592         strace-V.test \
593         strace-ff.test \
594         strace-r.test \
595         strace-t.test \
596         strace-tt.test \
597         strace-ttt.test \
598         threads-execve.test \
599         # end of MISC_TESTS
600
601 TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS)
602
603 XFAIL_TESTS_ =
604 XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS)
605 XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS)
606 XFAIL_TESTS_x86_64 = int_0x80.gen.test
607 XFAIL_TESTS_x32 = int_0x80.gen.test
608 XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH))
609
610 TEST_LOG_COMPILER = env
611 AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh
612
613 @VALGRIND_CHECK_RULES@
614 VALGRIND_FLAGS = --quiet
615 VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp
616
617 EXTRA_DIST = gen_tests.in gen_tests.sh init.sh run.sh match.awk \
618              caps-abbrev.awk \
619              caps.awk \
620              count-f.expected \
621              eventfd.expected \
622              fadvise.h \
623              filter-unavailable.expected \
624              fstatat.c \
625              fstatx.c \
626              getresugid.c \
627              init_delete_module.h \
628              ioctl-v.sh \
629              ipc.sh \
630              ipc_msgbuf.expected \
631              ksysent.sed \
632              lstatx.c \
633              net.expected \
634              oldselect.expected \
635              pipe.expected \
636              process_vm_readv_writev.c \
637              pure_executables.list \
638              qual_fault-exit_group.expected \
639              qual_inject-error-signal.expected \
640              qual_inject-signal.expected \
641              quotactl.h \
642              scno_tampering.sh \
643              setfsugid.c \
644              setresugid.c \
645              setreugid.c \
646              setugid.c \
647              sigaction.awk \
648              sigaltstack.expected \
649              sockname.c \
650              strace-C.expected \
651              strace-E.expected \
652              strace-T.expected \
653              strace-ff.expected \
654              strace-k.test \
655              strace-r.expected \
656              strace.supp \
657              struct_flock.c \
658              sun_path.expected \
659              uio.expected \
660              umode_t.c \
661              umovestr.expected \
662              unix-pair-send-recv.expected \
663              unix-pair-sendto-recvfrom.expected \
664              xchownx.c \
665              xgetrlimit.c \
666              xselect.c \
667              xstatfs.c \
668              xstatfs64.c \
669              xstatfsx.c \
670              xstatx.c \
671              $(TESTS)
672
673 ksysent.h: $(srcdir)/ksysent.sed
674         echo '#include <asm/unistd.h>' | \
675                 $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1
676         LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2
677         mv -f $@.t2 $@
678         rm -f $@.t1
679
680 ksysent.$(OBJEXT): ksysent.h
681
682 objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT)))
683 $(objects): scno.h
684
685 clean-local: clean-local-check
686 .PHONY: clean-local-check
687 clean-local-check:
688         -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir)
689
690 CLEANFILES = ksysent.h
691
692 include ../scno.am