18969 - multiple string test failures due to missing locale dependencies
Commit Message
After committing the patch I noticed a number of other similar
problems in other Makefiles. I tried to find a complete set by
grepping tests (files that match the tst*.c and test*.c shell
pattern) for calls to setlocale with a named locale, testing
a subset of those, and fixing the errors I got by making the
same tweaks to the Makefile as in the first patch. It's
possible I still missed some.
Attached is a follow-on patch with these tweaks.
Martin
PS In the process of this testing I ran into another, unrelated
problem. Some of the Makefiles add test output files to a variable
named tests-special. When make is invoked to build and run just
one or a few tests, the invocation fails with an error like the
one below. The error can be avoided by adding the .out files to
the variable only when the tests variable is defined in the
Makefile rather than on the command line. I haven't included
these fixes in this patch since it's an unrelated problem.
Instead, unless there are objections, I will post another patch
later to correct this problem.
make[2]: *** No rule to make target
`/build/glibc-trunk/power8/stdio-common/tst-printf-bz18872.out', needed
by `/build/glibc-trunk/power8/stdio-common/tst-printf-bz18872-mem.out'.
Stop.
Comments
I'm not sure what the protocol is -- do I need explicit approval
for this or can I commit the patch without one?
The follow-on patch is here:
http://sourceware.org/ml/libc-alpha/2015-09/msg00723.html
On 09/28/2015 05:01 PM, Martin Sebor wrote:
> After committing the patch I noticed a number of other similar
> problems in other Makefiles. I tried to find a complete set by
> grepping tests (files that match the tst*.c and test*.c shell
> pattern) for calls to setlocale with a named locale, testing
> a subset of those, and fixing the errors I got by making the
> same tweaks to the Makefile as in the first patch. It's
> possible I still missed some.
>
> Attached is a follow-on patch with these tweaks.
>
> Martin
>
> PS In the process of this testing I ran into another, unrelated
> problem. Some of the Makefiles add test output files to a variable
> named tests-special. When make is invoked to build and run just
> one or a few tests, the invocation fails with an error like the
> one below. The error can be avoided by adding the .out files to
> the variable only when the tests variable is defined in the
> Makefile rather than on the command line. I haven't included
> these fixes in this patch since it's an unrelated problem.
> Instead, unless there are objections, I will post another patch
> later to correct this problem.
>
> make[2]: *** No rule to make target
> `/build/glibc-trunk/power8/stdio-common/tst-printf-bz18872.out', needed
> by `/build/glibc-trunk/power8/stdio-common/tst-printf-bz18872-mem.out'.
> Stop.
>
2015-09-28 Martin Sebor <msebor@redhat.com>
[BZ #18969]
* stdlib/Makefile: Include gen-locales.mk.
(test-isomac.out, testmb2.out, tst-strtod.out, tst-strtod3.out)
(tst-strtod4.out, tst-strtod5.out): Add dependency on $(gen-locales).
* time/Makefile: Include gen-locales.mk.
(tst-ftime_l.out, tst-stptime.out): Add dependency on $(gen-locales).
* wcsmbs/Makefile: Include gen-locales.mk.
(tst-btowc.out, tst-c16c32-1.out, tst-mbrtowc.out,tst-mbrtowc2.out):
(tst-wcrtomb.out): Add dependency on $(gen-locales).
@@ -116,6 +116,18 @@ CFLAGS-tst-makecontext2.c = $(stack-align-test-flags)
tests-special += $(objpfx)isomac.out
ifeq ($(run-built-tests),yes)
+
+LOCALES := cs_CZ.UTF-8 de_DE.UTF-8 en_US.ISO-8859-1 \
+ tr_TR.ISO-8859-9 tr_TR.UTF-8
+include ../gen-locales.mk
+
+$(objpfx)test-isomac.out: $(gen-locales)
+$(objpfx)testmb2.out: $(gen-locales)
+$(objpfx)tst-strtod.out: $(gen-locales)
+$(objpfx)tst-strtod3.out: $(gen-locales)
+$(objpfx)tst-strtod4.out: $(gen-locales)
+$(objpfx)tst-strtod5.out: $(gen-locales)
+
tests-special += $(objpfx)tst-fmtmsg.out
endif
@@ -41,6 +41,15 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
include ../Rules
+ifeq ($(run-built-tests),yes)
+
+LOCALES := de_DE.ISO-8859-1
+include ../gen-locales.mk
+
+$(objpfx)tst-ftime_l.out: $(gen-locales)
+$(objpfx)tst-stptime.out: $(gen-locales)
+endif
+
tz-cflags = -DTZDIR='"$(zonedir)"' \
-DTZDEFAULT='"$(localtime-file)"' \
-DTZDEFRULES='"$(posixrules-file)"'
@@ -51,6 +51,18 @@ tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
include ../Rules
+ifeq ($(run-built-tests),yes)
+
+LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 hr_HR.ISO-8859-2 ja_JP.EUC-JP
+include ../gen-locales.mk
+
+$(objpfx)tst-btowc.out: $(gen-locales)
+$(objpfx)tst-c16c32-1.out: $(gen-locales)
+$(objpfx)tst-mbrtowc.out: $(gen-locales)
+$(objpfx)tst-mbrtowc2.out: $(gen-locales)
+$(objpfx)tst-wcrtomb.out: $(gen-locales)
+endif
+
CFLAGS-wcwidth.c = -I../wctype
CFLAGS-wcswidth.c = -I../wctype