8 Commits
Author SHA1 Message Date
Jim Meyering 5aad650f4e init.sh: avoid Solaris 10 /bin/sh portability problem
Solaris 10's /bin/sh does not pass '.' arguments 2..N to the
sourced script:
  $ printf 'echo "$@"\n' > f; /bin/sh -c '. ./f bar'
  $ printf 'echo "$@"\n' > f;    bash -c '. ./f bar'
  bar
tests/init.sh relied on that, accepting a --set-path=DIR argument,
and two tests used that idiom.
* tests/init.sh: Update suggested usage comments.
(path_prepend_): New function, to be used in place of
the --src-path=DIR option.
Disallow empty strings and strings containing ":".
(setup_): Move PATH-prepending code into path_prepend_.
* tests/test-pread.sh: Adapt to new usage.
* tests/test-xalloc-die.sh: Likewise.
2009-12-08 21:13:46 +01:00
Jim Meyering 94a77054e5 init.sh: accommodate even those who specify bogus srcdir manually
* tests/init.sh: Normally, srcdir is guaranteed by automake and
configure-time tests to be sanitized, so that there is no need to
use "$srcdir" in Makefile rules and shell scripts.  Using $srcdir
(with no double quotes) suffices.  However, since tests may be
invoked manually, and since you may explicitly set srcdir to the
name of a directory containing spaces, do quote its uses here.
* tests/test-pread.sh: Likewise.
Suggested by Bruno Haible.
2009-11-26 09:10:04 +01:00
Jim Meyering 2fbe772172 test-pread.sh: avoid diagnostics for those who ignore SIGPIPE
* tests/test-pread.sh: Write no data into the pipe, because
test-pread actually reads none.  This avoids a diagnostic,
"bash: echo: write error: Broken pipe", that arises in the unusual
event something is ignoring SIGPIPE, and might be interpreted
as some sort of failure.  Reported by Bruno Haible.
2009-11-26 08:51:11 +01:00
Jim Meyering 1baf5e2a66 test-pread: cover failure with ESPIPE and EINVAL
* tests/test-pread.c (main): Test for failure, too.
* tests/test-pread.sh: Invoke with stdin on a pipe.
Suggested by Eric Blake.
2009-11-25 18:26:35 +01:00
Jim Meyering 9b1723bc19 test-pread.sh: clean up
* tests/test-pread.sh: Don't refer to $builddir. Just use equivalent ".".
* modules/pread-tests (TESTS_ENVIRONMENT): Don't export builddir.
That is unnecessary, since it's always ".".
Suggestion from Eric Blake.
2009-11-25 16:52:47 +01:00
Jim Meyering e185811dcc test-pread.sh: make executable
* tests/test-pread.sh: Set executable bit.
Reported by Eric Blake.
2009-11-25 16:37:42 +01:00
Jim Meyering a722f9972c correct typo in test-pread.sh
* tests/test-pread.sh: Add #! line.
2009-11-25 16:14:19 +01:00
Jim Meyering ebbfe98516 test pread
* tests/test-pread.c: New file.
* tests/test-pread.sh: Likewise.
* modules/pread-tests: Likewise.
2009-11-25 16:09:23 +01:00