diff options
author | Bruno Haible <bruno@clisp.org> | 2009-08-16 22:40:51 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-08-16 22:40:51 +0200 |
commit | a3ae6e8ac4e122d3492ea9739e7cd0242fca9a31 (patch) | |
tree | 2aadaa0dcd489f6bf4e2e091162e25daf2dbb21c /tests | |
parent | cdddf7b20eca3616b8818359ec7f0a8900e462e6 (diff) | |
download | gnulib-a3ae6e8ac4e122d3492ea9739e7cd0242fca9a31.tar.gz |
Fix test failures on Solaris 10.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-pipe-filter-gi1.c | 11 | ||||
-rwxr-xr-x | tests/test-pipe-filter-gi1.sh | 15 | ||||
-rw-r--r-- | tests/test-pipe-filter-ii1.c | 11 | ||||
-rwxr-xr-x | tests/test-pipe-filter-ii1.sh | 15 |
4 files changed, 38 insertions, 14 deletions
diff --git a/tests/test-pipe-filter-gi1.c b/tests/test-pipe-filter-gi1.c index 95b9aa0cd9..00cbb06f20 100644 --- a/tests/test-pipe-filter-gi1.c +++ b/tests/test-pipe-filter-gi1.c @@ -83,16 +83,19 @@ done_read (void *data_read, size_t num_bytes_read, void *private_data) int main (int argc, char *argv[]) { + const char *tr_program; const char *input_filename; size_t input_size; char *input; set_program_name (argv[0]); - ASSERT (argc == 2); + ASSERT (argc == 3); + + tr_program = argv[1]; /* Read some text from a file. */ - input_filename = argv[1]; + input_filename = argv[2]; input = read_binary_file (input_filename, &input_size); ASSERT (input != NULL); @@ -106,12 +109,12 @@ main (int argc, char *argv[]) l.input = input; l.nread = 0; - argv[0] = "tr"; + argv[0] = tr_program; argv[1] = "a-z"; argv[2] = "A-Z"; argv[3] = NULL; - f = pipe_filter_gi_create ("tr", "tr", argv, false, true, + f = pipe_filter_gi_create ("tr", tr_program, argv, false, true, prepare_read, done_read, &l); ASSERT (f != NULL); result = pipe_filter_gi_write (f, input, input_size); diff --git a/tests/test-pipe-filter-gi1.sh b/tests/test-pipe-filter-gi1.sh index dfd3eee295..a657980e0a 100755 --- a/tests/test-pipe-filter-gi1.sh +++ b/tests/test-pipe-filter-gi1.sh @@ -1,7 +1,16 @@ #!/bin/sh + +# Find a 'tr' program that supports character ranges in the POSIX syntax. +# Solaris /usr/bin/tr does not. +if test -f /usr/xpg4/bin/tr; then + TR=/usr/xpg4/bin/tr +else + TR=tr +fi + # A small file. -./test-pipe-filter-gi1${EXEEXT} "${srcdir}/test-pipe-filter-gi1.sh" || exit 1 +./test-pipe-filter-gi1${EXEEXT} ${TR} "${srcdir}/test-pipe-filter-gi1.sh" || exit 1 # A medium-sized file. -./test-pipe-filter-gi1${EXEEXT} "${srcdir}/test-pipe-filter-gi1.c" || exit 1 +./test-pipe-filter-gi1${EXEEXT} ${TR} "${srcdir}/test-pipe-filter-gi1.c" || exit 1 # A large file. -./test-pipe-filter-gi1${EXEEXT} "${srcdir}/test-vasnprintf-posix.c" || exit 1 +./test-pipe-filter-gi1${EXEEXT} ${TR} "${srcdir}/test-vasnprintf-posix.c" || exit 1 diff --git a/tests/test-pipe-filter-ii1.c b/tests/test-pipe-filter-ii1.c index a782afc421..016c042fa5 100644 --- a/tests/test-pipe-filter-ii1.c +++ b/tests/test-pipe-filter-ii1.c @@ -105,16 +105,19 @@ done_read (void *data_read, size_t num_bytes_read, void *private_data) int main (int argc, char *argv[]) { + const char *tr_program; const char *input_filename; size_t input_size; char *input; set_program_name (argv[0]); - ASSERT (argc == 2); + ASSERT (argc == 3); + + tr_program = argv[1]; /* Read some text from a file. */ - input_filename = argv[1]; + input_filename = argv[2]; input = read_binary_file (input_filename, &input_size); ASSERT (input != NULL); @@ -129,12 +132,12 @@ main (int argc, char *argv[]) l.nwritten = 0; l.nread = 0; - argv[0] = "tr"; + argv[0] = tr_program; argv[1] = "a-z"; argv[2] = "A-Z"; argv[3] = NULL; - result = pipe_filter_ii_execute ("tr", "tr", argv, false, true, + result = pipe_filter_ii_execute ("tr", tr_program, argv, false, true, prepare_write, done_write, prepare_read, done_read, &l); diff --git a/tests/test-pipe-filter-ii1.sh b/tests/test-pipe-filter-ii1.sh index e301b5dd42..55f4b1e443 100755 --- a/tests/test-pipe-filter-ii1.sh +++ b/tests/test-pipe-filter-ii1.sh @@ -1,7 +1,16 @@ #!/bin/sh + +# Find a 'tr' program that supports character ranges in the POSIX syntax. +# Solaris /usr/bin/tr does not. +if test -f /usr/xpg4/bin/tr; then + TR=/usr/xpg4/bin/tr +else + TR=tr +fi + # A small file. -./test-pipe-filter-ii1${EXEEXT} "${srcdir}/test-pipe-filter-ii1.sh" || exit 1 +./test-pipe-filter-ii1${EXEEXT} ${TR} "${srcdir}/test-pipe-filter-ii1.sh" || exit 1 # A medium-sized file. -./test-pipe-filter-ii1${EXEEXT} "${srcdir}/test-pipe-filter-ii1.c" || exit 1 +./test-pipe-filter-ii1${EXEEXT} ${TR} "${srcdir}/test-pipe-filter-ii1.c" || exit 1 # A large file. -./test-pipe-filter-ii1${EXEEXT} "${srcdir}/test-vasnprintf-posix.c" || exit 1 +./test-pipe-filter-ii1${EXEEXT} ${TR} "${srcdir}/test-vasnprintf-posix.c" || exit 1 |