bug-grep
[Top][All Lists]
Advanced

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

[PATCH 29/34] maint: stop using skip_test_; use skip_ instead


From: Jim Meyering
Subject: [PATCH 29/34] maint: stop using skip_test_; use skip_ instead
Date: Thu, 15 Sep 2011 12:28:12 +0200

From: Jim Meyering <address@hidden>

* tests/init.cfg (skip_test_): Remove definition.  Use the improved
skip_ function from init.sh, now that it has the same feature.
* tests/euc-mb: s/skip_test_/skip_/
* tests/sjis-mb: Likewise.
* tests/fmbtest: Likewise.
---
 tests/euc-mb   |    2 +-
 tests/fmbtest  |    2 +-
 tests/init.cfg |   20 +++++---------------
 tests/sjis-mb  |    2 +-
 4 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/tests/euc-mb b/tests/euc-mb
index 32fa7be..40a40c2 100755
--- a/tests/euc-mb
+++ b/tests/euc-mb
@@ -22,7 +22,7 @@ euc_grep () {

 case $(get-mb-cur-max $locale) in
   2|3) ;;
-  *) skip_test_ 'EUC-JP locale not found' ;;
+  *) skip_ 'EUC-JP locale not found' ;;
 esac

 fail=0
diff --git a/tests/fmbtest b/tests/fmbtest
index 4e4ee89..38ab73b 100755
--- a/tests/fmbtest
+++ b/tests/fmbtest
@@ -11,7 +11,7 @@ cz=cs_CZ.UTF-8

 # If cs_CZ.UTF-8 locale doesn't work, skip this test.
 LC_ALL=$cz locale -k LC_CTYPE 2>/dev/null | grep -q charmap.*UTF-8 \
-  || skip_test_ this system lacks the $cz locale
+  || skip_ this system lacks the $cz locale

 # If matching is done in single-byte mode, skip this test too
 printf 'é\n' | LC_ALL=$cz grep -Eq '^[é]{2}$'
diff --git a/tests/init.cfg b/tests/init.cfg
index 42889e6..dd2ce45 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -1,19 +1,9 @@
 # This file is sourced by init.sh, *before* its initialization.

-# This goes hand in hand with the "exec 9>&2;" in tests/Makefile.am's
+# This goes hand in hand with the "9>&2;" in tests/Makefile.am's
 # TESTS_ENVIRONMENT definition.
 stderr_fileno_=9

-# Use this function rather than init.sh's skip_.
-# The "skip_" function emits its diagnostic only to one stream.
-# This one emits it both to the tty and to the log file.
-skip_test_()
-{
-  echo "$0: skipping test: $@" | head -1 1>&9
-  echo "$0: skipping test: $@" 1>&2
-  Exit 77
-}
-
 # Map settings of "none" to the empty string.
 test _"$LOCALE_FR" = _none && LOCALE_FR=
 test _"$LOCALE_FR_UTF8" = _none && LOCALE_FR_UTF8=
@@ -50,12 +40,12 @@ test "$envvar_check_fail" = 1 && fail_ "failed to unset the 
above envvars"
 require_timeout_()
 {
   ( timeout 10s true ) > /dev/null 2>&1 \
-    || skip_test_ your system lacks the timeout program
+    || skip_ your system lacks the timeout program
 }

 require_pcre_()
 {
-  echo . | grep -P . 2>err || skip_test_ no PCRE support
+  echo . | grep -P . 2>err || skip_ no PCRE support
   compare err /dev/null || fail_ PCRE available, but stderr not empty.
 }

@@ -66,7 +56,7 @@ require_en_utf8_locale_()
   path_prepend_ .
   case $(get-mb-cur-max en_US.UTF-8) in
     [3456]) ;;
-    *) skip_test_ 'en_US.UTF-8 locale not found' ;;
+    *) skip_ 'en_US.UTF-8 locale not found' ;;
   esac
 }

@@ -75,7 +65,7 @@ require_ru_RU_koi8_r()
   path_prepend_ .
   case $(get-mb-cur-max ru_RU.KOI8-R) in
     1) ;;
-    *) skip_test_ 'ru_RU.KOI8-R locale not found' ;;
+    *) skip_ 'ru_RU.KOI8-R locale not found' ;;
   esac
 }

diff --git a/tests/sjis-mb b/tests/sjis-mb
index 07c9a9a..abb83cb 100755
--- a/tests/sjis-mb
+++ b/tests/sjis-mb
@@ -39,7 +39,7 @@ test_grep() {
   test $? = 0 && compare out$k exp$k
 }

-test "$(get-mb-cur-max $locale)" = 2 || skip_test_ 'SJIS locale not found'
+test "$(get-mb-cur-max $locale)" = 2 || skip_ 'SJIS locale not found'

 address@hidden
 successful_tests='%%AA @AA @A@@A'
-- 
1.7.7.rc0.362.g5a14




reply via email to

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