about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--posix/Makefile3
-rwxr-xr-xposix/globtest.sh102
3 files changed, 61 insertions, 55 deletions
diff --git a/ChangeLog b/ChangeLog
index 8eb75d0a43..bc06586903 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-10-23  Joseph Myers  <joseph@codesourcery.com>
+
+	* posix/Makefile ($(objpfx)globtest.out): Pass
+	$(run-program-prefix) to globtest.sh, not $(elf-objpfx) and
+	$(rtld-installed-name).
+	* posix/globtest.sh (elf_objpfx): Remove variable.
+	(rtld_installed_name): Likewise.
+	(library_path): Likewise.
+	(run_program_prefix): New variable.  Use for running globtest
+	binary.
+
 2012-10-23  Jim Blandy  <jimb@codesourcery.com>
 	    Joseph Myers  <joseph@codesourcery.com>
 
diff --git a/posix/Makefile b/posix/Makefile
index f82fff93bb..1871e728a5 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -117,8 +117,7 @@ ifeq (no,$(cross-compiling))
 ifeq (yes,$(build-shared))
 tests: $(objpfx)globtest.out $(objpfx)wordexp-tst.out
 $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
-	$(SHELL) $< $(common-objpfx) $(elf-objpfx) \
-		 $(rtld-installed-name)
+	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
 $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
 	$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
 endif
diff --git a/posix/globtest.sh b/posix/globtest.sh
index 286b1b4912..29277a44c9 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -20,8 +20,7 @@
 set -e
 
 common_objpfx=$1; shift
-elf_objpfx=$1; shift
-rtld_installed_name=$1; shift
+run_program_prefix=$1; shift
 logfile=$common_objpfx/posix/globtest.out
 
 #CMP=cmp
@@ -36,9 +35,6 @@ case "$common_objpfx" in
     ;;
 esac
 
-# We have to find the libc and the NSS modules.
-library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
-
 # Since we use `sort' we must make sure to use the same locale everywhere.
 LC_ALL=C
 export LC_ALL
@@ -78,7 +74,7 @@ rm -f $logfile
 
 # Normal test
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -105,7 +101,7 @@ fi
 
 # Don't let glob sort it
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -s "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -132,7 +128,7 @@ fi
 
 # Mark directories
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -m "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -159,7 +155,7 @@ fi
 
 # Find files starting with .
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -p "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -189,7 +185,7 @@ fi
 
 # Test braces
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b "$testdir" "file{1,2}" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -202,7 +198,7 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b "$testdir" "{file{1,2},-file3}" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -216,7 +212,7 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b "$testdir" "{" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -229,7 +225,7 @@ fi
 
 # Test NOCHECK
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -c "$testdir" "abc" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -242,7 +238,7 @@ fi
 
 # Test NOMAGIC without magic characters
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -g "$testdir" "abc" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -255,7 +251,7 @@ fi
 
 # Test NOMAGIC with magic characters
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -g "$testdir" "abc*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -268,7 +264,7 @@ fi
 
 # Test NOMAGIC for subdirs
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -g "$testdir" "*/does-not-exist" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -281,7 +277,7 @@ fi
 
 # Test subdirs correctly
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -297,7 +293,7 @@ fi
 
 # Test subdirs for invalid names
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/1" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -310,7 +306,7 @@ fi
 
 # Test subdirs with wildcard
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -324,7 +320,7 @@ fi
 
 # Test subdirs with ?
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -339,7 +335,7 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -352,7 +348,7 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*-/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -364,7 +360,7 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*-" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -377,7 +373,7 @@ fi
 
 # Test subdirs with ?
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -393,7 +389,7 @@ fi
 
 # Test subdirs with [ .. ]
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "*/file1_[12]" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -409,7 +405,7 @@ fi
 
 # Test ']' inside bracket expression
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "dir1/file1_[]12]" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -423,7 +419,7 @@ fi
 
 # Test tilde expansion
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -q -t "$testdir" "~" |
 sort >$testout
 echo ~ | $CMP - $testout >> $logfile || failed=1
@@ -438,7 +434,7 @@ fi
 
 # Test tilde expansion with trailing slash
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -q -t "$testdir" "~/" |
 sort > $testout
 # Some shell incorrectly(?) convert ~/ into // if ~ expands to /.
@@ -458,7 +454,7 @@ fi
 
 # Test tilde expansion with username
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -q -t "$testdir" "~"$USER |
 sort > $testout
 eval echo ~$USER | $CMP - $testout >> $logfile || failed=1
