From b24254d34c505df081f65961e35954c59677a0e4 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Mon, 13 Mar 2017 17:52:41 +0100 Subject: [PATCH] tests/sched.test: use heredoc in order to avoid spawning of subprocess Pipelined commands executed in subprocesses (some shells have special provision for last command in the pipeline, but it is not guaranteed and not POSIX), so exit codes of these subprocesses can be lost. In order to avoid creating subprocesses, input for read commands is better to supply via heredoc and not pipe. * tests/sched.test: Move test cases to heredoc. --- tests/sched.test | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/sched.test b/tests/sched.test index c334660a..5d891f6c 100755 --- a/tests/sched.test +++ b/tests/sched.test @@ -41,32 +41,32 @@ try_run_prog() } } -SCHED_TESTS='28 sched_xetaffinity +while read w i +do + try_run_prog "./$i" || continue + run_strace -a$w -e%sched ./$i > "$EXP" + match_diff "$LOG" "$EXP" +done << EOF +28 sched_xetaffinity 23 sched_xetparam 31 sched_rr_get_interval 33 sched_get_priority_mxx 29 sched_xetattr 22 sched_xetscheduler -14 sched_yield' - -NON_SCHED_TESTS='11 fchdir -28 futex -10 fsync' - -echo "$SCHED_TESTS" | while read w i -do - try_run_prog "./$i" || continue - run_strace -a$w -e%sched ./$i > "$EXP" - match_diff "$LOG" "$EXP" -done +14 sched_yield +EOF echo '+++ exited with 0 +++' > "$EXP" -echo "$NON_SCHED_TESTS" | while read w i +while read w i do try_run_prog "./$i" || continue run_strace -a$w -e%sched ./$i > /dev/null match_diff "$LOG" "$EXP" -done +done << EOF +11 fchdir +28 futex +10 fsync +EOF rm "$EXP" -- 2.40.0