mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 05:20:06 +00:00
ceb579a3f8
2000-10-19 H.J. Lu <hjl@gnu.org> * elf/Makefile (distribute): Add neededtest.c, neededobj1.c, neededobj2.c and neededobj3.c. (tests): Add neededtest. (modules-names): Add neededobj1, neededobj2 and neededobj3. ($(objpfx)neededobj1.so): New target. ($(objpfx)neededobj2.so): Likewise. ($(objpfx)neededobj3.so): Likewise. ($(objpfx)neededtest): Likewise. ($(objpfx)neededtest.out): Likewise. * elf/neededtest.c: New. Based on the bug report from Allen Bauer <kylix_rd@hotmail.com>. * elf/neededobj1.c: Likewise. * elf/neededobj2.c: Likewise. * elf/neededobj3.c: Likewise. 2000-10-20 Ulrich Drepper <drepper@redhat.com> * elf/dl-close.c (_dl_close): Decrement reference counter for all dependencies even if the DSO does not get unloaded. * elf/dl-load.c (_dl_map_object_from_fd): Pass pointer to ELF header to elf_machine_matches_host. * sysdeps/alpha/dl-machine.h (elf_machine_matches_host): Parameter is now pointer to ELF header. * sysdeps/arm/dl-machine.h: Likewise. * sysdeps/generic/dl-machine.h: Likewise. * sysdeps/hppa/dl-machine.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/ia64/dl-machine.h: Likewise. * sysdeps/m68k/dl-machine.h: Likewise. * sysdeps/mips/dl-machine.h: Likewise. * sysdeps/mips/mips64/dl-machine.h: Likewise. * sysdeps/powerpc/dl-machine.h: Likewise. * sysdeps/s390/dl-machine.h: Likewise. * sysdeps/sh/dl-machine.h: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/sparc/sparc64/dl-machine.h: Likewise. Patch by Martin Schwidefsksy <schwidefsky@de.ibm.com>. 2000-10-20 Jakub Jelinek <jakub@redhat.com> * include/limits.h: Include bits/wordsize.h, use #if __WORDSIZE == 64 check instead of #ifdef __alpha__. * include/bits/xopen_lim.h (WORD_BIT, LONG_BIT): Don't count on INT_MAX, __INT_MAX__, LONG_MAX or __LONG_MAX__ being defined when this is included. * posix/wordexp-tst.sh (testout): Place output file in build directory. Patch by Joseph S. Myers <jsm28@cam.ac.uk>.
154 lines
3.9 KiB
Bash
Executable File
154 lines
3.9 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Some of these tests may look a little weird.
|
|
# The first parameter to wordexp-test is what it gives to wordexp.
|
|
# The others are just there to be parameters.
|
|
|
|
common_objpfx=$1; shift
|
|
elf_objpfx=$1; shift
|
|
rtld_installed_name=$1; shift
|
|
logfile=${common_objpfx}posix/wordexp-tst.out
|
|
testout=${common_objpfx}posix/wordexp-test-result
|
|
|
|
result=0
|
|
rm -f $logfile
|
|
# This is written in this funny way so that there is no trailing whitespace.
|
|
# The first line contains a space followed by a tab.
|
|
IFS=" \
|
|
|
|
"
|
|
export IFS
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '$*' > ${testout}1
|
|
cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = "$*"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '$* test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '${*}' unquoted > ${testout}2
|
|
cat <<"EOF" | cmp - ${testout}2 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = "${*}"
|
|
we_wordv[1] = "unquoted"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '${*} test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '$@' unquoted > ${testout}3
|
|
cat <<"EOF" | cmp - ${testout}3 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = "$@"
|
|
we_wordv[1] = "unquoted"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '$@ test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '"$* quoted"' param > ${testout}4
|
|
cat <<"EOF" | cmp - ${testout}4 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = ""$* quoted" param quoted"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '$* quoted test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '"$@ quoted"' param > ${testout}5
|
|
cat <<"EOF" | cmp - ${testout}5 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = ""$@ quoted""
|
|
we_wordv[1] = "param quoted"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '$@ quoted test failed'
|
|
status=1
|
|
fi
|
|
# Why? Because bash does it that way..
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '$#' 2 3 4 5 > ${testout}6
|
|
cat <<"EOF" | cmp - ${testout}6 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = "5"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '$# test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${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
|
|
we_wordv[0] = "2nd"
|
|
we_wordv[1] = "3rd"
|
|
we_wordv[2] = "4"
|
|
we_wordv[3] = "th"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '$2 ${3} $4 test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${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
|
|
we_wordv[0] = "11"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '${11} test failed'
|
|
status=1
|
|
fi
|
|
|
|
failed=0
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '"a $@ b"' c d > ${testout}9
|
|
cat <<"EOF" | cmp - ${testout}9 >> $logfile || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = "a "a $@ b""
|
|
we_wordv[1] = "c"
|
|
we_wordv[2] = "d b"
|
|
EOF
|
|
if test $failed -ne 0; then
|
|
echo '"a $@ b" test failed'
|
|
status=1
|
|
fi
|
|
|
|
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
|
${common_objpfx}posix/wordexp-test '${#@} ${#2} *$**' two 3 4 > ${testout}10
|
|
cat <<"EOF" | cmp - ${testout}10 || failed=1
|
|
wordexp returned 0
|
|
we_wordv[0] = "4"
|
|
we_wordv[1] = "3"
|
|
we_wordv[2] = "*${#@}"
|
|
we_wordv[3] = "${#2}"
|
|
we_wordv[4] = "*$**"
|
|
we_wordv[5] = "two"
|
|
we_wordv[6] = "3"
|
|
we_wordv[7] = "4*"
|
|
EOF
|
|
|
|
exit $result
|