summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2010-09-08 11:39:56 +0200
committerPaolo Bonzini <bonzini@gnu.org>2010-09-14 08:26:56 +0200
commit97744571e8104bebaf7026f584d2a983f997daec (patch)
tree6c96b511a19e1dfb363b8cd205fea5bf1b9be7e1
parent2c817e28252c67f50e6b798e4bfe18f9d41020ab (diff)
downloadgrep-97744571e8104bebaf7026f584d2a983f997daec.tar.gz
tests: add equiv-classes
* configure.ac (USE_INCLUDED_REGEX): Add Automake conditional. * tests/equiv-classes: New test. * tests/Makefile.am (TESTS): Add it. (XFAIL_TESTS) [USE_INCLUDED_REGEX]: Mark it as expected failure.
-rw-r--r--configure.ac1
-rw-r--r--tests/Makefile.am7
-rw-r--r--tests/equiv-classes12
3 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 01ae0f25..481ce868 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,7 @@ dnl Some installers want to be informed if we do not use our regex.
dnl For example, if the host platform uses dynamic linking and the installer
dnl knows that the grep may be invoked on other hosts with buggy libraries,
dnl then the installer should configure --with-included-regex.
+AM_CONDITIONAL([USE_INCLUDED_REGEX], [test "$ac_use_included_regex" = yes])
if test "$ac_use_included_regex" = no; then
AC_MSG_WARN([Included lib/regex.c not used])
fi
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 13e549d1..f66543f1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -27,6 +27,12 @@ XFAIL_TESTS = \
word-delim-multibyte \
grep-dir
+# Equivalence classes are only supported when using the system
+# matcher (which means only with glibc).
+if USE_INCLUDED_REGEX
+XFAIL_TESTS += equiv-classes
+endif
+
TESTS = \
backref \
backref-word \
@@ -41,6 +47,7 @@ TESTS = \
dfaexec-multibyte \
empty \
ere \
+ equiv-classes \
euc-mb \
fedora \
fgrep-infloop \
diff --git a/tests/equiv-classes b/tests/equiv-classes
new file mode 100644
index 00000000..de38d95c
--- /dev/null
+++ b/tests/equiv-classes
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Test that equivalence classes work.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+require_en_utf8_locale_
+
+LC_ALL=en_US.UTF-8
+export LC_ALL
+
+echo à | grep '[[=a=]]' > /dev/null
+Exit $?