summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-04-19 21:17:05 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-04-19 21:17:05 +0000
commit0e7e76a63c2b589f90c7bd51eea9a7d335dc6fbd (patch)
treeeee4ba926a73ad21eb7fd8a30a771bb3901ebf33
parent4d6ef84230e89f29432904e08376c7c0ea845732 (diff)
downloadeglibc2-0e7e76a63c2b589f90c7bd51eea9a7d335dc6fbd.tar.gz
* scripts/run-with-env.sh: Also handle
EGLIBC_TEST_LD_LIBRARY_PATH. * dlfcn/Makefile (tststatic-ENV, tststatic2-ENV): Use EGLIBC_TEST_LD_LIBRARY_PATH. (tststatic-WRAPPER, tststatic2-WRAPPER): Define. * elf/Makefile (tst-tls9-static-ENV): Use EGLIBC_TEST_LD_LIBRARY_PATH. (tst-tls9-static-WRAPPER): Define. ($(objpfx)tst-pathopt.out): Pass run-with-env.sh to tst-pathopt.sh. * elf/tst-pathopt.sh: Take run_with_env argument. Use EGLIBC_TEST_LD_LIBRARY_PATH. * io/Makefile ($(objpfx)ftwtest.out): Pass run-with-env.sh to ftwtest-sh. * io/ftwtest-sh: Take run_with_env argument. Use EGLIBC_TEST_LD_LIBRARY_PATH. git-svn-id: svn://svn.eglibc.org/branches/eglibc-2_5@2028 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog.eglibc19
-rw-r--r--libc/dlfcn/Makefile6
-rw-r--r--libc/elf/Makefile6
-rwxr-xr-xlibc/elf/tst-pathopt.sh5
-rw-r--r--libc/io/Makefile1
-rw-r--r--libc/io/ftwtest-sh29
-rwxr-xr-xlibc/scripts/run-with-env.sh4
7 files changed, 51 insertions, 19 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc
index e478930c9..a23d2efb6 100644
--- a/libc/ChangeLog.eglibc
+++ b/libc/ChangeLog.eglibc
@@ -1,3 +1,22 @@
+2007-04-19 Joseph Myers <joseph@codesourcery.com>
+
+ * scripts/run-with-env.sh: Also handle
+ EGLIBC_TEST_LD_LIBRARY_PATH.
+ * dlfcn/Makefile (tststatic-ENV, tststatic2-ENV): Use
+ EGLIBC_TEST_LD_LIBRARY_PATH.
+ (tststatic-WRAPPER, tststatic2-WRAPPER): Define.
+ * elf/Makefile (tst-tls9-static-ENV): Use
+ EGLIBC_TEST_LD_LIBRARY_PATH.
+ (tst-tls9-static-WRAPPER): Define.
+ ($(objpfx)tst-pathopt.out): Pass run-with-env.sh to
+ tst-pathopt.sh.
+ * elf/tst-pathopt.sh: Take run_with_env argument. Use
+ EGLIBC_TEST_LD_LIBRARY_PATH.
+ * io/Makefile ($(objpfx)ftwtest.out): Pass run-with-env.sh to
+ ftwtest-sh.
+ * io/ftwtest-sh: Take run_with_env argument. Use
+ EGLIBC_TEST_LD_LIBRARY_PATH.
+
2007-04-18 Joseph Myers <joseph@codesourcery.com>
* scripts/cross-test-ssh.sh: Use printf in place of echo.
diff --git a/libc/dlfcn/Makefile b/libc/dlfcn/Makefile
index 63e7b31b2..19d621aba 100644
--- a/libc/dlfcn/Makefile
+++ b/libc/dlfcn/Makefile
@@ -59,8 +59,10 @@ ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
tests += tststatic tststatic2
tests-static += tststatic tststatic2
modules-names += modstatic modstatic2
-tststatic-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
-tststatic2-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic-ENV = EGLIBC_TEST_LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic-WRAPPER = $(..)scripts/run-with-env.sh
+tststatic2-ENV = EGLIBC_TEST_LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic2-WRAPPER = $(..)scripts/run-with-env.sh
endif
extra-test-objs += $(modules-names:=.os)
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index 4930b078f..5fdc165f3 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -149,7 +149,8 @@ tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static
ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
tests-static += tst-tls9-static
tst-tls9-static-ENV = \
- LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+ EGLIBC_TEST_LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+tst-tls9-static-WRAPPER = $(..)scripts/run-with-env.sh
endif
ifeq (yes,$(have-initfini-array))
tests-static += tst-array1-static tst-array5-static
@@ -643,7 +644,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) -e $< $(common-objpfx) "$(cross-test-wrapper)"
+ $(SHELL) -e $< $(common-objpfx) "$(cross-test-wrapper)" \
+ $(..)scripts/run-with-env.sh
$(objpfx)initfirst: $(libdl)
$(objpfx)initfirst.out: $(objpfx)firstobj.so
diff --git a/libc/elf/tst-pathopt.sh b/libc/elf/tst-pathopt.sh
index c52ec264e..d68c3cdfc 100755
--- a/libc/elf/tst-pathopt.sh
+++ b/libc/elf/tst-pathopt.sh
@@ -21,6 +21,7 @@
common_objpfx=$1
cross_test_wrapper="$2"
+run_with_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
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 \
- ${cross_test_wrapper} ${common_objpfx}elf/ld.so \
+LC_ALL=C EGLIBC_TEST_LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
+ ${cross_test_wrapper} ${run_with_env} ${common_objpfx}elf/ld.so \
${common_objpfx}elf/tst-pathopt \
> ${common_objpfx}elf/tst-pathopt.out
diff --git a/libc/io/Makefile b/libc/io/Makefile
index a6f7c6537..1b6438aea 100644
--- a/libc/io/Makefile
+++ b/libc/io/Makefile
@@ -121,6 +121,7 @@ $(objpfx)ftwtest.out: $(objpfx)ftwtest
$(ftwtest-tmpdir) \
$(SHELL) -e ftwtest-sh $(shell cd $(common-objpfx). && pwd)/ \
'$(cross-test-wrapper)' \
+ $(shell cd $(..)scripts && pwd)/run-with-env.sh \
$(shell cd $(<D) && pwd)/$(<F) > $@
# eglibc: endif
diff --git a/libc/io/ftwtest-sh b/libc/io/ftwtest-sh
index 275dd7601..2036294df 100644
--- a/libc/io/ftwtest-sh
+++ b/libc/io/ftwtest-sh
@@ -6,6 +6,9 @@ objpfx=$1
# The cross-testing wrapper.
cross_test_wrapper="$2"
+# The environment-setting wrapper.
+run_with_env="$3"
+
# We expect one parameter which is the test program. This must understand
# a number options:
# --phys use the FTW_PHYS flag
@@ -14,7 +17,7 @@ cross_test_wrapper="$2"
# --depth use the FTW_DEPTH flag
# --early-exit print file@2 item only and return non-zero from the
# callback when it is seen
-testprogram=$3
+testprogram=$4
# We cannot test this as root.
if test `id | sed "s/uid=\([0-9]*\).*/\1/"` = 0; then
@@ -32,7 +35,7 @@ tmp=`echo ${TMPDIR:-/tmp} | sed 's|\(.\)/*$|\1|'`
tmpdir=$tmp/ftwtest.d
[ -f ${objpfx}elf/ld.so ] && ldso=${objpfx}elf/ld.so
-ldso="${cross_test_wrapper:+$cross_test_wrapper }$ldso"
+ldso="${cross_test_wrapper:+$cross_test_wrapper }$run_with_env $ldso"
trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
@@ -58,7 +61,7 @@ chmod a-x,a+r $tmpdir/bar
testout=${TMPDIR:-/tmp}/ftwtest.out
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
@@ -77,7 +80,7 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, leve
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --depth $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --depth $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
@@ -96,7 +99,7 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, leve
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --phys $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --phys $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
@@ -120,7 +123,7 @@ rm $testout
# For the next test everything must be readable.
chmod -fR a+x $tmpdir
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
sort > $testout
# perhaps $tmp involves some symlinks...
@@ -144,7 +147,7 @@ rm $testout
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
sort > $testout
cd "$curwd"
@@ -166,7 +169,7 @@ rm $testout
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
sort > $testout
cd "$curwd"
@@ -188,7 +191,7 @@ rm $testout
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
sort > $testout
cd "$curwd"
@@ -197,7 +200,7 @@ base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ft
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
@@ -211,7 +214,7 @@ echo > $tmpdir/foo/lvl1b/file@1b
echo > $tmpdir/foo/lvl1b/file2@1b
echo > $tmpdir/foo/lvl1b/file3@1b
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir |
sort > $testout
cat <<EOF | diff -u $testout - || exit 1
@@ -228,7 +231,7 @@ base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=lvl1 $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=lvl1 $tmpdir |
sort > $testout
# The filesystem is not required to put lvl1 before lvl1b.
@@ -252,7 +255,7 @@ base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir |
sort > $testout
# The filesystem is not required to put file2@1b and file3@1b after file@1b.
diff --git a/libc/scripts/run-with-env.sh b/libc/scripts/run-with-env.sh
index 0fc0d7ea5..82b3aa385 100755
--- a/libc/scripts/run-with-env.sh
+++ b/libc/scripts/run-with-env.sh
@@ -17,4 +17,8 @@ if [ "${EGLIBC_TEST_LD_AUDIT+set}" ]; then
export LD_AUDIT="${EGLIBC_TEST_LD_AUDIT}"
fi
+if [ "${EGLIBC_TEST_LD_LIBRARY_PATH+set}" ]; then
+ export LD_LIBRARY_PATH="${EGLIBC_TEST_LD_LIBRARY_PATH}"
+fi
+
exec "$@"