]> granicus.if.org Git - strace/commitdiff
tests: add sync.test
authorFei Jie <feij.fnst@cn.fujitsu.com>
Tue, 26 Apr 2016 08:03:10 +0000 (16:03 +0800)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 26 Apr 2016 10:29:58 +0000 (10:29 +0000)
* tests/sync.c: New file.
* tests/sync.test: New test.
* tests/.gitignore: Add sync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sync.test.

tests/.gitignore
tests/Makefile.am
tests/sync.c [new file with mode: 0644]
tests/sync.test [new file with mode: 0755]

index 6f056a294492e51352916da7591321417d162ca0..4d1d8cb12fcc4277d1bc576bae38240f13acc466 100644 (file)
@@ -206,6 +206,7 @@ statfs64
 swap
 symlink
 symlinkat
+sync
 sync_file_range
 sync_file_range2
 sysinfo
index e3ffc1c59de782a40096188599e42524aa1bfd6a..9f1f8b496f908c286ad2753c66372c7fb91216f3 100644 (file)
@@ -258,6 +258,7 @@ check_PROGRAMS = \
        swap \
        symlink \
        symlinkat \
+       sync \
        sync_file_range \
        sync_file_range2 \
        sysinfo \
@@ -513,6 +514,7 @@ DECODER_TESTS = \
        swap.test \
        symlink.test \
        symlinkat.test \
+       sync.test \
        sync_file_range.test \
        sync_file_range2.test \
        sysinfo.test \
diff --git a/tests/sync.c b/tests/sync.c
new file mode 100644 (file)
index 0000000..132a6f2
--- /dev/null
@@ -0,0 +1,22 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_sync
+
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+       printf("sync() = %ld\n", syscall(__NR_sync));
+
+       puts("+++ exited with 0 +++");
+       return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_sync")
+
+#endif
diff --git a/tests/sync.test b/tests/sync.test
new file mode 100755 (executable)
index 0000000..f6bf6c8
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check sync syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a7