]> granicus.if.org Git - strace/commitdiff
tests: convert epoll_create1.test from match_grep to match_diff
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jan 2016 16:08:07 +0000 (16:08 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jan 2016 16:08:07 +0000 (16:08 +0000)
* tests/epoll_create1.c (main): Print expected output.
* tests/epoll_create1.test: Use match_diff instead of match_grep.
* tests/epoll_create1.expected: Remove.
* tests/Makefile.am (EXTRA_DIST): Remove epoll_create1.expected.

tests/Makefile.am
tests/epoll_create1.c
tests/epoll_create1.expected [deleted file]
tests/epoll_create1.test

index 62d0e560bf2252c7f66c91308a48a6931e4525da..33a975d818c9ae62ea55bdb1061cbde817aece03 100644 (file)
@@ -307,7 +307,6 @@ AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) $(srcdir)/run.sh
 EXTRA_DIST = init.sh run.sh match.awk \
             caps.awk \
             dumpio.expected \
-            epoll_create1.expected \
             eventfd.expected \
             execve.expected \
             execve-v.expected \
index 79196a4c6ea316ba7a4fc116ccdc419baa511f60..4d2e1077962d293076495aaf8259042f435ebeb1 100644 (file)
@@ -28,6 +28,7 @@
 #include "tests.h"
 #include <assert.h>
 #include <fcntl.h>
+#include <stdio.h>
 #include <unistd.h>
 #include <sys/syscall.h>
 
@@ -37,9 +38,15 @@ int
 main(void)
 {
        (void) close(0);
+
        if (syscall(__NR_epoll_create1, O_CLOEXEC))
                perror_msg_and_skip("epoll_create1 O_CLOEXEC");
+       puts("epoll_create1(EPOLL_CLOEXEC) = 0");
+
        assert(syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) == -1);
+       printf("epoll_create1(EPOLL_CLOEXEC|%#x) = -1 EINVAL (%m)\n", O_NONBLOCK);
+
+       puts("+++ exited with 0 +++");
        return 0;
 }
 
diff --git a/tests/epoll_create1.expected b/tests/epoll_create1.expected
deleted file mode 100644 (file)
index 0e82f61..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-epoll_create1\(EPOLL_CLOEXEC\) += 0
-epoll_create1\(EPOLL_CLOEXEC\|0x[[:xdigit:]]+\) += -1 EINVAL .*
index fa93a2b3c92155d60c4c41529e2561852dc393bd..71ac29aa2aa63754303d03dc62c7279f61feee5a 100755 (executable)
@@ -4,8 +4,10 @@
 
 . "${srcdir=.}/init.sh"
 
-run_prog
-run_strace -e epoll_create1 $args
-match_grep
+run_prog > /dev/null
+OUT="$LOG.out"
+run_strace -a28 -eepoll_create1 $args > "$OUT"
+match_diff "$LOG" "$OUT"
+rm -f "$OUT"
 
 exit 0