]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't require test wrappers to preserve environment variables, use more consistent...
authorJoseph Myers <joseph@codesourcery.com>
Fri, 6 Jun 2014 22:19:27 +0000 (22:19 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 6 Jun 2014 22:19:27 +0000 (22:19 +0000)
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.

45 files changed:
ChangeLog
INSTALL
Makeconfig
Rules
benchtests/Makefile
catgets/Makefile
catgets/test-gencat.sh
elf/Makefile
elf/tst-pathopt.sh
iconvdata/Makefile
iconvdata/run-iconv-test.sh
iconvdata/tst-table.sh
intl/Makefile
intl/tst-gettext.sh
intl/tst-gettext2.sh
intl/tst-gettext4.sh
intl/tst-gettext6.sh
intl/tst-translit.sh
localedata/ChangeLog
localedata/Makefile
localedata/gen-locale.sh
localedata/sort-test.sh
localedata/tst-ctype.sh
localedata/tst-fmon.sh
localedata/tst-langinfo.sh
localedata/tst-locale.sh
localedata/tst-mbswcs.sh
localedata/tst-numeric.sh
localedata/tst-rpmatch.sh
localedata/tst-trans.sh
localedata/tst-wctype.sh
malloc/Makefile
malloc/tst-mtrace.sh
manual/install.texi
math/Makefile
nptl/Makefile
nptl/tst-tls6.sh
posix/Makefile
posix/tst-getconf.sh
posix/wordexp-tst.sh
scripts/cross-test-ssh.sh
stdio-common/tst-printf.sh
stdlib/Makefile
stdlib/tst-fmtmsg.sh
timezone/Makefile

index 1b1f398c394d7bed29d29870e66892e791bfde3d..4baa8455ce33cdc613b216be30d055f7252c3f98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,90 @@
+2014-06-06  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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).
+
 2014-06-06  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        * sysdeps/powerpc/powerpc64/power7/strncat.S [STRLEN]: Define it as
