tests: add sched_rr_get_interval.test

* tests/sched_rr_get_interval.c: New file.
* tests/sched_rr_get_interval.test: New test.
* tests/.gitignore: Add sched_rr_get_interval.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sched_rr_get_interval.test.
This commit is contained in:
Fei Jie
2016-04-25 16:18:20 +08:00
committed by Dmitry V. Levin
parent b4a478dbfa
commit cd61c9f3e4
4 changed files with 35 additions and 0 deletions

1
tests/.gitignore vendored
View File

@ -152,6 +152,7 @@ rt_sigsuspend
rt_sigtimedwait
rt_tgsigqueueinfo
sched_get_priority_mxx
sched_rr_get_interval
sched_xetaffinity
sched_xetattr
sched_xetparam

View File

@ -203,6 +203,7 @@ check_PROGRAMS = \
rt_sigtimedwait \
rt_tgsigqueueinfo \
sched_get_priority_mxx \
sched_rr_get_interval \
sched_xetaffinity \
sched_xetattr \
sched_xetparam \
@ -450,6 +451,7 @@ DECODER_TESTS = \
rt_sigtimedwait.test \
rt_tgsigqueueinfo.test \
sched_get_priority_mxx.test \
sched_rr_get_interval.test \
sched_xetaffinity.test \
sched_xetattr.test \
sched_xetparam.test \

View File

@ -0,0 +1,26 @@
#include "tests.h"
#include <sys/syscall.h>
#ifdef __NR_sched_rr_get_interval
# include <stdio.h>
# include <sched.h>
# include <unistd.h>
int
main(void)
{
struct timespec *const tp = tail_alloc(sizeof(struct timespec));
long rc = syscall(__NR_sched_rr_get_interval, -1, tp);
printf("sched_rr_get_interval(-1, %p) = %ld %s (%m)\n",
tp, rc, errno2name());
puts("+++ exited with 0 +++");
return 0;
}
#else
SKIP_MAIN_UNDEFINED("__NR_sched_rr_get_interval")
#endif

View File

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