]> granicus.if.org Git - strace/commitdiff
tests: check -C option
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 28 Nov 2016 16:57:30 +0000 (16:57 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 28 Nov 2016 16:57:30 +0000 (16:57 +0000)
* tests/strace-C.expected: New file.
* tests/strace-C.test: New test.
* tests/Makefile.am (MISC_TESTS): Add strace-C.test.
(EXTRA_DIST): Add strace-C.expected.

tests/Makefile.am
tests/strace-C.expected [new file with mode: 0644]
tests/strace-C.test [new file with mode: 0755]

index e5be92971595cce1bbc16840d461a8d7cbd92a76..366ae7fa0b9dd5578c15289a043571d16711b4e2 100644 (file)
@@ -809,6 +809,7 @@ MISC_TESTS = \
        redirect-fds.test \
        restart_syscall.test \
        signal_receive.test \
+       strace-C.test \
        strace-E.test \
        strace-S.test \
        strace-T.test \
@@ -865,6 +866,7 @@ EXTRA_DIST = init.sh run.sh match.awk \
             sockname.c \
             statfs.expected \
             statx.sh \
+            strace-C.expected \
             strace-E.expected \
             strace-T.expected \
             strace-ff.expected \
diff --git a/tests/strace-C.expected b/tests/strace-C.expected
new file mode 100644 (file)
index 0000000..832af1f
--- /dev/null
@@ -0,0 +1,3 @@
+nanosleep\(\{tv_sec=1, tv_nsec=0\}, NULL\) = 0
+\+\+\+ exited with 0 \+\+\+
+[ ]*[0-9][0-9]*[.][0-9][0-9]*  *0[.]0[0-9]*  *[0-9][0-9]*  *1  *nanosleep
diff --git a/tests/strace-C.test b/tests/strace-C.test
new file mode 100755 (executable)
index 0000000..ccca9a0
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Check -C option.
+
+. "${srcdir=.}/init.sh"
+
+run_prog ./sleep 0
+run_strace -a24 -C -enanosleep ./sleep 1
+match_grep