diff --git a/INSTALL b/INSTALL
index f49fad4cafe33a21a0a2e179c182746fad8d9b55..63630b8bbe5a85d27ff5c852c6dd807ac31e2044 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -241,13 +241,14 @@ be visible at the same locations on both the build system and HOSTNAME.
    In general, when testing the GNU C Library, `test-wrapper' may be set
 to the name and arguments of any program to run newly built binaries.
 This program must preserve the arguments to the binary being run, its
-working directory, all environment variables set as part of testing and
-the standard input, output and error file descriptors.  If
-`TEST-WRAPPER env' will not work to run a program with environment
-variables set, then `test-wrapper-env' must be set to a program that
-runs a newly built program with environment variable assignments in
-effect, those assignments being specified as `VAR=VALUE' before the
-name of the program to be run.
+working directory and the standard input, output and error file
+descriptors.  If `TEST-WRAPPER env' will not work to run a program with
+environment variables set, then `test-wrapper-env' must be set to a
+program that runs a newly built program with environment variable
+assignments in effect, those assignments being specified as `VAR=VALUE'
+before the name of the program to be run.  If multiple assignments to
+the same variable are specified, the last assignment specified must
+take precedence.
 
 Installing the C Library
 ========================
index 736190bc1098e6cfb56259abc07db4fefdbbc4d9..e07823f1bd54fda6bdc43e14f98c25092f3724b3 100644 (file)
@@ -628,17 +628,30 @@ run-via-rtld-prefix =                                                           \
 else
 run-via-rtld-prefix =
 endif
+# $(run-program-env) is the default environment variable settings to
+# use when running a program built with the newly built library.
+run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \
+                 LOCPATH=$(common-objpfx)localedata LC_ALL=C
 # $(run-program-prefix) is a command that, when prepended to the name
 # of a program built with the newly built library, produces a command
 # that, executed on the build system on which "make" is run, runs that
-# program.
-run-program-prefix = $(test-wrapper) $(run-via-rtld-prefix)
+# program.  $(run-program-prefix-before-env) and
+# $(run-program-prefix-after-env) are similar, but separate parts
+# before and after a list of environment variables.
+run-program-prefix-before-env = $(test-wrapper-env)
+run-program-prefix-after-env = $(run-via-rtld-prefix)
+run-program-prefix = $(run-program-prefix-before-env) $(run-program-env) \
+                    $(run-program-prefix-after-env)
 # $(built-program-cmd) is a command that, executed on the build system
 # on which "make" is run, runs the newly built program that is the
 # second dependency of the makefile target in which
-# $(built-program-cmd) is used.
-built-program-cmd = $(test-wrapper) \
-                   $(run-via-rtld-prefix) $(built-program-file)
+# $(built-program-cmd) is used.  $(built-program-cmd-before-env) and
+# $(built-program-cmd-after-env) are similar, before and after a list
+# of environment variables.
+built-program-cmd-before-env = $(test-wrapper-env)
+built-program-cmd-after-env = $(run-via-rtld-prefix) $(built-program-file)
+built-program-cmd = $(built-program-cmd-before-env) $(run-program-env) \
+                   $(built-program-cmd-after-env)
 # $(host-built-program-cmd) is a command that, executed on the host
 # for which the library is built, runs the newly built program that is
 # the second dependency of the makefile target in which
@@ -659,12 +672,16 @@ endif
 # $(test-program-prefix) is a command that, when prepended to the name
 # of a test program built with the newly built library, produces a command
 # that, executed on the build system on which "make" is run, runs that
-# test program.
+# test program.  $(test-program-prefix-before-env) and
+# $(test-program-prefix-after-env) are similar, before and after a
+# list of environment variables.
 
 # $(test-program-cmd) is a command that, executed on the build system
 # on which "make" is run, runs the newly built test program that is the
 # second dependency of the makefile target in which
-# $(test-program-cmd) is used.
+# $(test-program-cmd) is used.  $(test-program-cmd-before-env) and
+# $(test-program-cmd-after-env) are similar, before and after a list
+# of environment variables.
 
 # $(host-test-program-cmd) is a command that, executed on the host
 # for which the library is built, runs the newly built test program that
@@ -673,12 +690,22 @@ endif
 
 ifeq (yes,$(build-hardcoded-path-in-tests))
 test-via-rtld-prefix =
-test-program-prefix = $(test-wrapper)
-test-program-cmd = $(test-wrapper) $(built-program-file)
+test-program-prefix-before-env = $(test-wrapper-env)
+test-program-prefix-after-env =
+test-program-prefix = $(test-program-prefix-before-env) $(run-program-env) \
+                     $(test-program-prefix-after-env)
+test-program-cmd-before-env = $(test-wrapper-env)
+test-program-cmd-after-env = $(built-program-file)
+test-program-cmd = $(test-program-cmd-before-env) $(run-program-env) \
+                  $(test-program-cmd-after-env)
 host-test-program-cmd = $(built-program-file)
 else
 test-via-rtld-prefix = $(run-via-rtld-prefix)
+test-program-prefix-before-env = $(run-program-prefix-before-env)
+test-program-prefix-after-env = $(run-program-prefix-after-env)
 test-program-prefix = $(run-program-prefix)
+test-program-cmd-before-env = $(built-program-cmd-before-env)
+test-program-cmd-after-env = $(built-program-cmd-after-env)
 test-program-cmd = $(built-program-cmd)
 host-test-program-cmd = $(host-built-program-cmd)
 endif
diff --git a/Rules b/Rules
index 9f1a445ea7ddfd1979153a2a852024cc66baf3e0..4f9cdf30e6e66012ec1e14b81ed8cfc0c4426ef5 100644 (file)
--- a/Rules
+++ b/Rules
@@ -191,8 +191,7 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
 # from the test programs and whatever input files are present.
 
 make-test-out = $(test-wrapper-env) \
-               GCONV_PATH=$(common-objpfx)iconvdata \
-               LOCPATH=$(common-objpfx)localedata LC_ALL=C \
+               $(run-program-env) \
                $($*-ENV) $(host-test-program-cmd) $($*-ARGS)
 $(objpfx)%.out: %.input $(objpfx)%
        $(make-test-out) > $@ < $(word 1,$^); \
index 63a5a7fd6b7d94fcba1208a42fb9da316aa8e6bf..fbcee1328b222c55a7b40f30695e9408b929c9aa 100644 (file)
@@ -91,7 +91,7 @@ extra-objs += json-lib.o
 bench-deps := bench-skeleton.c bench-timing.h Makefile
 
 run-bench = $(test-wrapper-env) \
-           GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
+           $(run-program-env) \
            $($*-ENV) $(rtld-prefix) $${run}
 
 timing-type := $(objpfx)bench-timing-type
index ed0650807bf3c589a5de4d946dee48f256dc4f78..50d972e65dd1f10dcbcc3242629c9b38aacb1d69 100644 (file)
@@ -61,19 +61,18 @@ ifeq ($(run-built-tests),yes)
 # This test just checks whether the program produces any error or not.
 # The result is not tested.
 $(objpfx)test1.cat: test1.msg $(objpfx)gencat
-       LC_ALL=hr_HR.ISO-8859-2 LOCPATH=$(common-objpfx)localedata \
-       GCONV_PATH=$(common-objpfx)iconvdata \
-       $(built-program-cmd) -H $(objpfx)test1.h $@ $<; \
+       $(built-program-cmd-before-env) \
+       $(run-program-env) LC_ALL=hr_HR.ISO-8859-2 \
+       $(built-program-cmd-after-env) -H $(objpfx)test1.h $@ $<; \
        $(evaluate-test)
 $(objpfx)test2.cat: test2.msg $(objpfx)gencat
-       LOCPATH=$(common-objpfx)localedata \
-       GCONV_PATH=$(common-objpfx)iconvdata \
        $(built-program-cmd) -H $(objpfx)test2.h $@ $<; \
        $(evaluate-test)
 $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat
        $(make-target-directory)
-       LC_ALL=de_DE.ISO-8859-1 LOCPATH=$(common-objpfx)localedata \
-       GCONV_PATH=$(common-objpfx)iconvdata $(built-program-cmd) $@ $<; \
+       $(built-program-cmd-before-env) \
+       $(run-program-env) LC_ALL=de_DE.ISO-8859-1 \
+       $(built-program-cmd-after-env) $@ $<; \
        $(evaluate-test)
 $(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
 
@@ -83,11 +82,11 @@ $(objpfx)de.msg: xopen-msg.awk $(..)po/de.po
 
 $(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
                          $(objpfx)sample.SJIS.cat
-       $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+                '$(run-program-env)' '$(test-program-cmd-after-env)'; \
        $(evaluate-test)
 
 $(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
-       GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
        $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@; \
        $(evaluate-test)
 endif
index 08e47af24af51882ba1b83c5e7a1e537ebbb4f93..98ef7da6ef3a0e639c1adaa9982e8eb35a0e4963 100755 (executable)
 set -e
 
 common_objpfx=$1
-test_program_cmd=$2
+test_program_cmd_before_env=$2
+run_program_env=$3
+test_program_cmd_after_env=$4
 
 # Run the test program.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-NLSPATH=${common_objpfx}catgets/%N.%c.cat LC_ALL=ja_JP.SJIS \
-  ${test_program_cmd} \
+${test_program_cmd_before_env} \
+  ${run_program_env} \
+  NLSPATH=${common_objpfx}catgets/%N.%c.cat LC_ALL=ja_JP.SJIS \
+  ${test_program_cmd_after_env} \
     > ${common_objpfx}catgets/test-gencat.out
 
 # Compare with the expected result.
index 4dcc78a163fc4b1837836297f2d4727d048df743..eb16c5998ce6f6c8528f62d251320a535b72f1fa 100644 (file)
@@ -711,7 +711,8 @@ $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
 $(objpfx)tst-pathopt: $(libdl)
 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
                          $(objpfx)pathoptobj.so
-       $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)'; \
+       $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \
+                '$(run-program-env)'; \
        $(evaluate-test)
 
 $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
index 9677cf0ae85f4c3612b7ebf91f8f59a1f4032d40..24f55c036149e9a46c5be7c0e770efe1ad840432 100755 (executable)
@@ -21,6 +21,7 @@ set -e
 
 common_objpfx=$1
 test_wrapper_env=$2
+run_program_env=$3
 
 test -e ${common_objpfx}elf/will-be-empty &&
   rm -fr ${common_objpfx}elf/will-be-empty
@@ -30,8 +31,8 @@ test -d ${common_objpfx}elf/for-renamed ||
 cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so
 
 ${test_wrapper_env} \
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=C LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
+${run_program_env} \
+LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
   ${common_objpfx}elf/ld.so ${common_objpfx}elf/tst-pathopt \
     > ${common_objpfx}elf/tst-pathopt.out
 
index d98b6bd2e9f362f872fd41894ffcd046dc8097bd..8fb746e1d5bba54e54a6447678ae35a03d296385 100644 (file)
@@ -297,7 +297,8 @@ $(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \
 $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
                         $(addprefix $(objpfx),$(modules.so)) \
                         $(common-objdir)/iconv/iconv_prog TESTS
-       $(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@; \
+       $(SHELL) $< $(common-objdir) '$(test-wrapper-env)' \
+                '$(run-program-env)' > $@; \
        $(evaluate-test)
 
 $(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
index e23f60d4425b84f3410bf5ce5154887ba735a649..c98c92950d79710bdfccc189bfdb7728239a285b 100755 (executable)
@@ -21,7 +21,8 @@
 set -e
 
 codir=$1
-test_wrapper="$2"
+test_wrapper_env="$2"
+run_program_env="$3"
 
 # We use always the same temporary file.
 temp1=$codir/iconvdata/iconv-test.xxx
@@ -29,18 +30,13 @@ temp2=$codir/iconvdata/iconv-test.yyy
 
 trap "rm -f $temp1 $temp2" 1 2 3 15
 
-# We must tell the iconv(1) program where the modules we want to use can
-# be found.
-GCONV_PATH=$codir/iconvdata
-export GCONV_PATH
-
 # We have to have some directories in the library path.
 LIBPATH=$codir:$codir/iconvdata
 
 # How the start the iconv(1) program.
 ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
        $codir/iconv/iconv_prog'
-ICONV="$test_wrapper $ICONV"
+ICONV="$test_wrapper_env $run_program_env $ICONV"
 
 # Which echo?
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
index c68a3b9f01846258afe891404fb26ac67dc3e938..838f332794c24f3a005eacd44468a12dad63f468 100755 (executable)
@@ -27,8 +27,7 @@ test_program_prefix=$3
 charset=$4
 charmap=$5
 
-GCONV_PATH=${common_objpfx}iconvdata
-export GCONV_PATH
+# sort is used on the build system.
 LC_ALL=C
 export LC_ALL
 
index 10051f6871dcffdcf100b349e1d863ad5bca25a0..a04643128a38b52dd9ab92cd2d45d6f0a7c0e66a 100644 (file)
@@ -81,7 +81,8 @@ $(objpfx)mtrace-tst-gettext.out: $(objpfx)tst-gettext.out
        $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@; \
        $(evaluate-test)
 $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+         '$(run-program-env)' '$(test-program-prefix-after-env)' \
          $(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace; \
        $(evaluate-test)
 $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
@@ -89,7 +90,8 @@ $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
          $(common-objpfx)intl/; \
        $(evaluate-test)
 $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+         '$(run-program-env)' '$(test-program-prefix-after-env)' \
          $(common-objpfx)intl/; \
        $(evaluate-test)
 $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4
index 0483e2bbcd91a80dcf881e1dc6ea036d45732063..129ce65a6148ebaa7b768601f7d7fee1d7bd8e47 100755 (executable)
 set -e
 
 common_objpfx=$1
-test_program_prefix=$2
-objpfx=$3
-malloc_trace=$4
-
-LC_ALL=C
-export LC_ALL
+test_program_prefix_before_env=$2
+run_program_env=$3
+test_program_prefix_after_env=$4
+objpfx=$5
+malloc_trace=$6
 
 # Generate the test data.
 
@@ -47,14 +46,12 @@ msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/existing-domain.mo \
 msgfmt -o ${objpfx}domaindir/existing-locale/LC_TIME/existing-time-domain.mo \
        -f ../po/de.po
 
-GCONV_PATH=${common_objpfx}iconvdata
-export GCONV_PATH
-LOCPATH=${common_objpfx}localedata
-export LOCPATH
-
 # Now run the test.
-MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
-${test_program_prefix} \
+${test_program_prefix_before_env} \
+${run_program_env} \
+MALLOC_TRACE=$malloc_trace \
+LOCPATH=${objpfx}localedir:${common_objpfx}localedata \
+${test_program_prefix_after_env} \
 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
 
 exit $?
index 44821d2d159493cf1ddcbe2ea8fc420f8898b675..b4d203d66778abe819de4aaa192df5124f67dd0e 100644 (file)
 set -e
 
 common_objpfx=$1
-test_program_prefix=$2
-objpfx=$3
-
-LC_ALL=C
-export LC_ALL
+test_program_prefix_before_env=$2
+run_program_env=$3
+test_program_prefix_after_env=$4
+objpfx=$5
 
 # Generate the test data.
 mkdir -p ${objpfx}domaindir
@@ -61,13 +60,11 @@ msgfmt -o ${objpfx}domaindir/lang1/LC_MESSAGES/tstlang.mo \
 msgfmt -o ${objpfx}domaindir/lang2/LC_MESSAGES/tstlang.mo \
        tstlang2.po
 
-GCONV_PATH=${common_objpfx}iconvdata
-export GCONV_PATH
-LOCPATH=${objpfx}domaindir
-export LOCPATH
-
 # Now run the test.
-${test_program_prefix} \
+${test_program_prefix_before_env} \
+${run_program_env} \
+LOCPATH=${objpfx}domaindir \
+${test_program_prefix_after_env} \
 ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
 cmp ${objpfx}tst-gettext2.out - <<EOF
 String1 - Lang1: 1st string
index fc975df28f6d801d1feff0cd19dea2fa98e86dad..4039fafaa521ca1d209dd43029272181f100c95f 100755 (executable)
@@ -24,9 +24,6 @@ common_objpfx=$1
 test_program_prefix=$2
 objpfx=$3
 
-LC_ALL=C
-export LC_ALL
-
 # Create the domain directories.
 mkdir -p ${objpfx}domaindir/de_DE/LC_MESSAGES
 mkdir -p ${objpfx}domaindir/fr_FR/LC_MESSAGES
@@ -34,11 +31,6 @@ mkdir -p ${objpfx}domaindir/fr_FR/LC_MESSAGES
 msgfmt -o ${objpfx}domaindir/de_DE/LC_MESSAGES/multithread.mo tst-gettext4-de.po
 msgfmt -o ${objpfx}domaindir/fr_FR/LC_MESSAGES/multithread.mo tst-gettext4-fr.po
 
-GCONV_PATH=${common_objpfx}iconvdata
-export GCONV_PATH
-LOCPATH=${common_objpfx}localedata
-export LOCPATH
-
 ${test_program_prefix} ${objpfx}tst-gettext4 > ${objpfx}tst-gettext4.out
 
 exit $?
index 70cbcbea52b660b577de1eac7e6fddee5a5f38ed..be95ffc802529294d9673dd3534d4da2049ac82b 100644 (file)
@@ -23,19 +23,11 @@ common_objpfx=$1
 test_program_prefix=$2
 objpfx=$3
 
-LC_ALL=C
-export LC_ALL
-
 # Create the domain directory.
 mkdir -p ${objpfx}domaindir/ja_JP/LC_MESSAGES
 # Populate it.
 msgfmt -o ${objpfx}domaindir/ja_JP/LC_MESSAGES/tstgettext6.mo ../po/ja.po
 
-GCONV_PATH=${common_objpfx}iconvdata
-export GCONV_PATH
-LOCPATH=${common_objpfx}localedata
-export LOCPATH
-
 ${test_program_prefix} ${objpfx}tst-gettext6 > ${objpfx}tst-gettext6.out
 
 exit $?
index 4803340de0afc70dd8e129435c56bf5c0d621f75..3408b1a767e4fee4b55e8b8a2d889c2fe2d0dcde 100755 (executable)
@@ -23,20 +23,12 @@ common_objpfx=$1
 test_program_prefix=$2
 objpfx=$3
 
-LC_ALL=C
-export LC_ALL
-
 # Create the locale directories.
 mkdir -p ${objpfx}localedir/existing-locale/LC_MESSAGES
 
 msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/translit.mo \
        translit.po
 
-GCONV_PATH=${common_objpfx}iconvdata
-export GCONV_PATH
-LOCPATH=${common_objpfx}localedata
-export LOCPATH
-
 ${test_program_prefix} \
 ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
 
index 134af04c99de3a3f62fdbc9ff640ee4c2dcaa9a7..7d91d38314f84fa1c1ef74c2fbd2e0337f54c2c9 100644 (file)
@@ -1,3 +1,45 @@
+2014-06-06  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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-05  Andreas Schwab  <schwab@suse.de>
 
        [BZ #16095]
index 20da00cf1664ddfaa4e10ae1106efca33e0a2c11..6dc25244e1f5da409c0a36b3af8cb4dc3d59361e 100644 (file)
@@ -143,7 +143,9 @@ generated-dirs += $(LOCALES)
 $(addprefix $(objpfx),$(CTYPE_FILES)): %: \
   gen-locale.sh $(common-objpfx)locale/localedef Makefile \
   $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
-       @$(SHELL) gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@; \
+       @$(SHELL) gen-locale.sh $(common-objpfx) \
+                 '$(built-program-cmd-before-env)' '$(run-program-env)' \
+                 '$(built-program-cmd-after-env)' $@; \
        $(evaluate-test)
 
 $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
@@ -151,14 +153,17 @@ $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
 
 $(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
                       $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(test-input) \
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+         '$(run-program-env)' '$(test-program-prefix-after-env)' \
+         $(test-input) \
          > $@; \
        $(evaluate-test)
 $(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
                       $(objpfx)sort-test.out \
                       $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(run-program-prefix)' \
-               '$(test-program-prefix)' tst-fmon.data  \
+       $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
+                '$(run-program-env)' '$(run-program-prefix-after-env)' \
+                '$(test-program-prefix)' tst-fmon.data \
          > $@; \
        $(evaluate-test)
 $(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
@@ -169,7 +174,8 @@ $(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
        $(evaluate-test)
 $(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
                         $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@; \
+       $(SHELL) $< $(common-objpfx) '$(built-program-cmd-before-env)' \
+                '$(run-program-env)' '$(built-program-cmd-after-env)' > $@; \
        $(evaluate-test)
 $(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
                          $(objpfx)tst-fmon.out \
@@ -178,7 +184,10 @@ $(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
        $(evaluate-test)
 $(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
                        $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(run-program-prefix)' '$(test-program-prefix)'; \
+       $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
+                '$(run-program-env)' '$(run-program-prefix-after-env)' \
+                '$(test-program-prefix-before-env)' \
+                '$(test-program-prefix-after-env)'; \
        $(evaluate-test)
 $(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
                         $(objpfx)tst-mbswcs2 $(objpfx)tst-mbswcs3 \
@@ -189,22 +198,26 @@ $(objpfx)tst-mbswcs.out: tst-mbswcs.sh $(objpfx)tst-mbswcs1 \
 $(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
                        $(objpfx)sort-test.out \
                        $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+                '$(run-program-env)' '$(test-program-cmd-after-env)'; \
        $(evaluate-test)
 $(objpfx)tst-wctype.out: tst-wctype.sh $(objpfx)tst-wctype \
                        $(objpfx)sort-test.out tst-wctype.input \
                        $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+                '$(run-program-env)' '$(test-program-cmd-after-env)'; \
        $(evaluate-test)
 $(objpfx)tst-langinfo.out: tst-langinfo.sh $(objpfx)tst-langinfo \
                        $(objpfx)sort-test.out \
                        $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+                '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
        $(evaluate-test)
 $(objpfx)tst-langinfo-static.out: tst-langinfo.sh $(objpfx)tst-langinfo-static \
                        $(objpfx)sort-test.out \
                        $(addprefix $(objpfx),$(CTYPE_FILES))
-       $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+                '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
        $(evaluate-test)
 $(objpfx)tst-digits.out: $(objpfx)tst-locale.out
 $(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
index d2fde61e322ccdc8224c763461db2a2ffc445a70..151634ba14571c5477b827b0a1674813a2d077f8 100644 (file)
@@ -20,7 +20,9 @@
 set -e
 
 common_objpfx="$1"; shift
-localedef="$1"; shift
+localedef_before_env="$1"; shift
+run_program_env="$1"; shift
+localedef_after_env="$1"; shift
 locfile="$1"; shift
 
 generate_locale ()
@@ -28,9 +30,9 @@ generate_locale ()
   charmap=$1
   input=$2
   out=$3
-  if I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
-     ${localedef} --quiet -c -f $charmap -i $input \
-                 ${common_objpfx}localedata/$out
+  if ${localedef_before_env} ${run_program_env} I18NPATH=. \
+     ${localedef_after_env} --quiet -c -f $charmap -i $input \
+                           ${common_objpfx}localedata/$out
   then
     # The makefile checks the timestamp of the LC_CTYPE file,
     # but localedef won't have touched it if it was able to
index 8a7ca8968850c97a1a3bc1ca73efe6661f6c24d8..e37129a032ddebea0ae60febfe92452dc323adef 100644 (file)
@@ -20,7 +20,9 @@
 set -e
 
 common_objpfx=$1; shift
-test_program_prefix=$1; shift
+test_program_prefix_before_env=$1; shift
+run_program_env=$1; shift
+test_program_prefix_after_env=$1; shift
 lang=$*
 
 id=${PPID:-100}
@@ -31,8 +33,9 @@ status=0
 for l in $lang; do
   here=0
   cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
-  LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$l ${test_program_prefix} \
+  ${test_program_prefix_before_env} \
+   ${run_program_env} \
+   LC_ALL=$l ${test_program_prefix_after_env} \
    ${common_objpfx}localedata/collate-test $id < $cns.in \
    > ${common_objpfx}localedata/$cns.out || here=1
   cmp -s $cns.in ${common_objpfx}localedata/$cns.out || here=1
@@ -44,8 +47,9 @@ for l in $lang; do
     status=1
   fi
 
-  LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$l ${test_program_prefix} \
+  ${test_program_prefix_before_env} \
+   ${run_program_env} \
+   LC_ALL=$l ${test_program_prefix_after_env} \
    ${common_objpfx}localedata/xfrm-test $id < $cns.in \
    > ${common_objpfx}localedata/$cns.xout || here=1
   cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || here=1
index 472f8dc8b06ac540dc493d9668e9d2fe4235d3f9..ae105baaab981b6a96452a41c49b9ec6c9c5cea8 100755 (executable)
@@ -20,7 +20,9 @@
 set -e
 
 common_objpfx=$1; shift
-tst_ctype=$1; shift
+tst_ctype_before_env=$1; shift
+run_program_env=$1; shift
+tst_ctype_after_env=$1; shift
 status=0
 
 # Run the test programs.
@@ -31,8 +33,9 @@ for loc in C de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 ja_JP.EUC-JP; do
   else
     input=/dev/null
   fi
-  LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-  LC_ALL=$loc ${tst_ctype} < $input \
+  ${tst_ctype_before_env} \
+  ${run_program_env} \
+  LC_ALL=$loc ${tst_ctype_after_env} < $input \
     >> ${common_objpfx}localedata/tst-ctype.out || status=1
 done
 
index e68aa9640963ab411bdb371695d94bb2cee81e0b..7f1b2488a2ebb759b4c87cae2a14e2e55a988b77 100755 (executable)
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-test_program_prefix=$3
-datafile=$4
+run_program_prefix_before_env=$2
+run_program_env=$3
+run_program_prefix_after_env=$4
+test_program_prefix=$5
+datafile=$6
 
 here=`pwd`
 
@@ -33,9 +35,10 @@ lang=`sed -e '/^#/d' -e '/^$/d' -e '/^C      /d' -e '/^tstfmon/d' -e 's/^\([^        ]*\).*/
 for cns in `cd ./tst-fmon-locales && ls tstfmon_*`; do
     cn=tst-fmon-locales/$cns
     fn=charmaps/ISO-8859-1
