]> granicus.if.org Git - strace/commitdiff
tests: generate pure_executables part of check_PROGRAMS automatically
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 17 Apr 2017 00:53:19 +0000 (00:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 17 Apr 2017 00:53:19 +0000 (00:53 +0000)
* tests/gen_pure_executables.sh: New file.
* bootstrap: Invoke it.
* tests/Makefile.am: Include pure_executables.am.
(check_PROGRAMS): Add $(PURE_EXECUTABLES).  Remove everything listed
in pure_executables.list.
(EXTRA_DIST): Add gen_pure_executables.sh.
* tests/.gitignore: Add pure_executables.am.

bootstrap
tests/.gitignore
tests/Makefile.am
tests/gen_pure_executables.sh [new file with mode: 0755]

index fd49b455350a456d5a2ac4f97b56cab4f7140dd9..a9cadf531d76a3f8b05a45c0565354925431052c 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -2,6 +2,7 @@
 
 ./generate_mpers_am.sh
 ./xlat/gen.sh
+./tests/gen_pure_executables.sh
 ./tests/gen_tests.sh
 
 for m in m32 mx32; do
index 5c6b5fe03357fbee41272736a05d740e62115020..4a7fe258d4f0b7470fe822646bf15cddd0f87876 100644 (file)
@@ -244,6 +244,7 @@ process_vm_readv
 process_vm_writev
 pselect6
 ptrace
+pure_executables.am
 pwritev
 qual_fault
 qual_inject-error-signal
index c76ed8d4b1e330c7f0977c98433bd8a2faf37a50..93381874a9518ea2b6795047d5dfa0615e84115f 100644 (file)
@@ -67,390 +67,68 @@ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
 check_LIBRARIES = libtests.a
 LDADD = libtests.a
 
-check_PROGRAMS = \
-       _newselect \
-       accept \
-       accept4 \
-       access \
-       acct \
-       add_key \
-       adjtimex \
-       aio \
-       alarm \
+include pure_executables.am
+
+check_PROGRAMS = $(PURE_EXECUTABLES) \
        answer \
        attach-f-p \
        attach-f-p-cmd \
        attach-p-cmd-cmd \
        attach-p-cmd-p \
-       bpf \
-       brk \
-       btrfs \
-       caps \
        caps-abbrev \
-       chmod \
-       chown \
-       chown32 \
-       chroot \
-       clock_adjtime \
-       clock_nanosleep \
-       clock_xettime \
-       copy_file_range \
        count-f \
-       creat \
-       delete_module \
-       dup \
-       dup2 \
-       dup3 \
-       epoll_create \
-       epoll_create1 \
-       epoll_ctl \
-       epoll_pwait \
-       epoll_wait \
-       erestartsys \
-       eventfd \
-       execve \
        execve-v \
-       execveat \
        execveat-v \
-       faccessat \
-       fadvise64 \
-       fadvise64_64 \
-       fallocate \
-       fanotify_init \
-       fanotify_mark \
-       fchdir \
-       fchmod \
-       fchmodat \
-       fchown \
-       fchown32 \
-       fchownat \
-       fcntl \
-       fcntl64 \
-       fdatasync \
-       file_handle \
-       file_ioctl \
        filter-unavailable \
-       finit_module \
-       flock \
        fork-f \
-       fstat \
-       fstat64 \
-       fstatat64 \
-       fstatfs \
-       fstatfs64 \
-       fsync \
-       ftruncate \
-       ftruncate64 \
-       futex \
-       futimesat \
-       get_mempolicy \
-       getcpu \
-       getcwd \
-       getdents \
-       getdents64 \
-       getegid \
-       getegid32 \
-       geteuid \
-       geteuid32 \
-       getgid \
-       getgid32 \
-       getgroups \
-       getgroups32 \
-       getpeername \
-       getpgrp \
        getpid  \
        getppid \
-       getrandom \
-       getresgid \
-       getresgid32 \
-       getresuid \
-       getresuid32 \
-       getrlimit \
-       getrusage \
-       getsid \
-       getsockname \
        gettid \
-       getuid \
-       getuid32 \
-       getxxid \
-       inet-cmsg \
-       init_module \
-       inotify \
-       inotify_init1 \
        int_0x80 \
-       ioctl \
-       ioctl_block \
-       ioctl_dm \
        ioctl_dm-v \
-       ioctl_evdev \
        ioctl_evdev-v \
-       ioctl_loop \
        ioctl_loop-nv \
        ioctl_loop-v \
-       ioctl_mtd \
        ioctl_nsfs \
-       ioctl_rtc \
        ioctl_rtc-v \
-       ioctl_scsi \
-       ioctl_sg_io_v3 \
-       ioctl_sg_io_v4 \
-       ioctl_sock_gifconf \
-       ioctl_uffdio \
-       ioctl_v4l2 \
-       ioperm \
-       iopl \
-       ioprio \
-       ip_mreq \
-       ipc \
-       ipc_msg \
-       ipc_msgbuf \
-       ipc_sem \
-       ipc_shm \
-       kcmp \
-       kexec_file_load \
-       kexec_load \
-       keyctl \
-       kill \
        ksysent \
-       lchown \
-       lchown32 \
-       link \
-       linkat \
-       llseek \
-       lookup_dcookie \
-       lseek \
-       lstat \
-       lstat64 \
-       mbind \
-       membarrier \
-       memfd_create \
-       migrate_pages \
-       mincore \
-       mkdir \
-       mkdirat \
-       mknod \
-       mknodat \
-       mlock \
-       mlock2 \
-       mlockall \
-       mmap \
-       mmap64 \
-       mmsg \
        mmsg-silent \
-       mmsg_name \
        mmsg_name-v \
-       mount \
-       move_pages \
-       mq \
-       mq_sendrecv \
-       mq_sendrecv-read \
-       mq_sendrecv-write \
-       msg_control \
        msg_control-v \
-       msg_name \
-       munlockall \
-       nanosleep \
        net-accept-connect \
-       net-icmp_filter \
-       net-sockaddr \
-       net-y-unix \
-       net-yy-inet \
-       net-yy-netlink \
-       net-yy-unix \
        netlink_inet_diag \
        netlink_netlink_diag \
-       netlink_protocol \
        netlink_unix_diag \
-       newfstatat \
        nsyscalls \
-       old_mmap \
-       oldfstat \
-       oldlstat \
-       oldselect \
-       oldstat \
-       open \
-       openat \
-       osf_utimes \
-       pause \
        pc \
-       perf_event_open \
        perf_event_open_nonverbose \
        perf_event_open_unabbrev \
-       personality \
-       pipe \
-       pipe2 \
-       pkey_alloc \
-       pkey_free \
-       pkey_mprotect \
-       poll \
-       ppoll \
        ppoll-v \
-       prctl-arg2-intptr \
-       prctl-dumpable \
-       prctl-name \
-       prctl-no-args \
-       prctl-pdeathsig \
        prctl-seccomp-filter-v \
        prctl-seccomp-strict \
-       prctl-securebits \
-       prctl-tid_address \
-       prctl-tsc \
-       pread64-pwrite64 \
-       preadv \
-       preadv-pwritev \
-       preadv2-pwritev2 \
        print_maxfd \
-       printstr \
-       prlimit64 \
-       process_vm_readv \
-       process_vm_writev \
-       pselect6 \
-       ptrace \
-       pwritev \
        qual_fault \
        qual_inject-error-signal \
        qual_inject-retval \
        qual_inject-signal \
        qual_signal \
-       quotactl \
        quotactl-v \
-       quotactl-xfs \
        quotactl-xfs-v \
-       read-write \
-       readahead \
-       readdir \
-       readlink \
-       readlinkat \
-       readv \
-       reboot \
-       recvfrom \
-       recvmmsg-timeout \
-       recvmsg \
        redirect-fds \
-       remap_file_pages \
-       rename \
-       renameat \
-       renameat2 \
-       request_key \
        restart_syscall \
-       rmdir \
-       rt_sigpending \
-       rt_sigprocmask \
-       rt_sigqueueinfo \
-       rt_sigreturn \
-       rt_sigsuspend \
-       rt_sigtimedwait \
-       rt_tgsigqueueinfo \
-       sched_get_priority_mxx \
-       sched_rr_get_interval \
-       sched_xetaffinity \
-       sched_xetattr \
-       sched_xetparam \
-       sched_xetscheduler \
-       sched_yield \
        scm_rights \
-       seccomp-filter \
        seccomp-filter-v \
        seccomp-strict \
-       select \
-       semop \
-       sendfile \
-       sendfile64 \
-       set_mempolicy \
        set_ptracer_any \
-       setdomainname \
-       setfsgid \
-       setfsgid32 \
-       setfsuid \
-       setfsuid32 \
-       setgid \
-       setgid32 \
-       setgroups \
-       setgroups32 \
-       sethostname \
-       setns \
-       setregid \
-       setregid32 \
-       setresgid \
-       setresgid32 \
-       setresuid \
-       setresuid32 \
-       setreuid \
-       setreuid32 \
-       setrlimit \
-       setuid \
-       setuid32 \
-       shmxt \
-       shutdown \
-       sigaction \
-       sigaltstack \
-       siginfo \
        signal_receive \
-       signalfd4 \
-       sigreturn \
        sleep \
-       socketcall \
-       splice \
        stack-fcall \
-       stat \
-       stat64 \
-       statfs \
-       statfs64 \
-       statx \
-       swap \
-       symlink \
-       symlinkat \
-       sync \
-       sync_file_range \
-       sync_file_range2 \
-       sysinfo \
-       syslog \
-       tee \
        threads-execve \
-       time \
-       timer_create \
-       timer_xettime \
-       timerfd_xettime \
-       times \
-       times-fail \
-       truncate \
-       truncate64 \
-       ugetrlimit \
-       uio \
-       umask \
-       umount \
-       umount2 \
-       umoven-illptr \
-       umovestr \
-       umovestr-illptr \
-       umovestr2 \
-       umovestr3 \
-       uname \
        unix-pair-send-recv \
        unix-pair-sendto-recvfrom \
-       unlink \
-       unlinkat \
-       unshare \
-       userfaultfd \
-       ustat \
-       utime \
-       utimensat \
-       utimes \
        vfork-f \
-       vhangup \
-       vmsplice \
-       wait4 \
        wait4-v \
-       waitid \
        waitid-v \
-       waitpid \
-       xattr \
-       xattr-strings \
-       xet_robust_list \
-       xetitimer \
-       xetpgid \
-       xetpriority \
-       xettimeofday \
        # end of check_PROGRAMS
 
 attach_f_p_LDADD = -lrt -lpthread $(LDADD)
@@ -623,6 +301,7 @@ EXTRA_DIST = \
        filter-unavailable.expected \
        fstatat.c \
        fstatx.c \
+       gen_pure_executables.sh \
        gen_tests.in \
        gen_tests.sh \
        getresugid.c \
diff --git a/tests/gen_pure_executables.sh b/tests/gen_pure_executables.sh
new file mode 100755 (executable)
index 0000000..c0e2152
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh -efu
+#
+# Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+usage()
+{
+       cat >&2 <<EOF
+Usage: $0 [<input> [<output>]]
+
+Generate pure_executables.am from <input> list.
+Deduce output file from <input> unless an <output> is specified.
+EOF
+       exit 1
+}
+
+input="${0%/*}/pure_executables.list"
+[ $# -eq 0 ] || { input="$1"; shift; }
+output="$(dirname "$input")/pure_executables.am"
+[ $# -eq 0 ] || { output="$1"; shift; }
+[ $# -eq 0 ] || usage
+
+exec > "$output"
+
+echo "# Generated by $0 from $input; do not edit."
+echo 'PURE_EXECUTABLES = \'
+sed -n 's/^[^#].*/  & \\/p' < "$input"
+echo '  #'