[PATCH 4/4] tests: add getpgrp.test

Fei Jie feij.fnst at cn.fujitsu.com
Thu Apr 21 07:53:52 UTC 2016


* tests/getpgrp.c: New file.
* tests/getpgrp.test: New test.
* tests/.gitignore: Add getpgrp.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getpgrp.test.
---
 tests/.gitignore   |  1 +
 tests/Makefile.am  |  2 ++
 tests/getpgrp.c    | 22 ++++++++++++++++++++++
 tests/getpgrp.test |  6 ++++++
 4 files changed, 31 insertions(+)
 create mode 100644 tests/getpgrp.c
 create mode 100755 tests/getpgrp.test

diff --git a/tests/.gitignore b/tests/.gitignore
index 5bb24a5..e0f1524 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -69,6 +69,7 @@ getgid
 getgid32
 getgroups
 getgroups32
+getpgrp
 getrandom
 getresgid
 getresgid32
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ceea3ae..858f0c1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -121,6 +121,7 @@ check_PROGRAMS = \
 	getgid32 \
 	getgroups \
 	getgroups32 \
+	getpgrp \
 	getrandom \
 	getresgid \
 	getresgid32 \
@@ -369,6 +370,7 @@ DECODER_TESTS = \
 	getgid32.test \
 	getgroups.test \
 	getgroups32.test \
+	getpgrp.test \
 	getrandom.test \
 	getresgid.test \
 	getresgid32.test \
diff --git a/tests/getpgrp.c b/tests/getpgrp.c
new file mode 100644
index 0000000..fd3139b
--- /dev/null
+++ b/tests/getpgrp.c
@@ -0,0 +1,22 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_getpgrp
+
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+	printf("getpgrp() = %ld\n", syscall(__NR_getpgrp));
+
+	puts("+++ exited with 0 +++");
+	return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_getpgrp")
+
+#endif
diff --git a/tests/getpgrp.test b/tests/getpgrp.test
new file mode 100755
index 0000000..260c9a0
--- /dev/null
+++ b/tests/getpgrp.test
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check getpgrp syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a10
-- 
1.8.3.1







More information about the Strace-devel mailing list