-    I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
-    LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
-    ${run_program_prefix} ${common_objpfx}locale/localedef \
+    ${run_program_prefix_before_env} \
+    ${run_program_env} \
+    I18NPATH=. LANGUAGE=C \
+    ${run_program_prefix_after_env} ${common_objpfx}locale/localedef \
     --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
 done
 
@@ -46,8 +49,6 @@ while IFS="   " read locale format value expect; do
     case "$locale" in '#'*) continue ;; esac
     if [ -n "$format" ]; then
        expect=`echo "$expect" | sed 's/^\"\(.*\)\"$/\1/'`
-       LOCPATH=${common_objpfx}localedata \
-       GCONV_PATH=${common_objpfx}/iconvdata \
        ${test_program_prefix} ${common_objpfx}localedata/tst-fmon \
        "$locale" "$format" "$value" "$expect" < /dev/null ||
        errcode=$?
index bd489d024f13e00c124a4c83f8dc25fbcfa50597..df5aed3f5578333ed95369a44de9f98c0ee7a3cf 100755 (executable)
@@ -20,7 +20,9 @@
 set -e
 
 common_objpfx=$1
-tst_langinfo=$2
+tst_langinfo_before_env=$2
+run_program_env=$3
+tst_langinfo_after_env=$4
 
 # Run the test program.
 cat <<"EOF" |
