tests: convert epoll_create1.test from match_grep to match_diff

* 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.
This commit is contained in:
Дмитрий Левин 2016-01-06 16:08:07 +00:00
parent 6e65922a32
commit 6267e4b0e3
4 changed files with 12 additions and 6 deletions

View 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 \

View 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;
}

View File

@ -1,2 +0,0 @@
epoll_create1\(EPOLL_CLOEXEC\) += 0
epoll_create1\(EPOLL_CLOEXEC\|0x[[:xdigit:]]+\) += -1 EINVAL .*

View File

@ -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