From: Fei Jie Date: Tue, 26 Apr 2016 08:03:10 +0000 (+0800) Subject: tests: add sync.test X-Git-Tag: v4.12~280 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86ff93e527d4392583fd17d3c37cab8e1f431f97;p=strace tests: add sync.test * 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. --- diff --git a/tests/.gitignore b/tests/.gitignore index 6f056a29..4d1d8cb1 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -206,6 +206,7 @@ statfs64 swap symlink symlinkat +sync sync_file_range sync_file_range2 sysinfo diff --git a/tests/Makefile.am b/tests/Makefile.am index e3ffc1c5..9f1f8b49 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..132a6f2a --- /dev/null +++ b/tests/sync.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_sync + +# include +# include + +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 index 00000000..f6bf6c8f --- /dev/null +++ b/tests/sync.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check sync syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7