]> granicus.if.org Git - strace/commitdiff
tests: enhance sched.test negative check
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 3 Apr 2017 01:06:11 +0000 (01:06 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 3 Apr 2017 01:06:11 +0000 (01:06 +0000)
* tests/sched.test: Test that trace=%sched doesn't match
anything besides sched_* syscalls by checking it against all test
executables without side effects listed in pure_executables.list
except sched_* and times.

tests/sched.test

index c65653a624d18af86a080d2d3b45418b05971d73..11946d910f48cb4adb79943e5faabdee6740e620 100755 (executable)
 
 . "${srcdir=.}/init.sh"
 
-while read w i
-do
-       try_run_prog "../$i" || continue
-       run_strace -a$w -e%sched ../$i > "$EXP"
+while read w s; do {
+       try_run_prog "../$s" || continue
+       run_strace -a$w -e%sched ../$s > "$EXP"
        match_diff "$LOG" "$EXP"
-done << EOF
+} < /dev/null; done << EOF
 28 sched_xetaffinity
 23 sched_xetparam
 31 sched_rr_get_interval
@@ -44,17 +43,13 @@ done << EOF
 14 sched_yield
 EOF
 
-echo '+++ exited with 0 +++' > "$EXP"
+grep -E -v '^(#|sched_|times$)' \
+       < "$srcdir/pure_executables.list" > negative.list
 
-while read w i
-do
-       try_run_prog "../$i" || continue
-       run_strace -a$w -e%sched ../$i > /dev/null
-       match_diff "$LOG" "$EXP"
-done << EOF
-11 fchdir
-28 futex
-10 fsync
-EOF
+while read s; do {
+       try_run_prog "../$s" || continue
+       run_strace -qq -esignal=none -e%sched ../$s > /dev/null
+       match_diff "$LOG" /dev/null
+} < /dev/null; done < negative.list
 
 rm "$EXP"