glibc/localedata/tst-langinfo.sh

349 lines
13 KiB
Bash
Raw Normal View History

#!/bin/sh
# Test nl_langinfo.
# Copyright (C) 2000-2017 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
set -e
common_objpfx=$1
Don't require test wrappers to preserve environment variables, use more consistent environment. One wart in the original support for test wrappers for cross testing, as noted in <https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the requirement for test wrappers to pass a poorly-defined set of environment variables from the build system to the system running the glibc under test. Although some variables are passed explicitly via $(test-wrapper-env), including LD_* variables that simply can't be passed implicitly because of the side effects they'd have on the build system's dynamic linker, others are passed implicitly, including variables such as GCONV_PATH and LOCPATH that could potentially affect the build system's libc (so effectively relying on any such effects not breaking the wrappers). In addition, the code in cross-test-ssh.sh for preserving environment variables is fragile (it depends on how bash formats a list of exported variables, and could well break for multi-line variable definitions where the contents contain things looking like other variable definitions). This patch moves to explicitly passing environment variables via $(test-wrapper-env). Makefile variables that previously used $(test-wrapper) are split up into -before-env and -after-env parts that can be passed separately to the various .sh files used in testing, so those files can then insert environment settings between the two parts. The common default environment settings in make-test-out are made into a separate makefile variable that can also be passed to scripts, rather than many scripts duplicating those settings (for testing an installed glibc, it is desirable to have the GCONV_PATH setting on just one place, so just that one place needs to support it pointing to an installed sysroot instead of the build tree). The default settings are included in the variables such as $(test-program-prefix), so that if tests do not need any non-default settings they can continue to use single variables rather than the split-up variables. Although this patch cleans up LC_ALL=C settings (that being part of the common defaults), various LANG=C and LANGUAGE=C settings remain. Those are generally unnecessary and I propose a subsequent cleanup to remove them. LC_ALL takes precedence over LANG, and while LANGUAGE takes precedence over LC_ALL, it only does so for settings other than LC_ALL=C. So LC_ALL=C on its own is sufficient to ensure the C locale, and anything that gets LC_ALL=C does not need the other settings. While preparing this patch I noticed some tests with .sh files that appeared to do nothing beyond what the generic makefile support for tests can do (localedata/tst-wctype.sh - the makefiles support -ENV variables and .input files - and localedata/tst-mbswcs.sh - just runs five tests that could be run individually from the makefile). So I propose another subsequent cleanup to move those to using the generic support instead of special .sh files. Tested x86_64 (native) and powerpc32 (cross). * Makeconfig (run-program-env): New variable. (run-program-prefix-before-env): Likewise. (run-program-prefix-after-env): Likewise. (run-program-prefix): Define in terms of new variables. (built-program-cmd-before-env): New variable. (built-program-cmd-after-env): Likewise. (built-program-cmd): Define in terms of new variables. (test-program-prefix-before-env): New variable. (test-program-prefix-after-env): Likewise. (test-program-prefix): Define in terms of new variables. (test-program-cmd-before-env): New variable. (test-program-cmd-after-env): Likewise. (test-program-cmd): Define in terms of new variables. * Rules (make-test-out): Use $(run-program-env). * scripts/cross-test-ssh.sh (env_blacklist): Remove variable. (help): Do not mention environment variables. Mention --timeoutfactor option. (timeoutfactor): New variable. (blacklist_exports): Remove function. (exports): Remove variable. (command): Do not include ${exports}. * manual/install.texi (Configuring and compiling): Do not mention test wrappers preserving environment variables. Mention that last assignment to a variable must take precedence. * INSTALL: Regenerated. * benchtests/Makefile (run-bench): Use $(run-program-env). * catgets/Makefile ($(objpfx)test1.cat): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)test2.cat): Do not specify environment variables explicitly. ($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env), $(run-program-env) and $(test-program-cmd-after-env). ($(objpfx)sample.SJIS.cat): Do not specify environment variables explicitly. * catgets/test-gencat.sh: Use test_program_cmd_before_env, run_program_env and test_program_cmd_after_env arguments. * elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env). * elf/tst-pathopt.sh: Use run_program_env argument. * iconvdata/Makefile ($(objpfx)iconv-test.out): Use $(test-wrapper-env) and $(run-program-env). * iconvdata/run-iconv-test.sh: Use test_wrapper_env and run_program_env arguments. * iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly. * intl/Makefile ($(objpfx)tst-gettext.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). ($(objpfx)tst-gettext2.out): Likewise. * intl/tst-gettext.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * intl/tst-gettext2.sh: Likewise. * intl/tst-gettext4.sh: Do not set environment variables explicitly. * intl/tst-gettext6.sh: Likewise. * intl/tst-translit.sh: Likewise. * malloc/Makefile ($(objpfx)tst-mtrace.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * malloc/tst-mtrace.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * math/Makefile (run-regen-ulps): Use $(run-program-env). * nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env). * nptl/tst-tls6.sh: Use run_program_env argument. Set LANG=C explicitly with each use of ${test_wrapper_env}. * posix/Makefile ($(objpfx)wordexp-tst.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * posix/tst-getconf.sh: Do not set environment variables explicitly. * posix/wordexp-tst.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * stdio-common/tst-printf.sh: Do not set environment variables explicitly. * stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. Split $test calls into $test_pre and $test. * timezone/Makefile (build-testdata): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). localedata/ChangeLog: * Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)sort-test.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). ($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env), $(run-program-env) and $(run-program-prefix-after-env). ($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env), $(run-program-env), $(run-program-prefix-after-env), $(test-program-prefix-before-env) and $(test-program-prefix-after-env). ($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env), $(run-program-env) and $(test-program-cmd-after-env). ($(objpfx)tst-wctype.out): Likewise. ($(objpfx)tst-langinfo.out): Likewise. ($(objpfx)tst-langinfo-static.out): Likewise. * gen-locale.sh: Use localedef_before_env, run_program_env and localedef_after_env arguments. * sort-test.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * tst-ctype.sh: Use tst_ctype_before_env, run_program_env and tst_ctype_after_env arguments. * tst-fmon.sh: Use run_program_prefix_before_env, run_program_env and run_program_prefix_after_env arguments. * tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env and tst_langinfo_after_env arguments. * tst-locale.sh: Use localedef_before_env, run_program_env and localedef_after_env arguments. * tst-mbswcs.sh: Do not set environment variables explicitly. * tst-numeric.sh: Likewise. * tst-rpmatch.sh: Likewise. * tst-trans.sh: Use run_program_prefix_before_env, run_program_env, run_program_prefix_after_env, test_program_prefix_before_env and test_program_prefix_after_env arguments. * tst-wctype.sh: Use tst_wctype_before_env, run_program_env and tst_wctype_after_env arguments.
2014-06-06 22:19:27 +00:00
tst_langinfo_before_env=$2
run_program_env=$3
tst_langinfo_after_env=$4
# Run the test program.
cat <<"EOF" |
# Only decimal numerical escape sequences allowed in strings.
C ABDAY_1 Sun
C ABDAY_2 Mon
C ABDAY_3 Tue
C ABDAY_4 Wed
C ABDAY_5 Thu
C ABDAY_6 Fri
C ABDAY_7 Sat
C DAY_1 Sunday
C DAY_2 Monday
C DAY_3 Tuesday
C DAY_4 Wednesday
C DAY_5 Thursday
C DAY_6 Friday
C DAY_7 Saturday
C ABMON_1 Jan
C ABMON_2 Feb
C ABMON_3 Mar
C ABMON_4 Apr
C ABMON_5 May
C ABMON_6 Jun
C ABMON_7 Jul
C ABMON_8 Aug
C ABMON_9 Sep
C ABMON_10 Oct
C ABMON_11 Nov
C ABMON_12 Dec
C MON_1 January
C MON_2 February
C MON_3 March
C MON_4 April
C MON_5 May
C MON_6 June
C MON_7 July
C MON_8 August
C MON_9 September
C MON_10 October
C MON_11 November
C MON_12 December
C AM_STR AM
C PM_STR PM
C D_T_FMT "%a %b %e %H:%M:%S %Y"
C D_FMT "%m/%d/%y"
C T_FMT "%H:%M:%S"
C T_FMT_AMPM "%I:%M:%S %p"
C ABDAY_1 Sun
C ABDAY_2 Mon
C ABDAY_3 Tue
C ABDAY_4 Wed
C ABDAY_5 Thu
C ABDAY_6 Fri
C ABDAY_7 Sat
C DAY_1 Sunday
C DAY_2 Monday
C DAY_3 Tuesday
C DAY_4 Wednesday
C DAY_5 Thursday
C DAY_6 Friday
C DAY_7 Saturday
C RADIXCHAR .
C THOUSEP ""
C YESEXPR ^[yY]
C NOEXPR ^[nN]
en_US.ANSI_X3.4-1968 ABMON_1 Jan
en_US.ANSI_X3.4-1968 ABMON_2 Feb
en_US.ANSI_X3.4-1968 ABMON_3 Mar
en_US.ANSI_X3.4-1968 ABMON_4 Apr
en_US.ANSI_X3.4-1968 ABMON_5 May
en_US.ANSI_X3.4-1968 ABMON_6 Jun
en_US.ANSI_X3.4-1968 ABMON_7 Jul
en_US.ANSI_X3.4-1968 ABMON_8 Aug
en_US.ANSI_X3.4-1968 ABMON_9 Sep
en_US.ANSI_X3.4-1968 ABMON_10 Oct
en_US.ANSI_X3.4-1968 ABMON_11 Nov
en_US.ANSI_X3.4-1968 ABMON_12 Dec
en_US.ANSI_X3.4-1968 MON_1 January
en_US.ANSI_X3.4-1968 MON_2 February
en_US.ANSI_X3.4-1968 MON_3 March
en_US.ANSI_X3.4-1968 MON_4 April
en_US.ANSI_X3.4-1968 MON_5 May
en_US.ANSI_X3.4-1968 MON_6 June
en_US.ANSI_X3.4-1968 MON_7 July
en_US.ANSI_X3.4-1968 MON_8 August
en_US.ANSI_X3.4-1968 MON_9 September
en_US.ANSI_X3.4-1968 MON_10 October
en_US.ANSI_X3.4-1968 MON_11 November
en_US.ANSI_X3.4-1968 MON_12 December
en_US.ANSI_X3.4-1968 AM_STR AM
en_US.ANSI_X3.4-1968 PM_STR PM
en_US.ANSI_X3.4-1968 D_T_FMT "%a %d %b %Y %r %Z"
en_US.ANSI_X3.4-1968 D_FMT "%m/%d/%Y"
en_US.ANSI_X3.4-1968 T_FMT "%r"
en_US.ANSI_X3.4-1968 T_FMT_AMPM "%I:%M:%S %p"
en_US.ANSI_X3.4-1968 RADIXCHAR .
en_US.ANSI_X3.4-1968 THOUSEP ,
en_US.ANSI_X3.4-1968 YESEXPR ^[+1yY]
en_US.ANSI_X3.4-1968 NOEXPR ^[-0nN]
en_US.ISO-8859-1 ABMON_1 Jan
en_US.ISO-8859-1 ABMON_2 Feb
en_US.ISO-8859-1 ABMON_3 Mar
en_US.ISO-8859-1 ABMON_4 Apr
en_US.ISO-8859-1 ABMON_5 May
en_US.ISO-8859-1 ABMON_6 Jun
en_US.ISO-8859-1 ABMON_7 Jul
en_US.ISO-8859-1 ABMON_8 Aug
en_US.ISO-8859-1 ABMON_9 Sep
en_US.ISO-8859-1 ABMON_10 Oct
en_US.ISO-8859-1 ABMON_11 Nov
en_US.ISO-8859-1 ABMON_12 Dec
en_US.ISO-8859-1 MON_1 January
en_US.ISO-8859-1 MON_2 February
en_US.ISO-8859-1 MON_3 March
en_US.ISO-8859-1 MON_4 April
en_US.ISO-8859-1 MON_5 May
en_US.ISO-8859-1 MON_6 June
en_US.ISO-8859-1 MON_7 July
en_US.ISO-8859-1 MON_8 August
en_US.ISO-8859-1 MON_9 September
en_US.ISO-8859-1 MON_10 October
en_US.ISO-8859-1 MON_11 November
en_US.ISO-8859-1 MON_12 December
en_US.ISO-8859-1 AM_STR AM
en_US.ISO-8859-1 PM_STR PM
en_US.ISO-8859-1 D_T_FMT "%a %d %b %Y %r %Z"
en_US.ISO-8859-1 D_FMT "%m/%d/%Y"
en_US.ISO-8859-1 T_FMT "%r"
en_US.ISO-8859-1 T_FMT_AMPM "%I:%M:%S %p"
en_US.ISO-8859-1 RADIXCHAR .
en_US.ISO-8859-1 THOUSEP ,
en_US.ISO-8859-1 YESEXPR ^[+1yY]
en_US.ISO-8859-1 NOEXPR ^[-0nN]
de_DE.ISO-8859-1 ABDAY_1 So
de_DE.ISO-8859-1 ABDAY_2 Mo
de_DE.ISO-8859-1 ABDAY_3 Di
de_DE.ISO-8859-1 ABDAY_4 Mi
de_DE.ISO-8859-1 ABDAY_5 Do
de_DE.ISO-8859-1 ABDAY_6 Fr
de_DE.ISO-8859-1 ABDAY_7 Sa
de_DE.ISO-8859-1 DAY_1 Sonntag
de_DE.ISO-8859-1 DAY_2 Montag
de_DE.ISO-8859-1 DAY_3 Dienstag
de_DE.ISO-8859-1 DAY_4 Mittwoch
de_DE.ISO-8859-1 DAY_5 Donnerstag
de_DE.ISO-8859-1 DAY_6 Freitag
de_DE.ISO-8859-1 DAY_7 Samstag
de_DE.ISO-8859-1 ABMON_1 Jan
de_DE.ISO-8859-1 ABMON_2 Feb
de_DE.ISO-8859-1 ABMON_3 M<>r
de_DE.ISO-8859-1 ABMON_4 Apr
de_DE.ISO-8859-1 ABMON_5 Mai
de_DE.ISO-8859-1 ABMON_6 Jun
de_DE.ISO-8859-1 ABMON_7 Jul
de_DE.ISO-8859-1 ABMON_8 Aug
de_DE.ISO-8859-1 ABMON_9 Sep
de_DE.ISO-8859-1 ABMON_10 Okt
de_DE.ISO-8859-1 ABMON_11 Nov
de_DE.ISO-8859-1 ABMON_12 Dez
de_DE.ISO-8859-1 MON_1 Januar
de_DE.ISO-8859-1 MON_2 Februar
de_DE.ISO-8859-1 MON_3 M<>rz
de_DE.ISO-8859-1 MON_4 April
de_DE.ISO-8859-1 MON_5 Mai
de_DE.ISO-8859-1 MON_6 Juni
de_DE.ISO-8859-1 MON_7 Juli
de_DE.ISO-8859-1 MON_8 August
de_DE.ISO-8859-1 MON_9 September
de_DE.ISO-8859-1 MON_10 Oktober
de_DE.ISO-8859-1 MON_11 November
de_DE.ISO-8859-1 MON_12 Dezember
de_DE.ISO-8859-1 D_T_FMT "%a %d %b %Y %T %Z"
de_DE.ISO-8859-1 D_FMT "%d.%m.%Y"
de_DE.ISO-8859-1 T_FMT "%T"
de_DE.ISO-8859-1 RADIXCHAR ,
de_DE.ISO-8859-1 THOUSEP .
de_DE.ISO-8859-1 YESEXPR ^[+1jJyY]
de_DE.ISO-8859-1 NOEXPR ^[-0nN]
de_DE.UTF-8 ABDAY_1 So
de_DE.UTF-8 ABDAY_2 Mo
de_DE.UTF-8 ABDAY_3 Di
de_DE.UTF-8 ABDAY_4 Mi
de_DE.UTF-8 ABDAY_5 Do
de_DE.UTF-8 ABDAY_6 Fr
de_DE.UTF-8 ABDAY_7 Sa
de_DE.UTF-8 DAY_1 Sonntag
de_DE.UTF-8 DAY_2 Montag
de_DE.UTF-8 DAY_3 Dienstag
de_DE.UTF-8 DAY_4 Mittwoch
de_DE.UTF-8 DAY_5 Donnerstag
de_DE.UTF-8 DAY_6 Freitag
de_DE.UTF-8 DAY_7 Samstag
de_DE.UTF-8 ABMON_1 Jan
de_DE.UTF-8 ABMON_2 Feb
de_DE.UTF-8 ABMON_3 Mär
de_DE.UTF-8 ABMON_4 Apr
de_DE.UTF-8 ABMON_5 Mai
de_DE.UTF-8 ABMON_6 Jun
de_DE.UTF-8 ABMON_7 Jul
de_DE.UTF-8 ABMON_8 Aug
de_DE.UTF-8 ABMON_9 Sep
de_DE.UTF-8 ABMON_10 Okt
de_DE.UTF-8 ABMON_11 Nov
de_DE.UTF-8 ABMON_12 Dez
de_DE.UTF-8 MON_1 Januar
de_DE.UTF-8 MON_2 Februar
de_DE.UTF-8 MON_3 März
de_DE.UTF-8 MON_4 April
de_DE.UTF-8 MON_5 Mai
de_DE.UTF-8 MON_6 Juni
de_DE.UTF-8 MON_7 Juli
de_DE.UTF-8 MON_8 August
de_DE.UTF-8 MON_9 September
de_DE.UTF-8 MON_10 Oktober
de_DE.UTF-8 MON_11 November
de_DE.UTF-8 MON_12 Dezember
de_DE.UTF-8 D_T_FMT "%a %d %b %Y %T %Z"
de_DE.UTF-8 D_FMT "%d.%m.%Y"
de_DE.UTF-8 T_FMT "%T"
de_DE.UTF-8 RADIXCHAR ,
de_DE.UTF-8 THOUSEP .
de_DE.UTF-8 YESEXPR ^[+1jJyY]
de_DE.UTF-8 NOEXPR ^[-0nN]
fr_FR.ISO-8859-1 ABDAY_1 dim.
fr_FR.ISO-8859-1 ABDAY_2 lun.
fr_FR.ISO-8859-1 ABDAY_3 mar.
fr_FR.ISO-8859-1 ABDAY_4 mer.
fr_FR.ISO-8859-1 ABDAY_5 jeu.
fr_FR.ISO-8859-1 ABDAY_6 ven.
fr_FR.ISO-8859-1 ABDAY_7 sam.
fr_FR.ISO-8859-1 DAY_1 dimanche
fr_FR.ISO-8859-1 DAY_2 lundi
fr_FR.ISO-8859-1 DAY_3 mardi
fr_FR.ISO-8859-1 DAY_4 mercredi
fr_FR.ISO-8859-1 DAY_5 jeudi
fr_FR.ISO-8859-1 DAY_6 vendredi
fr_FR.ISO-8859-1 DAY_7 samedi
fr_FR.ISO-8859-1 ABMON_1 janv.
fr_FR.ISO-8859-1 ABMON_2 f<>vr.
fr_FR.ISO-8859-1 ABMON_3 mars
fr_FR.ISO-8859-1 ABMON_4 avril
fr_FR.ISO-8859-1 ABMON_5 mai
fr_FR.ISO-8859-1 ABMON_6 juin
fr_FR.ISO-8859-1 ABMON_7 juil.
fr_FR.ISO-8859-1 ABMON_8 ao<61>t
fr_FR.ISO-8859-1 ABMON_9 sept.
fr_FR.ISO-8859-1 ABMON_10 oct.
fr_FR.ISO-8859-1 ABMON_11 nov.
fr_FR.ISO-8859-1 ABMON_12 d<>c.
fr_FR.ISO-8859-1 MON_1 janvier
fr_FR.ISO-8859-1 MON_2 f<>vrier
fr_FR.ISO-8859-1 MON_3 mars
fr_FR.ISO-8859-1 MON_4 avril
fr_FR.ISO-8859-1 MON_5 mai
fr_FR.ISO-8859-1 MON_6 juin
fr_FR.ISO-8859-1 MON_7 juillet
fr_FR.ISO-8859-1 MON_8 ao<61>t
fr_FR.ISO-8859-1 MON_9 septembre
fr_FR.ISO-8859-1 MON_10 octobre
fr_FR.ISO-8859-1 MON_11 novembre
fr_FR.ISO-8859-1 MON_12 d<>cembre
fr_FR.ISO-8859-1 D_T_FMT "%a %d %b %Y %T %Z"
fr_FR.ISO-8859-1 D_FMT "%d/%m/%Y"
fr_FR.ISO-8859-1 T_FMT "%T"
fr_FR.ISO-8859-1 RADIXCHAR ,
fr_FR.ISO-8859-1 THOUSEP "<22>"
fr_FR.ISO-8859-1 YESEXPR ^[+1oOyY]
fr_FR.ISO-8859-1 NOEXPR ^[-0nN]
ja_JP.EUC-JP ABDAY_1 <20><>
ja_JP.EUC-JP ABDAY_2 <20><>
ja_JP.EUC-JP ABDAY_3 <20><>
ja_JP.EUC-JP ABDAY_4 <20><>
ja_JP.EUC-JP ABDAY_5 <20><>
ja_JP.EUC-JP ABDAY_6 <20><>
ja_JP.EUC-JP ABDAY_7 <20><>
ja_JP.EUC-JP DAY_1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP DAY_2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP DAY_3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP DAY_4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP DAY_5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP DAY_6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP DAY_7 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja_JP.EUC-JP ABMON_1 " 1<><31>"
ja_JP.EUC-JP ABMON_2 " 2<><32>"
ja_JP.EUC-JP ABMON_3 " 3<><33>"
ja_JP.EUC-JP ABMON_4 " 4<><34>"
ja_JP.EUC-JP ABMON_5 " 5<><35>"
ja_JP.EUC-JP ABMON_6 " 6<><36>"
ja_JP.EUC-JP ABMON_7 " 7<><37>"
ja_JP.EUC-JP ABMON_8 " 8<><38>"
ja_JP.EUC-JP ABMON_9 " 9<><39>"
ja_JP.EUC-JP ABMON_10 "10<31><30>"
ja_JP.EUC-JP ABMON_11 "11<31><31>"
ja_JP.EUC-JP ABMON_12 "12<31><32>"
ja_JP.EUC-JP MON_1 "1<><31>"
ja_JP.EUC-JP MON_2 "2<><32>"
ja_JP.EUC-JP MON_3 "3<><33>"
ja_JP.EUC-JP MON_4 "4<><34>"
ja_JP.EUC-JP MON_5 "5<><35>"
ja_JP.EUC-JP MON_6 "6<><36>"
ja_JP.EUC-JP MON_7 "7<><37>"
ja_JP.EUC-JP MON_8 "8<><38>"
ja_JP.EUC-JP MON_9 "9<><39>"
ja_JP.EUC-JP MON_10 "10<31><30>"
ja_JP.EUC-JP MON_11 "11<31><31>"
ja_JP.EUC-JP MON_12 "12<31><32>"
ja_JP.EUC-JP T_FMT_AMPM "%p%I<><49>%Mʬ%S<><53>"
ja_JP.EUC-JP ERA_D_FMT "%EY%m<><6D>%d<><64>"
ja_JP.EUC-JP ERA_D_T_FMT "%EY%m<><6D>%d<><64> %H<><48>%Mʬ%S<><53>"
ja_JP.EUC-JP RADIXCHAR .
ja_JP.EUC-JP THOUSEP ,
ja_JP.EUC-JP YESEXPR ^([+1yY<79><59><EFBFBD><EFBFBD>]|<EFBFBD>Ϥ<EFBFBD>|<EFBFBD>ϥ<EFBFBD>)
ja_JP.EUC-JP NOEXPR ^([-0nN<6E><4E><EFBFBD><EFBFBD>]|<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
# Is CRNCYSTR supposed to be the national or international sign?
# ja_JP.EUC-JP CRNCYSTR JPY
ja_JP.EUC-JP CODESET EUC-JP
EOF
Don't require test wrappers to preserve environment variables, use more consistent environment. One wart in the original support for test wrappers for cross testing, as noted in <https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the requirement for test wrappers to pass a poorly-defined set of environment variables from the build system to the system running the glibc under test. Although some variables are passed explicitly via $(test-wrapper-env), including LD_* variables that simply can't be passed implicitly because of the side effects they'd have on the build system's dynamic linker, others are passed implicitly, including variables such as GCONV_PATH and LOCPATH that could potentially affect the build system's libc (so effectively relying on any such effects not breaking the wrappers). In addition, the code in cross-test-ssh.sh for preserving environment variables is fragile (it depends on how bash formats a list of exported variables, and could well break for multi-line variable definitions where the contents contain things looking like other variable definitions). This patch moves to explicitly passing environment variables via $(test-wrapper-env). Makefile variables that previously used $(test-wrapper) are split up into -before-env and -after-env parts that can be passed separately to the various .sh files used in testing, so those files can then insert environment settings between the two parts. The common default environment settings in make-test-out are made into a separate makefile variable that can also be passed to scripts, rather than many scripts duplicating those settings (for testing an installed glibc, it is desirable to have the GCONV_PATH setting on just one place, so just that one place needs to support it pointing to an installed sysroot instead of the build tree). The default settings are included in the variables such as $(test-program-prefix), so that if tests do not need any non-default settings they can continue to use single variables rather than the split-up variables. Although this patch cleans up LC_ALL=C settings (that being part of the common defaults), various LANG=C and LANGUAGE=C settings remain. Those are generally unnecessary and I propose a subsequent cleanup to remove them. LC_ALL takes precedence over LANG, and while LANGUAGE takes precedence over LC_ALL, it only does so for settings other than LC_ALL=C. So LC_ALL=C on its own is sufficient to ensure the C locale, and anything that gets LC_ALL=C does not need the other settings. While preparing this patch I noticed some tests with .sh files that appeared to do nothing beyond what the generic makefile support for tests can do (localedata/tst-wctype.sh - the makefiles support -ENV variables and .input files - and localedata/tst-mbswcs.sh - just runs five tests that could be run individually from the makefile). So I propose another subsequent cleanup to move those to using the generic support instead of special .sh files. Tested x86_64 (native) and powerpc32 (cross). * Makeconfig (run-program-env): New variable. (run-program-prefix-before-env): Likewise. (run-program-prefix-after-env): Likewise. (run-program-prefix): Define in terms of new variables. (built-program-cmd-before-env): New variable. (built-program-cmd-after-env): Likewise. (built-program-cmd): Define in terms of new variables. (test-program-prefix-before-env): New variable. (test-program-prefix-after-env): Likewise. (test-program-prefix): Define in terms of new variables. (test-program-cmd-before-env): New variable. (test-program-cmd-after-env): Likewise. (test-program-cmd): Define in terms of new variables. * Rules (make-test-out): Use $(run-program-env). * scripts/cross-test-ssh.sh (env_blacklist): Remove variable. (help): Do not mention environment variables. Mention --timeoutfactor option. (timeoutfactor): New variable. (blacklist_exports): Remove function. (exports): Remove variable. (command): Do not include ${exports}. * manual/install.texi (Configuring and compiling): Do not mention test wrappers preserving environment variables. Mention that last assignment to a variable must take precedence. * INSTALL: Regenerated. * benchtests/Makefile (run-bench): Use $(run-program-env). * catgets/Makefile ($(objpfx)test1.cat): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)test2.cat): Do not specify environment variables explicitly. ($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env), $(run-program-env) and $(test-program-cmd-after-env). ($(objpfx)sample.SJIS.cat): Do not specify environment variables explicitly. * catgets/test-gencat.sh: Use test_program_cmd_before_env, run_program_env and test_program_cmd_after_env arguments. * elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env). * elf/tst-pathopt.sh: Use run_program_env argument. * iconvdata/Makefile ($(objpfx)iconv-test.out): Use $(test-wrapper-env) and $(run-program-env). * iconvdata/run-iconv-test.sh: Use test_wrapper_env and run_program_env arguments. * iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly. * intl/Makefile ($(objpfx)tst-gettext.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). ($(objpfx)tst-gettext2.out): Likewise. * intl/tst-gettext.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * intl/tst-gettext2.sh: Likewise. * intl/tst-gettext4.sh: Do not set environment variables explicitly. * intl/tst-gettext6.sh: Likewise. * intl/tst-translit.sh: Likewise. * malloc/Makefile ($(objpfx)tst-mtrace.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * malloc/tst-mtrace.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * math/Makefile (run-regen-ulps): Use $(run-program-env). * nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env). * nptl/tst-tls6.sh: Use run_program_env argument. Set LANG=C explicitly with each use of ${test_wrapper_env}. * posix/Makefile ($(objpfx)wordexp-tst.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * posix/tst-getconf.sh: Do not set environment variables explicitly. * posix/wordexp-tst.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * stdio-common/tst-printf.sh: Do not set environment variables explicitly. * stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. Split $test calls into $test_pre and $test. * timezone/Makefile (build-testdata): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). localedata/ChangeLog: * Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)sort-test.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). ($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env), $(run-program-env) and $(run-program-prefix-after-env). ($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env), $(run-program-env), $(run-program-prefix-after-env), $(test-program-prefix-before-env) and $(test-program-prefix-after-env). ($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env), $(run-program-env) and $(test-program-cmd-after-env). ($(objpfx)tst-wctype.out): Likewise. ($(objpfx)tst-langinfo.out): Likewise. ($(objpfx)tst-langinfo-static.out): Likewise. * gen-locale.sh: Use localedef_before_env, run_program_env and localedef_after_env arguments. * sort-test.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * tst-ctype.sh: Use tst_ctype_before_env, run_program_env and tst_ctype_after_env arguments. * tst-fmon.sh: Use run_program_prefix_before_env, run_program_env and run_program_prefix_after_env arguments. * tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env and tst_langinfo_after_env arguments. * tst-locale.sh: Use localedef_before_env, run_program_env and localedef_after_env arguments. * tst-mbswcs.sh: Do not set environment variables explicitly. * tst-numeric.sh: Likewise. * tst-rpmatch.sh: Likewise. * tst-trans.sh: Use run_program_prefix_before_env, run_program_env, run_program_prefix_after_env, test_program_prefix_before_env and test_program_prefix_after_env arguments. * tst-wctype.sh: Use tst_wctype_before_env, run_program_env and tst_wctype_after_env arguments.
2014-06-06 22:19:27 +00:00
${tst_langinfo_before_env} \
${run_program_env} \
LC_ALL=tt_TT ${tst_langinfo_after_env}
exit $?