summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/Makefile.am
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-01-29 17:22:14 +0900
committerDaiki Ueno <ueno@gnu.org>2015-03-03 18:55:59 +0900
commitd9fc3d2a3f43d4295db24883223dbe71ff8dd5d4 (patch)
tree57cd8eec96b44d272f35147676f08fe4a24de860 /gettext-tools/tests/Makefile.am
parent9e117619d848515c4ddbae18d05c0a66cf86a451 (diff)
downloadexternal_gettext-d9fc3d2a3f43d4295db24883223dbe71ff8dd5d4.zip
external_gettext-d9fc3d2a3f43d4295db24883223dbe71ff8dd5d4.tar.gz
external_gettext-d9fc3d2a3f43d4295db24883223dbe71ff8dd5d4.tar.bz2
xgettext: Support message syntax checks
With this change, xgettext could report common syntactic problems in extracted strings. The current built-in checks are ellipsis-unicode, space-ellipsis, and quote-unicode. Those checks can be enabled with --check option of xgettext and disabled with special "xgettext:" comment in source files. Feature suggested by Philip Withnall in: https://savannah.gnu.org/bugs/?44098 * gettext-tools/src/message.h (enum syntax_check_type): New enum. (NSYNTAXCHECKS): New constant. (enum is_syntax_check): New enum. (struct message_ty): New field 'do_syntax_check'. (syntax_check_name): New variable declaration. * gettext-tools/src/message.c (syntax_check_name): New variable. * gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Propagate mp->do_syntax_check. * gettext-tools/src/msgmerge.c (message_merge): Propagate ref->do_syntax_check. * gettext-tools/src/msgl-check.h (syntax_check_message_list): New declaration. * gettext-tools/src/msgl-check.c (sentence_end): New function. (syntax_check_ellipsis_unicode): New function. (syntax_check_space_ellipsis): New function. (syntax_check_quote_unicode): New function. (syntax_check_message): New function. (syntax_check_message_list): New function. * gettext-tools/src/read-catalog-abstract.h (po_parse_comment_special): Adjust function declaration. * gettext-tools/src/read-catalog-abstract.c (po_parse_comment_special): Add new argument SCP for syntax checking; all callers changed. * gettext-tools/src/read-catalog.h (DEFAULT_CATALOG_READER_TY): New field 'do_syntax_check'. * gettext-tools/src/read-catalog.c (default_constructor): Initialize this->do_syntax_check. (default_copy_comment_state): Propagate this->do_syntax_check. * gettext-tools/src/xgettext.c (long_options): Add --check option. (main): Handle --check option. (usage): Document --check option. (remember_a_message): Propagate do_syntax_check value. * gettext-tools/tests/xgettext-14: New file. * gettext-tools/tests/sentence.c: New file. * gettext-tools/tests/Makefile.am (TESTS): Add new test. (noinst_PROGRAMS): Add 'sentence'. (sentence_SOURCES): New variable. (sentence_CPPFLAGS): New variable. (sentence_LDADD): New variable. * gettext-tools/doc/xgettext.texi: Document --check option.
Diffstat (limited to 'gettext-tools/tests/Makefile.am')
-rw-r--r--gettext-tools/tests/Makefile.am9
1 files changed, 6 insertions, 3 deletions
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index 32bc192..ea8bfa9 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -72,7 +72,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
recode-sr-latin-1 recode-sr-latin-2 \
xgettext-2 xgettext-3 xgettext-4 xgettext-5 xgettext-6 \
xgettext-7 xgettext-8 xgettext-9 xgettext-10 xgettext-11 xgettext-12 \
- xgettext-13 \
+ xgettext-13 xgettext-14 \
xgettext-awk-1 xgettext-awk-2 \
xgettext-c-2 xgettext-c-3 xgettext-c-4 xgettext-c-5 \
xgettext-c-6 xgettext-c-7 xgettext-c-8 xgettext-c-9 xgettext-c-10 \
@@ -137,7 +137,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
format-lua-1 format-lua-2 \
format-javascript-1 format-javascript-2 \
plural-1 plural-2 \
- gettextpo-1 \
+ gettextpo-1 sentence \
lang-c lang-c++ lang-objc lang-sh lang-bash lang-python-1 \
lang-python-2 lang-clisp lang-elisp lang-librep lang-guile \
lang-smalltalk lang-java lang-csharp lang-gawk lang-pascal \
@@ -211,7 +211,7 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @INTL_MACOSX_LIBS@
LDADD_yes = ../intl/libintl.la @LTLIBTHREAD@
LDADD_no = ../intl/libgnuintl.la @LTLIBTHREAD@ @LTLIBINTL@
-noinst_PROGRAMS = tstgettext tstngettext testlocale gettext-3-prg gettext-4-prg gettext-5-prg gettext-6-prg gettext-7-prg gettext-8-prg cake fc3 fc4 fc5 gettextpo-1-prg
+noinst_PROGRAMS = tstgettext tstngettext testlocale gettext-3-prg gettext-4-prg gettext-5-prg gettext-6-prg gettext-7-prg gettext-8-prg cake fc3 fc4 fc5 gettextpo-1-prg sentence
tstgettext_SOURCES = tstgettext.c setlocale.c
tstgettext_CFLAGS = -DINSTALLDIR=\".\"
tstgettext_LDADD = ../gnulib-lib/libgettextlib.la $(LDADD)
@@ -255,6 +255,9 @@ gettextpo_1_prg_CPPFLAGS = \
# Don't add more libraries here. This test must check whether libgettextpo is
# self contained.
gettextpo_1_prg_LDADD = ../libgettextpo/libgettextpo.la $(LDADD)
+sentence_SOURCES = sentence.c
+sentence_CPPFLAGS = -I../src -I../gnulib-lib
+sentence_LDADD = ../src/libgettextsrc.la $(LDADD)
# Clean up after Solaris cc.
clean-local: