Skip to content

Commit 6267e4b

Browse files
committed
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.
1 parent 6e65922 commit 6267e4b

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

tests/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) $(srcdir)/run.sh
307307
EXTRA_DIST = init.sh run.sh match.awk \
308308
caps.awk \
309309
dumpio.expected \
310-
epoll_create1.expected \
311310
eventfd.expected \
312311
execve.expected \
313312
execve-v.expected \

tests/epoll_create1.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "tests.h"
2929
#include <assert.h>
3030
#include <fcntl.h>
31+
#include <stdio.h>
3132
#include <unistd.h>
3233
#include <sys/syscall.h>
3334

@@ -37,9 +38,15 @@ int
3738
main(void)
3839
{
3940
(void) close(0);
41+
4042
if (syscall(__NR_epoll_create1, O_CLOEXEC))
4143
perror_msg_and_skip("epoll_create1 O_CLOEXEC");
44+
puts("epoll_create1(EPOLL_CLOEXEC) = 0");
45+
4246
assert(syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) == -1);
47+
printf("epoll_create1(EPOLL_CLOEXEC|%#x) = -1 EINVAL (%m)\n", O_NONBLOCK);
48+
49+
puts("+++ exited with 0 +++");
4350
return 0;
4451
}
4552

tests/epoll_create1.expected

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/epoll_create1.test

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
. "${srcdir=.}/init.sh"
66

7-
run_prog
8-
run_strace -e epoll_create1 $args
9-
match_grep
7+
run_prog > /dev/null
8+
OUT="$LOG.out"
9+
run_strace -a28 -eepoll_create1 $args > "$OUT"
10+
match_diff "$LOG" "$OUT"
11+
rm -f "$OUT"
1012

1113
exit 0

0 commit comments

Comments
 (0)