diff options
45 files changed, 419 insertions, 248 deletions
@@ -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 @@ -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 ======================== diff --git a/Makeconfig b/Makeconfig index 736190bc10..e07823f1bd 100644 --- a/Makeconfig +++ b/Makeconfig @@ -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 @@ -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,$^); \ diff --git a/benchtests/Makefile b/benchtests/Makefile index 63a5a7fd6b..fbcee1328b 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -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 diff --git a/catgets/Makefile b/catgets/Makefile index ed0650807b..50d972e65d 100644 --- a/catgets/Makefile +++ b/catgets/Makefile @@ -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 diff --git a/catgets/test-gencat.sh b/catgets/test-gencat.sh index 08e47af24a..98ef7da6ef 100755 --- a/catgets/test-gencat.sh +++ b/catgets/test-gencat.sh @@ -20,12 +20,15 @@ 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. diff --git a/elf/Makefile b/elf/Makefile index 4dcc78a163..eb16c5998c 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -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 diff --git a/elf/tst-pathopt.sh b/elf/tst-pathopt.sh index 9677cf0ae8..24f55c0361 100755 --- a/elf/tst-pathopt.sh +++ b/elf/tst-pathopt.sh @@ -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 ${c |
