Use $(run-program-prefix) in more shell script tests.

This commit is contained in:
Joseph Myers 2012-10-19 23:30:43 +00:00
parent 728e272aec
commit e40a0d2113
14 changed files with 85 additions and 44 deletions

View File

@ -1,5 +1,41 @@
2012-10-19 Joseph Myers <joseph@codesourcery.com>
* grp/Makefile ($(objpfx)tst_fgetgrent.out): Pass
$(run-program-prefix) to tst_fgetgrent.sh, not $(elf-objpfx) and
$(rtld-installed-name).
* grp/tst_fgetgrent.sh (elf_objpfx): Remove variable.
(rtld_installed_name): Likewise.
(library_path): Likewise.
(run_program_prefix): New variable. Use it to run tst_fgetgrent.
* iconvdata/Makefile ($(objpfx)tst-tables.out): Pass
$(run-program-prefix) to tst-tables.sh.
* iconvdata/tst-table.sh (run_program_prefix): New variable. Use
it to run tst-table-from and tst-table-to.
* iconvdata/tst-tables.sh (run_program_prefix): New variable.
Pass it to tst-table.sh.
* intl/Makefile ($(objpfx)tst-gettext.out): Pass
$(run-program-prefix) to tst-gettext.sh.
($(objpfx)tst-translit.out): Pass $(run-program-prefix) to
tst-translit.sh.
($(objpfx)tst-gettext2.out): Pass $(run-program-prefix) to
tst-gettext2.sh.
* intl/tst-gettext.sh (run_program_prefix): New variable. Use it
to run tst-gettext.
* intl/tst-gettext2.sh (run_program_prefix): New variable. Use it
to run tst-gettext2.
* intl/tst-translit.sh (run_program_prefix): New variable. Use it
to run tst-translit.
* malloc/Makefile ($(objpfx)tst-mtrace.out): Pass
$(run-program-prefix) to tst-mtrace.sh.
* malloc/tst-mtrace.sh (run_program_prefix): New variable. Use it
to run tst-mtrace.
* posix/Makefile ($(objpfx)wordexp-tst.out): Pass
$(run-program-prefix) to wordexp-tst.sh, not $(elf-objpfx) and
$(rtld-installed-name).
* posix/wordexp-tst.sh (elf_objpfx): Remove variable.
(rtld_installed_name): Likewise.
(run_program_prefix): New variable. Use it to run wordexp-test.
* Makeconfig (ARCH): Remove all definitions.
(machine): Likewise.
[ARCH]: Remove conditional code.

View File

@ -55,8 +55,7 @@ ifeq (no,$(cross-compiling))
ifeq (yes,$(build-shared))
tests: $(objpfx)tst_fgetgrent.out
$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent
$(SHELL) $< $(common-objpfx) $(elf-objpfx) \
$(rtld-installed-name)
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
endif
endif

View File