@@ -473,7 +469,7 @@ fi
 
 # Tilde expansion shouldn't match a file
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -T "$testdir" "~file4" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -486,7 +482,7 @@ fi
 
 # Matching \** should only find *file6
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "\**" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -500,7 +496,7 @@ fi
 # ... unless NOESCAPE is used, in which case it should entries with a
 # leading \.
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -e "$testdir" "\**" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -515,7 +511,7 @@ fi
 
 # Matching \*file6 should find *file6
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "\*file6" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -528,7 +524,7 @@ fi
 
 # GLOB_BRACE alone
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b "$testdir" '\{file7\,\}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -541,7 +537,7 @@ fi
 
 # GLOB_BRACE and GLOB_NOESCAPE
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b -e "$testdir" '\{file9\,file9b\}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -554,7 +550,7 @@ fi
 
 # Escaped comma
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b "$testdir" '{filea\,}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -567,7 +563,7 @@ fi
 
 # Escaped closing brace
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -b "$testdir" '{fileb\}c}' |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -580,7 +576,7 @@ fi
 
 # Try a recursive failed search
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -e "$testdir" "a*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -593,7 +589,7 @@ fi
 
 # ... with GLOB_ERR
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -E "$testdir" "a*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -606,7 +602,7 @@ fi
 
 # Try a recursive search in unreadable directory
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "noread/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -618,7 +614,7 @@ if test $failed -ne 0; then
 fi
 
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "noread*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -636,14 +632,14 @@ if test -z "$user"; then
 fi
 if test "$user" != root; then
     # ... with GLOB_ERR
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+    ${run_program_prefix} \
     ${common_objpfx}posix/globtest -E "$testdir" "noread/*" |
     sort > $testout
     cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
 GLOB_ABORTED
 EOF
 
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+    ${run_program_prefix} \
     ${common_objpfx}posix/globtest -E "$testdir" "noread*/*" |
     sort > $testout
     cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -657,7 +653,7 @@ fi # not run as root
 
 # Try multiple patterns (GLOB_APPEND)
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest "$testdir" "file1" "*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -674,7 +670,7 @@ fi
 
 # Try multiple patterns (GLOB_APPEND) with offset (GLOB_DOOFFS)
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -o "$testdir" "file1" "*/*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -692,7 +688,7 @@ fi
 
 # Test NOCHECK with non-existing file in subdir.
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -c "$testdir" "*/blahblah" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -705,7 +701,7 @@ fi
 
 # Test [[:punct:]] not matching leading period.
 failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -c "$testdir" "[[:punct:]]*" |
 sort > $testout
 cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -734,10 +730,10 @@ mkdir $testdir/dir6
 echo 6 > $testdir/dir6/'file1[a'
 echo 7 > $testdir/dir6/'file1[ab]'
 failed=0
-v=`${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+v=`${run_program_prefix} \
    ${common_objpfx}posix/globtest "$testdir" 'dir3\*/file2'`
 test "$v" != 'GLOB_NOMATCH' && echo "$v" >> $logfile && failed=1
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -c "$testdir" \
 'dir3\*/file1' 'dir3\*/file2' 'dir1/file\1_1' 'dir1/file\1_9' \
 'dir2\/' 'nondir\/' 'dir4[a/fil*1' 'di*r4[a/file2' 'dir5[ab]/file[12]' \
@@ -762,7 +758,7 @@ cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
 `nondir\/'
 EOF
 HOME="$testdir" \
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
 ${common_objpfx}posix/globtest -ct "$testdir" \
 '~/dir1/file1_1' '~/dir1/file1_9' '~/dir3\*/file1' '~/dir3\*/file2' \
 '~\/dir1/file1_2' |
@@ -777,15 +773,15 @@ EOF
 if eval test -d ~"$USER"/; then
   user=`echo "$USER" | sed -n -e 's/^\([^\\]\)\([^\\][^\\]*\)$/~\1\\\\\2/p'`
   if test -n "$user"; then
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+    ${run_program_prefix} \
     ${common_objpfx}posix/globtest -ctq "$testdir" "$user/" |
     sort > $testout
     eval echo ~$USER/ | $CMP - $testout >> $logfile || failed=1
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+    ${run_program_prefix} \
     ${common_objpfx}posix/globtest -ctq "$testdir" "$user\\/" |
     sort > $testout
     eval echo ~$USER/ | $CMP - $testout >> $logfile || failed=1
-    ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+    ${run_program_prefix} \
     ${common_objpfx}posix/globtest -ctq "$testdir" "$user" |
     sort > $testout
     eval echo ~$USER | $CMP - $testout >> $logfile || failed=1