testsuite: more uses of the `seq_' function
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 8 Aug 2011 16:23:40 +0000 (18:23 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 8 Aug 2011 16:48:18 +0000 (18:48 +0200)
* 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.

ChangeLog
tests/parallel-tests-exit-statuses.test
tests/testsuite-summary-count.test

index ca3af67..e0f922a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-08-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       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  <stefano.lattarini@gmail.com>
+
        testsuite: drop redundant environment sanitization
        * tests/Makefile.am (TESTS_ENVIRONMENT): Don't remove `planned'
        from the environment.
index 531526a..840a14a 100755 (executable)
@@ -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.
index 3e24e3a..090fabb 100755 (executable)
@@ -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="\