@ -20,24 +20,22 @@
set -e
common_objpfx=$1; shift
elf_objpfx=$1; shift
rtld_installed_name=$1; shift
run_program_prefix=$1; shift
testout=${common_objpfx}/grp/tst_fgetgrent.out
library_path=${common_objpfx}
result=0
${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
${run_program_prefix} \
${common_objpfx}grp/tst_fgetgrent 0 > ${testout} || result=1
${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
${run_program_prefix} \
${common_objpfx}grp/tst_fgetgrent 1 >> ${testout} || result=1
${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
${run_program_prefix} \
${common_objpfx}grp/tst_fgetgrent 2 >> ${testout} || result=1
${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
${run_program_prefix} \
${common_objpfx}grp/tst_fgetgrent 3 >> ${testout} || result=1
exit $result

View File

@ -304,7 +304,8 @@ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
$(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
$(addprefix $(objpfx),$(modules.so)) \
$(objpfx)tst-table-from $(objpfx)tst-table-to
$(SHELL) $< $(common-objpfx) $(common-objpfx)iconvdata/ > $@
$(SHELL) $< $(common-objpfx) $(common-objpfx)iconvdata/ \
'$(run-program-prefix)' > $@
do-tests-clean common-mostlyclean: tst-tables-clean

View File

@ -1,5 +1,5 @@
#!/bin/sh
# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
# Copyright (C) 2000-2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
#
@ -23,8 +23,9 @@
common_objpfx=$1
objpfx=$2
charset=$3
charmap=$4
run_program_prefix=$3
charset=$4
charmap=$5
GCONV_PATH=${common_objpfx}iconvdata
export GCONV_PATH
@ -59,12 +60,12 @@ else
fi
# iconv in one direction.
${common_objpfx}elf/ld.so --library-path $common_objpfx \
${run_program_prefix} \
${objpfx}tst-table-from ${charset} \
> ${objpfx}tst-${charset}.table
# iconv in the other direction.
${common_objpfx}elf/ld.so --library-path $common_objpfx \
${run_program_prefix} \
${objpfx}tst-table-to ${charset} | sort \
> ${objpfx}tst-${charset}.inverse.table

View File

@ -1,5 +1,5 @@
#!/bin/sh
# Copyright (C) 2000-2004,2007,2011 Free Software Foundation, Inc.
# Copyright (C) 2000-2012 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
#
@ -23,6 +23,7 @@
common_objpfx=$1
objpfx=$2
run_program_prefix=$3
status=0
@ -261,7 +262,8 @@ while read charset charmap; do
if test "$charset" = GB18030; then echo "This might take a while" 1>&2; fi
case ${charset} in \#*) continue;; esac
echo -n "Testing ${charset}" 1>&2
if ${SHELL} tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}; then
if ${SHELL} tst-table.sh ${common_objpfx} ${objpfx} "${run_program_prefix}" \
${charset} ${charmap}; then
echo 1>&2
else
echo "failed: ./tst-table.sh ${common_objpfx} ${objpfx} ${charset} ${charmap}"

View File

@ -74,12 +74,14 @@ $(codeset_mo): tstcodeset.po
$(objpfx)mtrace-tst-gettext: $(objpfx)tst-gettext.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@
$(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext
$(SHELL) $< $(common-objpfx) $(common-objpfx)intl/ \
$(objpfx)tst-gettext.mtrace
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' \
$(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace
$(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit
$(SHELL) $< $(common-objpfx) $(common-objpfx)intl/
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' \
$(common-objpfx)intl/
$(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2
$(SHELL) $< $(common-objpfx) $(common-objpfx)intl/
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' \
$(common-objpfx)intl/
$(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
$(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6

View File

@ -20,8 +20,9 @@
set -e
common_objpfx=$1
objpfx=$2
malloc_trace=$3
run_program_prefix=$2
objpfx=$3
malloc_trace=$4
LC_ALL=C
export LC_ALL
@ -53,7 +54,7 @@ export LOCPATH
# Now run the test.
MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
${common_objpfx}elf/ld.so --library-path $common_objpfx \
${run_program_prefix} \
${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
exit $?

View File

@ -20,7 +20,8 @@
set -e
common_objpfx=$1
objpfx=$2
run_program_prefix=$2
objpfx=$3
LC_ALL=C
export LC_ALL
@ -66,7 +67,7 @@ LOCPATH=${objpfx}domaindir
export LOCPATH
# Now run the test.
${common_objpfx}elf/ld.so --library-path $common_objpfx \
${run_program_prefix} \
${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
cmp ${objpfx}tst-gettext2.out - <<EOF
String1 - Lang1: 1st string

View File

@ -20,7 +20,8 @@
set -e
common_objpfx=$1
objpfx=$2
run_program_prefix=$2
objpfx=$3
LC_ALL=C
export LC_ALL
@ -36,7 +37,7 @@ export GCONV_PATH
LOCPATH=${common_objpfx}localedata
export LOCPATH
${common_objpfx}elf/ld.so --library-path $common_objpfx \
${run_program_prefix} \
${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
exit $?

View File

@ -109,7 +109,7 @@ ifeq (yes,$(build-shared))
ifneq ($(PERL),no)
tests: $(objpfx)tst-mtrace.out
$(objpfx)tst-mtrace.out: tst-mtrace.sh $(objpfx)tst-mtrace
$(SHELL) $< $(common-objpfx)
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
endif
endif
endif

View File

@ -20,13 +20,14 @@
set -e
common_objpfx=$1; shift
run_program_prefix=$1; shift
status=0
trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
${common_objpfx}elf/ld.so --library-path $common_objpfx \
${run_program_prefix} \
${common_objpfx}malloc/tst-mtrace || status=1
if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then

View File

@ -120,8 +120,7 @@ $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
$(SHELL) $< $(common-objpfx) $(elf-objpfx) \
$(rtld-installed-name)
$(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
$(SHELL) $< $(common-objpfx) $(elf-objpfx) \
$(rtld-installed-name)
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
endif
endif

View File

@ -24,8 +24,7 @@ set -e
# The others are just there to be parameters.
common_objpfx=$1; shift
elf_objpfx=$1; shift
rtld_installed_name=$1; shift
run_program_prefix=$1; shift
logfile=${common_objpfx}posix/wordexp-tst.out
testout=${common_objpfx}posix/wordexp-test-result
@ -39,7 +38,7 @@ IFS=" \
export IFS
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '$*' > ${testout}1
cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
wordexp returned 0
@ -51,7 +50,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '${*}' unquoted > ${testout}2
cat <<"EOF" | cmp - ${testout}2 >> $logfile || failed=1
wordexp returned 0
@ -64,7 +63,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '$@' unquoted > ${testout}3
cat <<"EOF" | cmp - ${testout}3 >> $logfile || failed=1
wordexp returned 0
@ -77,7 +76,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '"$* quoted"' param > ${testout}4
cat <<"EOF" | cmp - ${testout}4 >> $logfile || failed=1
wordexp returned 0
@ -89,7 +88,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '"$@ quoted"' param > ${testout}5
cat <<"EOF" | cmp - ${testout}5 >> $logfile || failed=1
wordexp returned 0
@ -103,7 +102,7 @@ fi
# Why? Because bash does it that way..
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '$#' 2 3 4 5 > ${testout}6
cat <<"EOF" | cmp - ${testout}6 >> $logfile || failed=1
wordexp returned 0
@ -115,7 +114,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${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
@ -130,7 +129,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${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
@ -142,7 +141,7 @@ if test $failed -ne 0; then
fi
failed=0
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '"a $@ b"' c d > ${testout}9
cat <<"EOF" | cmp - ${testout}9 >> $logfile || failed=1
wordexp returned 0
@ -155,7 +154,7 @@ if test $failed -ne 0; then
status=1
fi
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
${run_program_prefix} \
${common_objpfx}posix/wordexp-test '${#@} ${#2} *$**' two 3 4 > ${testout}10
cat <<"EOF" | cmp - ${testout}10 || failed=1
wordexp returned 0