This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch: Make sure all supported locales are compilable


This patch make sure 'make check' try to compile all the
locale/charset combinations listed as supported.  It should make it
easier to detect broken locales.


2003-05-29  Petter Reinholdtsen  <pere@hungry.com>

	* Makefile (tst-locales.out): New target to make sure all
	supported locales are compilable.
	(tests): Add new test target.
	

Index: localedata/Makefile
===================================================================
RCS file: /cvs/glibc/libc/localedata/Makefile,v
retrieving revision 1.95
diff -u -3 -p -u -r1.95 Makefile
--- localedata/Makefile	27 Apr 2003 09:02:37 -0000	1.95
+++ localedata/Makefile	29 May 2003 14:19:03 -0000
@@ -152,7 +155,8 @@ $(addsuffix .out,$(addprefix $(objpfx),$
 tests: $(objpfx)sort-test.out $(objpfx)tst-fmon.out $(objpfx)tst-locale.out \
        $(objpfx)tst-rpmatch.out $(objpfx)tst-trans.out \
        $(objpfx)tst-mbswcs.out $(objpfx)tst-ctype.out $(objpfx)tst-wctype.out \
-       $(objpfx)tst-langinfo.out $(objpfx)tst-numeric.out
+       $(objpfx)tst-langinfo.out $(objpfx)tst-numeric.out \
+       $(objpfx)tst-locales.out
 
 $(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
 		       $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
@@ -197,6 +201,26 @@ $(objpfx)tst-langinfo.out: tst-langinfo.
 	$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
 $(objpfx)tst-digits.out: $(objpfx)tst-locale.out
 $(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
+
+$(objpfx)tst-locales.out:
+	@echo "Trying to generate all supported locales."
+	@( tmpdir="$(objpfx)tst-locales/locale" ; mkdir -p "$$tmpdir" ; \
+	retval=0 ; \
+	for value in $(SUPPORTED-LOCALES) ; do \
+		charset=`echo $$value | sed -e 's,.*/,,'`; \
+		locale=`echo $$value | sed -e 's,/[^/]*,,'`; \
+		input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
+		echo "Generating $$value, this might take some time" 1>&2 ; \
+		if $(LOCALEDEF) -i locales/$$input -c -f charmaps/$$charset \
+		   $$tmpdir/$$locale ; then \
+			echo "success: $$value" ; \
+		else \
+			echo "error: $$value '$$cmd'" ; \
+			echo "  error: $$value '$$cmd'" 1>&2 ; \
+			retval=1 ; \
+		fi ; \
+	done ; \
+	rm -rf "$$tmpdir" ; exit $$retval ) > $@
 endif
 
 include SUPPORTED


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]