+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
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
========================
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
# $(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
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
# 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,$^); \
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
# 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
$(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
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.
$(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
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
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
$(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 \
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
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
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
$(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
$(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
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.
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 $?
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
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
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
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 $?
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 $?
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
+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]
$(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))): %: \
$(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 \
$(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 \
$(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 \
$(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))
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 ()
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
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}
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
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
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.
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
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`
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
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=$?
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" |
# 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 $?
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 ()
{
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
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
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}\"" \
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
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 $?
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 $?
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
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
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
.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))
$(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
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
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
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
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
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
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
'$(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
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
# 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
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
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
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
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
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
# 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
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
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
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
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
# 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
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
ssh="$1"
;;
+ "--timeoutfactor")
+ shift
+ if [ $# -lt 1 ]; then
+ break
+ fi
+ timeoutfactor="$1"
+ ;;
+
"--help")
echo "$usage"
echo "$help"
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
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
$(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
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
# 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