From: Stefano Lattarini Date: Mon, 8 Aug 2011 16:23:40 +0000 (+0200) Subject: testsuite: more uses of the `seq_' function X-Git-Tag: v1.11b~257^2~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c463a964bec391ee9c2735801604e96941a1e33f;p=platform%2Fupstream%2Fautomake.git testsuite: more uses of the `seq_' function * tests/parallel-tests-exit-statuses.test: Use the `seq_' function from `tests/defs', instead of duplicating its semantics by hand. * tests/testsuite-summary-count.test: Likewise. --- diff --git a/ChangeLog b/ChangeLog index ca3af67..e0f922a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2011-08-08 Stefano Lattarini + testsuite: more uses of the `seq_' function + * tests/parallel-tests-exit-statuses.test: Use the `seq_' function + from `tests/defs', instead of duplicating its semantics. + * tests/testsuite-summary-count.test: Likewise. + +2011-08-08 Stefano Lattarini + testsuite: drop redundant environment sanitization * tests/Makefile.am (TESTS_ENVIRONMENT): Don't remove `planned' from the environment. diff --git a/tests/parallel-tests-exit-statuses.test b/tests/parallel-tests-exit-statuses.test index 531526a..840a14a 100755 --- a/tests/parallel-tests-exit-statuses.test +++ b/tests/parallel-tests-exit-statuses.test @@ -26,13 +26,7 @@ END # $failure_statuses should be defined to the list of all integers between # 1 and 255 (inclusive), excluded 77 and 99. -# Let's use `seq' if available, it's faster than the loop. -failure_statuses=`seq 1 255 \ - || { i=1; while test $i -le 255; do echo $i; i=\`expr $i + 1\`; done; }` -failure_statuses=` - for i in $failure_statuses; do - test $i -eq 77 || test $i -eq 99 || echo $i - done | tr "$nl" ' '` +failure_statuses=`seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' '` # For debugging. echo "failure_statuses: $failure_statuses" # Sanity check. diff --git a/tests/testsuite-summary-count.test b/tests/testsuite-summary-count.test index 3e24e3a..090fabb 100755 --- a/tests/testsuite-summary-count.test +++ b/tests/testsuite-summary-count.test @@ -23,21 +23,6 @@ use_vpath=no . "$testsrcdir"/testsuite-summary-checks.sh || Exit 99 -seq_ () -{ - case $# in - 2) l=$1 u=$2;; - *) fatal_ "incorrect usage of 'seq_' function";; - esac - seq $1 $2 || { - i=$l - while test $i -le $u; do - echo $i - i=`expr $i + 1` - done - } -} - ./configure header="\