automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI 4/4] {tap-testsuite-work} testsuite: more uses of the `seq_' functi


From: Stefano Lattarini
Subject: [FYI 4/4] {tap-testsuite-work} testsuite: more uses of the `seq_' function
Date: Mon, 8 Aug 2011 18:41:41 +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                               |    7 +++++++
 tests/parallel-tests-exit-statuses.test |    8 +-------
 tests/testsuite-summary-count.test      |   15 ---------------
 3 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca3af67..e0f922a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-08-08  Stefano Lattarini  <address@hidden>
 
+       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  <address@hidden>
+
        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="\
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]