diff options
author | jimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-02-06 00:34:17 +0000 |
---|---|---|
committer | jimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-02-06 00:34:17 +0000 |
commit | 7b429583feca5de495025499509b1ae21ac21ad1 (patch) | |
tree | d7171eb01a658e014cf367b1dc9947342390a9fa /libc/posix/globtest.sh | |
parent | fbeabbdc554f256444af02146bec6b76541c75a8 (diff) | |
download | eglibc2-7b429583feca5de495025499509b1ae21ac21ad1.tar.gz |
Add support for cross-testing.
Remove Make conditionals that disable running tests or generating
test input files when cross-compiling.
* Rules: Disable conditionals.
* stdlib/Makefile: Same.
* libio/Makefile: Same.
* intl/Makefile: Same.
* iconvdata/Makefile: Same.
* localedata/Makefile: Same.
* catgets/Makefile: Same.
* misc/Makefile: Same.
* posix/Makefile: Same.
* string/Makefile: Same.
* stdio-common/Makefile: Same.
* resolv/Makefile: Same.
* iconv/Makefile: Same.
* grp/Makefile: Same.
* elf/Makefile: Same.
* malloc/Makefile: Same.
* io/Makefile: Same.
Where tests run binaries, have them use cross-test-wrapper, if
set.
* Makeconfig (run-program-prefix): Split this into two pieces:
(run-via-rtld-prefix): Prefix to run something via the dynamic linker.
(run-program-prefix): Prefix to run something via the
cross-testing wrapper and the dynamic linker.
(built-program-command): Run the rule's second dependency, using the
cross-test-wrapper and dynamic linker.
(local-built-program-cmd): Like built-program-command, but don't
use cross-test-wrapper.
* intl/Makefile: Pass cross-test-wrapper to scripts.
* intl/tst-codeset.sh, intl/tst-gettext.sh, intl/tst-gettext2.sh:
* intl/tst-gettext3.sh, intl/tst-translit.sh: Expect and use wrapper.
* iconvdata/Makefile: Pass cross-test-wrapper to scripts.
* iconvdata/run-iconv-test.sh, iconvdata/tst-table.sh:
* iconvdata/tst-tables.sh: Expect and use wrapper.
* posix/Makefile: Pass cross-test-wrapper to scripts. Pass
local-built-program-command to tests which run subprograms.
* posix/tst-getconf.sh, posix/globtest.sh:
* posix/workexp-tst.sh: Expect and use wrapper.
* grp/Makefile: Pass cross-test-wrapper to scripts.
* grp/tst-fgetgrent.sh: Expect and use wrapper.
* elf/Makefile: Pass cross-test-wrapper to scripts. Use
cross-test-wrapper to run binaries. Pass
local-built-program-command to tests which run subprograms.
* elf/tst-pathopt.sh: Expect and use wrapper.
* malloc/Makefile: Pass cross-test-wrapper to scripts.
* malloc/tst-mtrace.sh: Expect and use wrapper.
* io/Makefile: Pass cross-test-wrapper to scripts.
* io/ftwtest-sh: Expect and use wrapper.
* nptl/Makefile: Pass cross-test-wrapper to scripts. Pass
local-built-program-command to tests which run subprograms.
* nptl/tst-tls6.sh: Expect and use wrapper.
* rt/makefile (tst-mqueue7-ARGS): Pass local-built-program-command.
Make sure cross-testing wrappers don't steal input from test
script loops.
* iconvdata/run-iconv-test.sh: Use non-stdin file descriptor for
while loop input.
* iconvdata/tst-tables.sh: Redirect loop body input from /dev/null.
* localedata/tst-rpmatch.sh, localedata/tst-fmon.sh: Same.
* localedata/tst-numeric.sh: Same.
* posix/tst-getconf.sh: Same.
* localedata/tst-wctype.sh: Take the command to run as an
argument, as passed by the Makefile, not run_program_prefix.
* io/Makefile ($(objpfx)/ftwtest.out): If cross-testing, use build
tree for temporary directory.
* localedata/Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use
cross-localedef program, if specified.
* scripts/cross-test-ssh.sh: New file: sample cross-test wrapper.
git-svn-id: svn://svn.eglibc.org/trunk@1386 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/posix/globtest.sh')
-rwxr-xr-x | libc/posix/globtest.sh | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/libc/posix/globtest.sh b/libc/posix/globtest.sh index 09af6f74f..9c1267f9f 100755 --- a/libc/posix/globtest.sh +++ b/libc/posix/globtest.sh @@ -3,6 +3,7 @@ common_objpfx=$1; shift elf_objpfx=$1; shift rtld_installed_name=$1; shift +cross_test_wrapper=$1; shift logfile=$common_objpfx/posix/globtest.out #CMP=cmp @@ -20,6 +21,9 @@ 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 +run_program_prefix="${cross_test_wrapper} \ +${elf_objpfx}${rtld_installed_name} --library-path ${library_path}" + # Since we use `sort' we must make sure to use the same locale everywhere. LC_ALL=C export LC_ALL @@ -62,7 +66,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 @@ -89,7 +93,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 @@ -116,7 +120,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 @@ -143,7 +147,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 @@ -173,7 +177,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 @@ -186,7 +190,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 @@ -200,7 +204,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 @@ -213,7 +217,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 @@ -226,7 +230,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 @@ -239,7 +243,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 @@ -252,7 +256,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 @@ -265,7 +269,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 @@ -281,7 +285,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 @@ -294,7 +298,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 @@ -308,7 +312,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 @@ -323,7 +327,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 @@ -336,7 +340,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 @@ -348,7 +352,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 @@ -361,7 +365,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 @@ -377,7 +381,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 @@ -393,7 +397,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 @@ -407,7 +411,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 @@ -422,7 +426,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 /. @@ -442,7 +446,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 @@ -457,7 +461,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 @@ -470,7 +474,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 @@ -484,7 +488,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 @@ -499,7 +503,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 @@ -512,7 +516,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 @@ -525,7 +529,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 @@ -538,7 +542,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 @@ -551,7 +555,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 @@ -564,7 +568,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 @@ -577,7 +581,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 @@ -590,7 +594,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 @@ -602,7 +606,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 @@ -620,14 +624,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 @@ -641,7 +645,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 @@ -658,7 +662,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 @@ -676,7 +680,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 @@ -689,7 +693,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 |