[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/17] tests: add more UTF-8 test cases
From: |
Paolo Bonzini |
Subject: |
[PATCH 10/17] tests: add more UTF-8 test cases |
Date: |
Fri, 12 Mar 2010 18:49:11 +0100 |
* tests/Makefile.am (TESTS): Add spencer1-locale.sh.
(EXTRA_DIST): Add spencer1-locale.awk.
* tests/spencer1-locale.awk: New.
* tests/spencer1-locale.sh: New.
---
tests/Makefile.am | 4 +++-
tests/spencer1-locale.awk | 30 ++++++++++++++++++++++++++++++
tests/spencer1-locale.sh | 20 ++++++++++++++++++++
3 files changed, 53 insertions(+), 1 deletions(-)
create mode 100644 tests/spencer1-locale.awk
create mode 100755 tests/spencer1-locale.sh
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 06460bc..48d92a1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,6 +32,7 @@ TESTS = \
pcre.sh \
pcre-z \
spencer1.sh \
+ spencer1-locale.sh \
status.sh \
warning.sh \
word-multi-file \
@@ -48,7 +49,8 @@ EXTRA_DIST = \
khadafy.lines \
khadafy.regexp \
spencer1.awk \
- spencer1.tests
+ spencer1.tests \
+ spencer1-locale.awk
CLEANFILES = \
spencer1.script bre.script ere.script khadafy.out patfile \
diff --git a/tests/spencer1-locale.awk b/tests/spencer1-locale.awk
new file mode 100644
index 0000000..e5d3a7b
--- /dev/null
+++ b/tests/spencer1-locale.awk
@@ -0,0 +1,30 @@
+# Copyright (C) 1988 Henry Spencer.
+# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+
+BEGIN {
+ FS = "@";
+ printf ("failures=0\n");
+}
+
+$0 !~ /^#/ && NF == 3 {
+ test("en_US.UTF-8")
+ test("zh_CN")
+ if (extra_locale != "") {
+ test(extra_locale)
+ }
+}
+
+function test(locale)
+{
+ printf ("status=`echo '%s'| { LC_ALL=%s ${GREP} -E -e '%s' >/dev/null
2>&1 ; echo $?; }`\n",$3, locale, $2);
+ printf ("if test $status -ne %s ; then\n", $1);
+ printf ("\techo Spencer test \\#%d failed \\(%s\\)\n", ++n, locale);
+ printf ("\tfailures=1\n");
+ printf ("fi\n");
+}
+
+END { printf ("exit $failures\n"); }
diff --git a/tests/spencer1-locale.sh b/tests/spencer1-locale.sh
new file mode 100755
index 0000000..62df29d
--- /dev/null
+++ b/tests/spencer1-locale.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+# Regression test for GNU grep.
+#
+# Copyright (C) 1988 Henry Spencer.
+# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+
+: ${srcdir=.}
+
+failures=0
+
+# . . . and the following by Henry Spencer.
+
+${AWK-awk} -vextra_locale=$LOCALE_FR_UTF8 -f $srcdir/spencer1-locale.awk
$srcdir/spencer1.tests > spencer1-locale.script
+
+sh spencer1-locale.script && exit $failures
+exit 1
--
1.6.6
- [PATCH 05/17] dfa, grep: cleanup if-before-free and cast-of-argument-to-free, (continued)
- [PATCH 05/17] dfa, grep: cleanup if-before-free and cast-of-argument-to-free, Paolo Bonzini, 2010/03/12
- [PATCH 07/17] syntax-check: enable makefile-TAB-only-indentation, Paolo Bonzini, 2010/03/12
- [PATCH 06/17] grep: fix error-message-uppercase, Paolo Bonzini, 2010/03/12
- [PATCH 09/17] syntax-check: enable space-tab, Paolo Bonzini, 2010/03/12
- [PATCH 08/17] syntax-check: enable m4-quote-check, Paolo Bonzini, 2010/03/12
- [PATCH 10/17] tests: add more UTF-8 test cases,
Paolo Bonzini <=
- [PATCH 13/17] dfa: optimize simple character sets under UTF-8 charsets, Paolo Bonzini, 2010/03/12
- [PATCH 12/17] dfa: speed up handling of brackets, Paolo Bonzini, 2010/03/12
- [PATCH 11/17] dfa: rewrite handling of multibyte case folding, Paolo Bonzini, 2010/03/12
- [PATCH 14/17] dfa: cache MB_CUR_MAX for dfaexec, Paolo Bonzini, 2010/03/12
- [PATCH 15/17] dfa: run simple UTF-8 regexps as a single-byte character set, Paolo Bonzini, 2010/03/12
- [PATCH 16/17] grep: remove check_multibyte_string, fix non-UTF8 missed match, Paolo Bonzini, 2010/03/12