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/io | |
parent | fbeabbdc554f256444af02146bec6b76541c75a8 (diff) |
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/io')
-rw-r--r-- | libc/io/Makefile | 14 | ||||
-rw-r--r-- | libc/io/ftwtest-sh | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/libc/io/Makefile b/libc/io/Makefile index 18287b201..011a1c999 100644 --- a/libc/io/Makefile +++ b/libc/io/Makefile @@ -94,10 +94,20 @@ test-stat2-ARGS = Makefile . $(objpfx)test-stat2 tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp -ifeq ($(cross-compiling),no) +# eglibc: ifeq ($(cross-compiling),no) tests: $(objpfx)ftwtest.out +ifeq ($(cross-compiling),yes) +# EGLIBC's cross-testing support does not require the build and host +# machines to share a /tmp directory, so when cross-testing, construct +# the sample directory tree for these tests in the build tree. +ftwtest-tmpdir = TMPDIR=$(common-objpfx) +endif + $(objpfx)ftwtest.out: $(objpfx)ftwtest + $(ftwtest-tmpdir) \ $(SHELL) -e ftwtest-sh $(shell cd $(common-objpfx). && pwd)/ \ + '$(cross-test-wrapper)' \ $(shell cd $(<D) && pwd)/$(<F) > $@ -endif + +# eglibc: endif diff --git a/libc/io/ftwtest-sh b/libc/io/ftwtest-sh index 6444ece2a..275dd7601 100644 --- a/libc/io/ftwtest-sh +++ b/libc/io/ftwtest-sh @@ -3,6 +3,9 @@ # The common objpfx, used to find libraries and the dynamic loader. objpfx=$1 +# The cross-testing wrapper. +cross_test_wrapper="$2" + # We expect one parameter which is the test program. This must understand # a number options: # --phys use the FTW_PHYS flag @@ -11,7 +14,7 @@ objpfx=$1 # --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=$2 +testprogram=$3 # We cannot test this as root. if test `id | sed "s/uid=\([0-9]*\).*/\1/"` = 0; then @@ -29,6 +32,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" trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15 |