tests: add getpgrp.test

* 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.
This commit is contained in:
Fei Jie 2016-04-21 15:53:52 +08:00 committed by Dmitry V. Levin
parent f914194fc3
commit ef6b4262bb
4 changed files with 31 additions and 0 deletions

1
tests/.gitignore vendored
View File

@ -69,6 +69,7 @@ getgid
getgid32
getgroups
getgroups32
getpgrp
getrandom
getresgid
getresgid32

View File

@ -122,6 +122,7 @@ check_PROGRAMS = \
getgid32 \
getgroups \
getgroups32 \
getpgrp \
getrandom \
getresgid \
getresgid32 \
@ -371,6 +372,7 @@ DECODER_TESTS = \
getgid32.test \
getgroups.test \
getgroups32.test \
getpgrp.test \
getrandom.test \
getresgid.test \
getresgid32.test \

22
tests/getpgrp.c Normal file
View File

@ -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

6
tests/getpgrp.test Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Check getpgrp syscall decoding.
. "${srcdir=.}/init.sh"
run_strace_match_diff -a10