From: Eric Blake Date: Tue, 7 Jul 2009 12:58:18 +0000 (-0600) Subject: Make parallel testsuite more portable. X-Git-Tag: v2.64~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26f07a33512e001057c161e760b7d5a4a0f7f0bb;p=thirdparty%2Fautoconf.git Make parallel testsuite more portable. * lib/autotest/general.m4 (AT_INIT) : Avoid <>; instead open write descriptor in each group and read descriptor in main driver. * tests/autotest.at (AT_SKIP_PARALLEL_TESTS): Relax condition. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 68c44906..ff8e9ce5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-07 Eric Blake + + Make parallel testsuite more portable. + * lib/autotest/general.m4 (AT_INIT) : Avoid <>; + instead open write descriptor in each group and read descriptor in + main driver. + * tests/autotest.at (AT_SKIP_PARALLEL_TESTS): Relax condition. + 2009-07-03 Eric Blake Avoid syntax error in ash. diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 50c2ff70..a032462b 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -1296,9 +1296,7 @@ at_first=: if test $at_jobs -ne 1 && rm -f "$at_job_fifo" && test -n "$at_job_group" && - ( mkfifo "$at_job_fifo" && eval 'exec AT_JOB_FIFO_FD<> "$at_job_fifo"' \ - && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null && - eval 'exec AT_JOB_FIFO_FD<> "$at_job_fifo"' + ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null then # FIFO job dispatcher. @@ -1344,6 +1342,7 @@ dnl avoid all the status output by the shell. ( # Start one test group. $at_job_control_off + exec AT_JOB_FIFO_FD>"$at_job_fifo" dnl When a child receives PIPE, be sure to write back the token, dnl so the master does not hang waiting for it. dnl errexit and xtrace should not be set in this shell instance, @@ -1362,7 +1361,7 @@ dnl kill -13 $$ at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && - . "$at_test_source" # AT_JOB_FIFO_FD<&- + . "$at_test_source" # AT_JOB_FIFO_FD>&- then :; else AS_WARN([unable to parse test group: $at_group]) at_failed=: @@ -1371,13 +1370,16 @@ dnl kill -13 $$ echo token >&AT_JOB_FIFO_FD ) & $at_job_control_off + if $at_first; then + at_first=false + exec AT_JOB_FIFO_FD<"$at_job_fifo" + fi shift # Consume one token. if test $[@%:@] -gt 0; then :; else read at_token <&AT_JOB_FIFO_FD || break set x $[*] fi test -f "$at_stop_file" && break - at_first=false done # Read back the remaining ($at_jobs - 1) tokens. set X $at_joblist diff --git a/tests/autotest.at b/tests/autotest.at index e83b3297..b4ba887c 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -992,9 +992,8 @@ m4_define([AT_SKIP_PARALLEL_TESTS], # limited conditions; help is appreciated in widening this test base. AT_CHECK([${CONFIG_SHELL-$SHELL} -c 'test -n "${BASH_VERSION+set}]]dnl [[${ZSH_VERSION+set}${TEST_PARALLEL_AUTOTEST+set}"' || exit 77]) -# The parallel scheduler requires mkfifo and bidirectional redirection to work. +# The parallel scheduler requires mkfifo to work. AT_CHECK([mkfifo fifo || exit 77]) -AT_CHECK([${CONFIG_SHELL-$SHELL} -c 'eval "exec 5<>fifo"' || exit 77]) ])