2012-10-19 Joseph Myers <joseph@codesourcery.com>
+ * io/Makefile ($(objpfx)ftwtest.out): Depend on ftwtest-sh. Pass
+ script to $(SHELL) as $<. Pass $(common-objpfx) to script
+ directly. Pass built executable to script as
+ $(built-program-cmd).
+ * io/ftwtest-sh (ldso): Remove variable. Run ftwtest directly as
+ $testprogram without using LD_LIBRARY_PATH and $ldso.
+
* grp/Makefile ($(objpfx)tst_fgetgrent.out): Pass
$(run-program-prefix) to tst_fgetgrent.sh, not $(elf-objpfx) and
$(rtld-installed-name).
ifeq ($(cross-compiling),no)
tests: $(objpfx)ftwtest.out
-$(objpfx)ftwtest.out: $(objpfx)ftwtest
- $(SHELL) ftwtest-sh $(shell cd $(common-objpfx). && pwd)/ \
- $(shell cd $(<D) && pwd)/$(<F) > $@
+$(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
+ $(SHELL) $< $(common-objpfx) '$(built-program-cmd)' > $@
endif
tmp=`pwd | sed 's|\(.\)/*$|\1|'`
tmpdir=$tmp/ftwtest.d
-[ -f ${objpfx}elf/ld.so ] && ldso=${objpfx}elf/ld.so
-
trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
if test -d $tmpdir; then
testout=$tmp/ftwtest.out
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir |
+$testprogram $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --depth $tmpdir |
+$testprogram --depth $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --phys $tmpdir |
+$testprogram --phys $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
# For the next test everything must be readable.
chmod -fR a+x $tmpdir
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
+$testprogram --chdir $tmpdir |
sort > $testout
# perhaps $tmp involves some symlinks...
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
+$testprogram --chdir ftwtest.d |
sort > $testout
cd "$curwd"
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
+$testprogram --chdir ftwtest.d/. |
sort > $testout
cd "$curwd"
curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
+$testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
sort > $testout
cd "$curwd"
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
+$testprogram --early-exit $tmpdir |
sort > $testout
cat <<EOF | cmp $testout - || exit 1
echo > $tmpdir/foo/lvl1b/file2@1b
echo > $tmpdir/foo/lvl1b/file3@1b
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir |
+$testprogram --skip-subtree=lvl1 $tmpdir |
sort > $testout
cat <<EOF | diff -u $testout - || exit 1
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=lvl1 $tmpdir |
+$testprogram --skip-siblings=lvl1 $tmpdir |
sort > $testout
# The filesystem is not required to put lvl1 before lvl1b.
EOF
rm $testout
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir |
+$testprogram --skip-siblings=file@1b $tmpdir |
sort > $testout
# The filesystem is not required to put file2@1b and file3@1b after file@1b.