@@ -339,7 +341,8 @@ ja_JP.EUC-JP         NOEXPR      ^([nN
 # ja_JP.EUC-JP         CRNCYSTR    JPY
 ja_JP.EUC-JP         CODESET     EUC-JP
 EOF
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${tst_langinfo}
+${tst_langinfo_before_env} \
+${run_program_env} \
+LC_ALL=tt_TT ${tst_langinfo_after_env}
 
 exit $?
index b89dc095fa4a5089daf09efc13b20dc3e274875e..7c71dcf72c9577ef525a514e1ec946363d39f74a 100755 (executable)
@@ -21,7 +21,9 @@
 set -e
 
 common_objpfx=$1; shift
-localedef=$1; shift
+localedef_before_env=$1; shift
+run_program_env=$1; shift
+localedef_after_env=$1; shift
 
 test_locale ()
 {
@@ -32,9 +34,10 @@ test_locale ()
     if test $rep; then
       rep="--repertoire-map $rep"
     fi
-    I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
-    LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
-    ${localedef} --quiet -c -f $charmap -i $input \
+    ${localedef_before_env} \
+    ${run_program_env} \
+    I18NPATH=. LANGUAGE=C \
+    ${localedef_after_env} --quiet -c -f $charmap -i $input \
       ${rep} ${common_objpfx}localedata/$out
 
     if [ $? -ne 0 ]; then
index 6a70fd7b629ded5b81b3847a218715e4b853da59..1cfc4823078313b2721cc3d87e24c5ac947733f5 100755 (executable)
@@ -25,23 +25,18 @@ test_program_prefix=$1; shift
 status=0
 
 # Run the test programs.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 ${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \
   > ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 ${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 ${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 ${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 ${test_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
index ff797cd9fa903491c797bdb6b4ffdf01ad9b258c..734466e9751f80e0488a549454b0b2e61f449aab 100644 (file)
@@ -30,9 +30,7 @@ errcode=0
 while IFS="    " read locale format value expect; do
     case "$locale" in '#'*) continue ;; esac
     if [ -n "$format" ]; then
-       if LOCPATH=${common_objpfx}localedata \
-           GCONV_PATH=${common_objpfx}/iconvdata \
-           ${test_program_prefix} ${common_objpfx}localedata/tst-numeric \
+       if ${test_program_prefix} ${common_objpfx}localedata/tst-numeric \
            "$locale" "$format" "$value" "$expect" < /dev/null
        then
            echo "Locale: \"${locale}\" Format: \"${format}\"" \
index bdb3b7c269eca012fa9bbe5f54dc8dc4d827a4b4..a0fd9140f2f34cf40ee9b07df85bffeb34e9e580 100755 (executable)
@@ -26,8 +26,6 @@ tst_rpmatch=$2
 rc=0
 while IFS=\& read locale string result dummy; do
     if [ "$locale" != "#" ]; then
-       LOCPATH=${common_objpfx}localedata \
-       GCONV_PATH=${common_objpfx}/iconvdata \
        ${tst_rpmatch} $locale $string $result < /dev/null \
        || { echo "$locale $string $result  FAILED"; exit 1; }
     fi
index e82e4f8b63c6a72609911983d5a05bdd28a329d3..99190a56230dd4fd10d97109eb20440de89c7e83 100755 (executable)
 set -e
 
 common_objpfx=$1
-run_program_prefix=$2
-test_program_prefix=$3
+run_program_prefix_before_env=$2
+run_program_env=$3
+run_program_prefix_after_env=$4
+test_program_prefix_before_env=$5
+test_program_prefix_after_env=$6
 
 # Generate the necessary locale data.
-I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
-${run_program_prefix} \
+${run_program_prefix_before_env} \
+${run_program_env} \
+I18NPATH=. \
+${run_program_prefix_after_env} \
 ${common_objpfx}locale/localedef --quiet \
 -i tests/trans.def -f charmaps/ISO-8859-1 \
 ${common_objpfx}localedata/tt_TT ||
 exit 1
 
 # Run the test program.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${test_program_prefix} \
+${test_program_prefix_before_env} \
+${run_program_env} \
+LC_ALL=tt_TT ${test_program_prefix_after_env} \
 ${common_objpfx}localedata/tst-trans > ${common_objpfx}localedata/tst-trans.out
 
 exit $?
index 31d57bc514f41567760e09a4c5ec8c951fb43b6b..53b88b50b61c549c763eeef3d88945ccd15c1688 100755 (executable)
 set -e
 
 common_objpfx=$1
-tst_wctype=$2
+tst_wctype_before_env=$2
+run_program_env=$3
+tst_wctype_after_env=$4
 
 # Run the test program.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=ja_JP.EUC-JP ${tst_wctype} < tst-wctype.input \
+${tst_wctype_before_env} \
+${run_program_env} \
+LC_ALL=ja_JP.EUC-JP ${tst_wctype_after_env} < tst-wctype.input \
     > ${common_objpfx}localedata/tst-wctype.out
 
 exit $?
index 7a716f983fd527a83b43f6790ec0dea044dbe033..9e9352341b93e2e0627540e3872163b4caa15ed4 100644 (file)
@@ -116,7 +116,8 @@ ifeq ($(run-built-tests),yes)
 ifeq (yes,$(build-shared))
 ifneq ($(PERL),no)
 $(objpfx)tst-mtrace.out: tst-mtrace.sh $(objpfx)tst-mtrace
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+                '$(run-program-env)' '$(test-program-prefix-after-env)' ; \
        $(evaluate-test)
 endif
 endif
index abd425ddf3cd53a24acf252b56ec939181a8c02a..446ebec496ec285679ee3e34f057e3c3b301b1eb 100755 (executable)
 set -e
 
 common_objpfx=$1; shift
-test_program_prefix=$1; shift
+test_program_prefix_before_env=$1; shift
+run_program_env=$1; shift
+test_program_prefix_after_env=$1; shift
 
 status=0
 trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
 
+${test_program_prefix_before_env} \
+${run_program_env} \
 MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${test_program_prefix} \
+${test_program_prefix_after_env} \
   ${common_objpfx}malloc/tst-mtrace || status=1
 
 if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
index d7da02bcb35105855e06295887c26deaed092d4e..08851e1d5b253f0eaf876019f7fbe1e4a0ab7e21 100644 (file)
@@ -275,13 +275,15 @@ system and @var{hostname}.
 In general, when testing @theglibc{}, @samp{test-wrapper} may be set
 to the name and arguments of any program to run newly built binaries.
 This program must preserve the arguments to the binary being run, its
-working directory, all environment variables set as part of testing
-and the standard input, output and error file descriptors.  If
+working directory and the standard input, output and error file
+descriptors.  If
 @samp{@var{test-wrapper} env} will not work to run a program with
 environment variables set, then @samp{test-wrapper-env} must be set to
 a program that runs a newly built program with environment variable
 assignments in effect, those assignments being specified as
-@samp{@var{var}=@var{value}} before the name of the program to be run.
+@samp{@var{var}=@var{value}} before the name of the program to be
+run.  If multiple assignments to the same variable are specified,
+the last assignment specified must take precedence.
 
 
 @node Running make install
index f337a0ef54cb38b8be8c92143114b60b0f39ec86..b5cbfda4690d4ac8c5d232328caefbf63ce03388 100644 (file)
@@ -159,7 +159,7 @@ ifneq (no,$(PERL))
 .PHONY: regen-ulps
 
 run-regen-ulps = $(test-wrapper-env) \
-           GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
+           $(run-program-env) \
            $($*-ENV) $(rtld-prefix) $${run}
 
 regen-ulps: $(addprefix $(objpfx),$(libm-tests))
index 0bb6ab19c1003e2bc04b14d2aa8a01df36bed8bc..cd3be126d6f245b417bb4387afdbc4ecccab2629 100644 (file)
@@ -493,7 +493,7 @@ $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
                       $(objpfx)tst-tls5modc.so $(objpfx)tst-tls5modd.so \
                       $(objpfx)tst-tls5mode.so $(objpfx)tst-tls5modf.so
        $(BASH) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
-         '$(test-wrapper-env)'; \
+         '$(test-wrapper-env)' '$(run-program-env)'; \
        $(evaluate-test)
 endif
 
index 5a897fef6090199f459e58e673fa7b2c05458df1..2d31826c7fb4f1c1237ee15c60128079d901e9eb 100755 (executable)
@@ -22,17 +22,13 @@ set -e
 common_objpfx=$1; shift
 test_via_rtld_prefix=$1; shift
 test_wrapper_env=$1; shift
+run_program_env=$1; shift
 logfile=$common_objpfx/nptl/tst-tls6.out
 
 # We have to find libc and nptl
 library_path=${common_objpfx}:${common_objpfx}nptl
 tst_tls5="${test_via_rtld_prefix} ${common_objpfx}/nptl/tst-tls5"
 
-LC_ALL=C
-export LC_ALL
-LANG=C
-export LANG
-
 > $logfile
 fail=0
 
@@ -40,6 +36,7 @@ for aligned in a e f; do
   echo "preload tst-tls5mod{$aligned,b,c,d}.so" >> $logfile
   echo "===============" >> $logfile
   ${test_wrapper_env} \
+  ${run_program_env} LANG=C \
   LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
              | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
   echo >> $logfile
@@ -47,6 +44,7 @@ for aligned in a e f; do
   echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile
   echo "===============" >> $logfile
   ${test_wrapper_env} \
+  ${run_program_env} LANG=C \
   LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
              | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
   echo >> $logfile
@@ -54,6 +52,7 @@ for aligned in a e f; do
   echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile
   echo "===============" >> $logfile
   ${test_wrapper_env} \
+  ${run_program_env} LANG=C \
   LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
              | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
   echo >> $logfile
@@ -62,6 +61,7 @@ done
 echo "preload tst-tls5mod{d,a,b,c,e}" >> $logfile
 echo "===============" >> $logfile
 ${test_wrapper_env} \
+${run_program_env} LANG=C \
 LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
            | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
 echo >> $logfile
@@ -69,6 +69,7 @@ echo >> $logfile
 echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile
 echo "===============" >> $logfile
 ${test_wrapper_env} \
+${run_program_env} LANG=C \
 LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
            | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
 echo >> $logfile
index 3d7597114fd8e521406a4007733ef29e464800ce..14e6ceeaf6bec383e887682f5a8c52b94ede9f69 100644 (file)
@@ -143,7 +143,8 @@ $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
                '$(test-program-prefix)' '$(test-wrapper-env)'; \
        $(evaluate-test)
 $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+                '$(run-program-env)' '$(test-program-prefix-after-env)'; \
        $(evaluate-test)
 endif
 endif
index 1cbebc5b68910918b9699b3c40a81646852f47a1..0f770c40d09b2ded59add0f9eb7c81261311a20f 100644 (file)
@@ -24,12 +24,6 @@ run_getconf=$1; shift
 
 logfile=$common_objpfx/posix/tst-getconf.out
 
-# Since we use `sort' we must make sure to use the same locale everywhere.
-LC_ALL=C
-export LC_ALL
-LANG=C
-export LANG
-
 rm -f $logfile
 result=0
 while read name; do
index 392feb0966951f586fe14f4680329a28ff9fddf6..2ed239b4cf60086015c427e135771a5f0a9afa2c 100755 (executable)
@@ -24,7 +24,9 @@ set -e
 # The others are just there to be parameters.
 
 common_objpfx=$1; shift
-test_program_prefix=$1; shift
+test_program_prefix_before_env=$1; shift
+run_program_env=$1; shift
+test_program_prefix_after_env=$1; shift
 logfile=${common_objpfx}posix/wordexp-tst.out
 testout=${common_objpfx}posix/wordexp-test-result
 
@@ -38,7 +40,8 @@ IFS="         \
 export IFS
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
 cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
 wordexp returned 0
@@ -50,7 +53,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '${*}' unquoted > ${testout}2
 cat <<"EOF" | cmp - ${testout}2 >> $logfile || failed=1
 wordexp returned 0
@@ -63,7 +67,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$@' unquoted > ${testout}3
 cat <<"EOF" | cmp - ${testout}3 >> $logfile || failed=1
 wordexp returned 0
@@ -76,7 +81,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '"$* quoted"' param > ${testout}4
 cat <<"EOF" | cmp - ${testout}4 >> $logfile || failed=1
 wordexp returned 0
@@ -88,7 +94,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '"$@ quoted"' param > ${testout}5
 cat <<"EOF" | cmp - ${testout}5 >> $logfile || failed=1
 wordexp returned 0
@@ -102,7 +109,8 @@ fi
 # Why?  Because bash does it that way..
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$#' 2 3 4 5 > ${testout}6
 cat <<"EOF" | cmp - ${testout}6 >> $logfile || failed=1
 wordexp returned 0
@@ -114,7 +122,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '$2 ${3} $4' 2nd 3rd "4 th" > ${testout}7
 cat <<"EOF" | cmp - ${testout}7 >> $logfile || failed=1
 wordexp returned 0
@@ -129,7 +138,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '${11}' 2 3 4 5 6 7 8 9 10 11 > ${testout}8
 cat <<"EOF" | cmp - ${testout}8 >> $logfile || failed=1
 wordexp returned 0
@@ -141,7 +151,8 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '"a $@ b"' c d > ${testout}9
 cat <<"EOF" | cmp - ${testout}9 >> $logfile || failed=1
 wordexp returned 0
@@ -154,7 +165,8 @@ if test $failed -ne 0; then
   status=1
 fi
 
-${test_program_prefix} \
+${test_program_prefix_before_env} ${run_program_env} IFS="$IFS" \
+${test_program_prefix_after_env} \
 ${common_objpfx}posix/wordexp-test '${#@} ${#2} *$**' two 3 4 > ${testout}10
 cat <<"EOF" | cmp - ${testout}10 || failed=1
 wordexp returned 0
index 405ae999f551ba7ef96c79ee73c2138b8f0995a2..f2a80a034141dd8734c3d1e98651cf712cca7090 100755 (executable)
 # Run with --help flag to get more detailed help.
 
 progname="$(basename $0)"
-env_blacklist='HOME LOGNAME MAIL PATH SHELL SHLVL SSH_CLIENT SSH_CONNECTION
-USER TERM TERMCAP PWD'
 
 usage="usage: ${progname} [--ssh SSH] HOST COMMAND ..."
 help="Run a glibc test COMMAND on the remote machine HOST, via ssh,
-passing environment variables, preserving the current working directory,
-and respecting quoting.
+preserving the current working directory, and respecting quoting.
 
 If the '--ssh SSH' flag is present, use SSH as the SSH command,
 instead of ordinary 'ssh'.
 
+If the '--timeoutfactor FACTOR' flag is present, set TIMEOUTFACTOR on
+the remote machine to the specified FACTOR.
+
 To use this to run glibc tests, invoke the tests as follows:
 
   $ make test-wrapper='ABSPATH/cross-test-ssh.sh HOST' tests
@@ -58,13 +58,10 @@ ${progname} itself is run in on the build machine.
 The command and arguments are passed to the remote host in a way that
 avoids any further shell substitution or expansion, on the assumption
 that the shell on the build machine has already done them
-appropriately.
-
-${progname} propagates the values all environment variables through to
-the remote target, except the following:
-${env_blacklist}"
+appropriately."
 
 ssh='ssh'
+timeoutfactor=
 while [ $# -gt 0 ]; do
   case "$1" in
 
@@ -76,6 +73,14 @@ while [ $# -gt 0 ]; do
       ssh="$1"
       ;;
 
+    "--timeoutfactor")
+      shift
+      if [ $# -lt 1 ]; then
+        break
+      fi
+      timeoutfactor="$1"
+      ;;
+
     "--help")
       echo "$usage"
       echo "$help"
@@ -108,26 +113,20 @@ bourne_quote ()
   done
 }
 
-# Unset all variables from the blacklist.  Then echo all exported
-# variables.
-blacklist_exports ()
-{
-  (unset ${env_blacklist}; export -p) | sed 's/^declare -x/export/'
-}
-
-# Produce commands to carry over the current environment, less blacklisted
-# variables.
-exports="$(blacklist_exports)"
-
 # Transform the current argument list into a properly quoted Bourne shell
 # command string.
 command="$(bourne_quote "$@")"
 
-# Add commands to set environment variables and the current directory.
-command="${exports}
-cd $(bourne_quote "$PWD")
+# Add command to set the current directory.
+command="cd $(bourne_quote "$PWD")
 ${command}"
 
+# Add command to set the timeout factor, if required.
+if [ "$timeoutfactor" ]; then
+  command="export TIMEOUTFACTOR=$(bourne_quote "$timeoutfactor")
+${command}"
+fi
+
 # HOST's sshd simply concatenates its arguments with spaces and
 # passes them to some shell.  We want to force the use of /bin/sh,
 # so we need to re-quote the whole command to ensure it appears as
index 521e66068e8c120d298fffbe33c91599d767f0ee..923f6e5649e21cfe48947ee6da390ea527fef177 100644 (file)
@@ -24,7 +24,6 @@ test_program_prefix=$1; shift
 
 status=0
 
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
 ${test_program_prefix} \
   ${common_objpfx}stdio-common/tst-printf \
   > ${common_objpfx}stdio-common/tst-printf.out || status=1
index 0fdf7cc7d5929b09e4c0818f79021bcf2280adc4..9b2271b0b2e50c5b3058bf2f14eae76bfe606c7b 100644 (file)
@@ -135,7 +135,9 @@ $(objpfx)isomac: isomac.c
        $(native-compile)
 
 $(objpfx)tst-fmtmsg.out: tst-fmtmsg.sh $(objpfx)tst-fmtmsg
-       $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)stdlib/; \
+       $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+                '$(run-program-env)' '$(test-program-prefix-after-env)' \
+                $(common-objpfx)stdlib/; \
        $(evaluate-test)
 
 $(objpfx)tst-putenv: $(objpfx)tst-putenvmod.so
index 4f075dca3c487f65bcb323f7f2fa0da9f47b0f77..e3afae00f27c1a0ee7df81d6428b59170e1da920 100755 (executable)
 set -e
 
 common_objpfx=$1
-test_program_prefix=$2
-objpfx=$3
+test_program_prefix_before_env=$2
+run_program_env=$3
+test_program_prefix_after_env=$4
+objpfx=$5
 
-test="${test_program_prefix} ${objpfx}tst-fmtmsg"
+test_pre="${test_program_prefix_before_env} ${run_program_env}"
+test="${test_program_prefix_after_env} ${objpfx}tst-fmtmsg"
 out=${objpfx}tst-fmtmsg.out
 
-LC_ALL=C
-export LC_ALL
-
-(MSGVERB= $test || exit 1;
- MSGVERB=label $test || exit 1;
- MSGVERB=severity $test || exit 1;
- MSGVERB=severity:label $test || exit 1;
- MSGVERB=text $test || exit 1;
- MSGVERB=text:label $test || exit 1;
- MSGVERB=text:severity $test || exit 1;
- MSGVERB=text:severity:label $test || exit 1;
- MSGVERB=action $test || exit 1;
- MSGVERB=action:label $test || exit 1;
- MSGVERB=action:severity $test || exit 1;
- MSGVERB=action:severity:label $test || exit 1;
- MSGVERB=action:text $test || exit 1;
- MSGVERB=action:text:label $test || exit 1;
- MSGVERB=action:text:severity $test || exit 1;
- MSGVERB=action:text:severity:label $test || exit 1;
- MSGVERB=tag $test || exit 1;
- MSGVERB=tag:label $test || exit 1;
- MSGVERB=tag:severity $test || exit 1;
- MSGVERB=tag:severity:label $test || exit 1;
- MSGVERB=tag:text $test || exit 1;
- MSGVERB=tag:text:label $test || exit 1;
- MSGVERB=tag:text:severity $test || exit 1;
- MSGVERB=tag:text:severity:label $test || exit 1;
- MSGVERB=tag:action $test || exit 1;
- MSGVERB=tag:action:label $test || exit 1;
- MSGVERB=tag:action:severity $test || exit 1;
- MSGVERB=tag:action:severity:label $test || exit 1;
- MSGVERB=tag:action:text $test || exit 1;
- MSGVERB=tag:action:text:label $test || exit 1;
- MSGVERB=tag:action:text:severity $test || exit 1;
- MSGVERB=tag:action:text:severity:label $test || exit 1;) 2> $out
+($test_pre MSGVERB= $test || exit 1;
+ $test_pre MSGVERB=label $test || exit 1;
+ $test_pre MSGVERB=severity $test || exit 1;
+ $test_pre MSGVERB=severity:label $test || exit 1;
+ $test_pre MSGVERB=text $test || exit 1;
+ $test_pre MSGVERB=text:label $test || exit 1;
+ $test_pre MSGVERB=text:severity $test || exit 1;
+ $test_pre MSGVERB=text:severity:label $test || exit 1;
+ $test_pre MSGVERB=action $test || exit 1;
+ $test_pre MSGVERB=action:label $test || exit 1;
+ $test_pre MSGVERB=action:severity $test || exit 1;
+ $test_pre MSGVERB=action:severity:label $test || exit 1;
+ $test_pre MSGVERB=action:text $test || exit 1;
+ $test_pre MSGVERB=action:text:label $test || exit 1;
+ $test_pre MSGVERB=action:text:severity $test || exit 1;
+ $test_pre MSGVERB=action:text:severity:label $test || exit 1;
+ $test_pre MSGVERB=tag $test || exit 1;
+ $test_pre MSGVERB=tag:label $test || exit 1;
+ $test_pre MSGVERB=tag:severity $test || exit 1;
+ $test_pre MSGVERB=tag:severity:label $test || exit 1;
+ $test_pre MSGVERB=tag:text $test || exit 1;
+ $test_pre MSGVERB=tag:text:label $test || exit 1;
+ $test_pre MSGVERB=tag:text:severity $test || exit 1;
+ $test_pre MSGVERB=tag:text:severity:label $test || exit 1;
+ $test_pre MSGVERB=tag:action $test || exit 1;
+ $test_pre MSGVERB=tag:action:label $test || exit 1;
+ $test_pre MSGVERB=tag:action:severity $test || exit 1;
+ $test_pre MSGVERB=tag:action:severity:label $test || exit 1;
+ $test_pre MSGVERB=tag:action:text $test || exit 1;
+ $test_pre MSGVERB=tag:action:text:label $test || exit 1;
+ $test_pre MSGVERB=tag:action:text:severity $test || exit 1;
+ $test_pre MSGVERB=tag:action:text:severity:label $test || exit 1;) 2> $out
 
 cmp $out <<EOF
 GLIBC:tst-fmtmsg: HALT: halt
index 0aef202536f7c3aa4edba100b8d4d2c11b02f005..d10c3a511e976b3e3c6b4c20d92f91015ffa13af 100644 (file)
@@ -80,8 +80,8 @@ CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID -DHAVE_GETTEXT
 # Don't add leapseconds here since test-tz made checks that work only without
 # leapseconds.
 define build-testdata
-GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
-  $(built-program-cmd) -d $(testdata) -y ./yearistype $<; \
+$(built-program-cmd-before-env) $(run-program-env) LANGUAGE=C \
+  $(built-program-cmd-after-env) -d $(testdata) -y ./yearistype $<; \
 $(evaluate-test)
 endef